diff --git a/testinfra/test_zookeeper.py b/testinfra/test_zookeeper.py index 4b638d2fdc..b2fea0edc2 100644 --- a/testinfra/test_zookeeper.py +++ b/testinfra/test_zookeeper.py @@ -24,6 +24,12 @@ def test_id_file(host): myid = host.file('/var/zookeeper/data/myid') assert myid.content == b'4\n' +def test_zk_myid_is_set(host): + # Test that our wacky hostname regex results in the correct + # myid value in the running service. + cmd = host.run("docker logs zookeeper-compose_zk_1") + assert "[myid:4]" in cmd.stdout + def test_zk_listening(host): zk = host.socket("tcp://0.0.0.0:2181") assert zk.is_listening