From 54173f659d84e03ce74bcc1aeaaae69b7186b882 Mon Sep 17 00:00:00 2001 From: Alexander Kurenyshev Date: Fri, 17 Jun 2016 16:45:58 +0300 Subject: [PATCH] Fix checking of hiera corosync_roles Change-Id: Ic8285bda80db59bdf3cc5d64e4e62388f806f505 Closes-Bug:1573502 --- .../test_separate_keystone.py | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/fuelweb_test/tests/tests_separate_services/test_separate_keystone.py b/fuelweb_test/tests/tests_separate_services/test_separate_keystone.py index 2ec431c41..44aa5a8b6 100644 --- a/fuelweb_test/tests/tests_separate_services/test_separate_keystone.py +++ b/fuelweb_test/tests/tests_separate_services/test_separate_keystone.py @@ -247,6 +247,26 @@ class SeparateKeystoneFailover(TestBasic): Duration 30m """ + def check_keystone_nodes(nodes): + hiera_hosts = [] + for node in nodes: + cmd = "cat /etc/hiera/plugins/detach-keystone.yaml" + result = self.ssh_manager.execute_on_remote( + ip=node['ip'], + cmd=cmd, + yamlify=True + )['stdout_yaml'] + hosts = result['corosync_roles'] + logger.debug("hosts on {0} are {1}".format(node['hostname'], + hosts)) + if not hiera_hosts: + hiera_hosts = hosts + continue + else: + assert_true(set(hosts) == set(hiera_hosts), + 'Hosts on node {0} differ from ' + 'others'.format(node['hostname'])) + self.env.revert_snapshot("separate_keystone_service") cluster_id = self.fuel_web.get_last_created_cluster() @@ -276,9 +296,7 @@ class SeparateKeystoneFailover(TestBasic): other_nodes, cmd='hiera memcache_roles') - checkers.check_hiera_hosts( - keystone_nodes, - cmd='hiera corosync_roles') + check_keystone_nodes(keystone_nodes) nailgun_node = self.fuel_web.update_nodes(cluster_id, node, False, True) @@ -308,6 +326,4 @@ class SeparateKeystoneFailover(TestBasic): other_nodes, cmd='hiera memcache_roles') - checkers.check_hiera_hosts( - keystone_nodes, - cmd='hiera corosync_roles') + check_keystone_nodes(keystone_nodes)