def test_run_checks_on_standalone_config(self): r = zoocfg.main(['-f', 'samples/standalone-zoo.cfg', '-w']) output = """Warnings: * You should run at least 3 ZooKeeper servers. * The `dataLogDir` should not use the same partition as `dataDir` in order to avoid competition between logging and snapshots. Having a dedicated log device has a large impact on throughput and stable latencies. """ assert r == 1 assert self.stdout() == output
def test_run_checks_on_replicated_config(self): r = zoocfg.main(['-f', 'samples/replicated-zoo.cfg', '-w']) output = """Warnings: * The `dataLogDir` should not use the same partition as `dataDir` in order to avoid competition between logging and snapshots. Having a dedicated log device has a large impact on throughput and stable latencies. * `dataDir` contains a relative path. This could be a problem if ZooKeeper is running as daemon. * Your ensemble contains more than 3 servers. It's recommended to set `leaderServers` to `no`. This willallow the leader to focus only on coordination. """ assert r == 1 assert self.stdout() == output
def test_file_param_is_mandatory(self): r = zoocfg.main([]) assert r == -1 assert self.stderr() == 'Config file name is mandatory.\n'