From e3ecb66a70837c2025cb7f1647c89ebfe3672409 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 10 Jun 2019 17:58:33 +0200 Subject: [PATCH] test address binding in molecule --- molecule/ec2-centos-7/tests/test_default.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/molecule/ec2-centos-7/tests/test_default.py b/molecule/ec2-centos-7/tests/test_default.py index dfc4b52..f68c95d 100644 --- a/molecule/ec2-centos-7/tests/test_default.py +++ b/molecule/ec2-centos-7/tests/test_default.py @@ -22,6 +22,7 @@ def test_mosquitto_running_and_enabled(host): def test_mosquitto_socket(host): # Verify the socket is listening for HTTP traffic - ansible_vars = host.ansible.get_variables() - assert host.socket("tcp://{}:8883".format( - ansible_vars['ansible_default_ipv4']['address'])).is_listening + inventory = yaml.load(open(host.backend.ansible_inventory)) + address = inventory['all']['hosts']['bind_host']['ansible_host'] + assert host.socket( + "tcp://{address}:8883".format(address=address).is_listening