Merge "Add checks on hiera hosts"
This commit is contained in:
commit
400db22d25
@ -1157,3 +1157,19 @@ def check_log_lines_order(remote, log_file_path, line_matcher):
|
||||
|
||||
previous_line_pos = previous_line_pos + current_line_pos
|
||||
previous_line = current_line
|
||||
|
||||
|
||||
def check_hiera_hosts(self, nodes, cmd):
|
||||
hiera_hosts = []
|
||||
for node in nodes:
|
||||
with self.env.d_env.get_ssh_to_remote(node['ip']) as remote:
|
||||
hosts = ''.join(run_on_remote(remote, cmd)).strip().split(',')
|
||||
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']))
|
||||
|
@ -215,9 +215,13 @@ class SeparateDbFailover(TestBasic):
|
||||
2. Add one databse node and re-deploy cluster
|
||||
3. Run network verification
|
||||
4. Run OSTF
|
||||
5. Delete one database node
|
||||
6. Run network verification
|
||||
7. Run ostf
|
||||
5. Check hiera hosts are the same for
|
||||
different group of roles
|
||||
6. Delete one database node
|
||||
7. Run network verification
|
||||
8. Run ostf
|
||||
9. Check hiera hosts are the same for
|
||||
different group of roles
|
||||
|
||||
Duration 30m
|
||||
"""
|
||||
@ -233,6 +237,17 @@ class SeparateDbFailover(TestBasic):
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id,
|
||||
test_sets=['sanity', 'smoke', 'ha'])
|
||||
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera memcache_roles')
|
||||
|
||||
database_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id, ['standalone-database'])
|
||||
logger.debug("database nodes are {0}".format(database_nodes))
|
||||
checkers.check_hiera_hosts(
|
||||
self, database_nodes,
|
||||
cmd='hiera corosync_roles')
|
||||
|
||||
nailgun_node = self.fuel_web.update_nodes(cluster_id, node,
|
||||
False, True)
|
||||
nodes = filter(lambda x: x["pending_deletion"] is True, nailgun_node)
|
||||
@ -242,3 +257,14 @@ class SeparateDbFailover(TestBasic):
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id,
|
||||
test_sets=['sanity', 'smoke', 'ha'])
|
||||
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera memcache_roles')
|
||||
|
||||
database_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id, ['standalone-database'])
|
||||
logger.debug("database nodes are {0}".format(database_nodes))
|
||||
checkers.check_hiera_hosts(
|
||||
self, database_nodes,
|
||||
cmd='hiera corosync_roles')
|
||||
|
@ -223,16 +223,20 @@ class SeparateKeystoneFailover(TestBasic):
|
||||
2. Add one keystone node and re-deploy cluster
|
||||
3. Run network verification
|
||||
4. Run OSTF
|
||||
5. Delete one keystone node
|
||||
6. Run network verification
|
||||
7. Run ostf
|
||||
5. Check hiera hosts are the same for
|
||||
different group of roles
|
||||
6. Delete one keystone node
|
||||
7. Run network verification
|
||||
8. Run ostf
|
||||
9. Check hiera hosts are the same for
|
||||
different group of roles
|
||||
|
||||
Duration 30m
|
||||
"""
|
||||
self.env.revert_snapshot("separate_keystone_service")
|
||||
cluster_id = self.fuel_web.get_last_created_cluster()
|
||||
|
||||
node = {'slave-09': ['keystone']}
|
||||
node = {'slave-09': ['standalone-keystone']}
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id, node, True, False)
|
||||
|
||||
@ -241,6 +245,17 @@ class SeparateKeystoneFailover(TestBasic):
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id,
|
||||
test_sets=['sanity', 'smoke', 'ha'])
|
||||
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera memcache_roles')
|
||||
|
||||
database_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id, ['standalone-keystone'])
|
||||
logger.debug("database nodes are {0}".format(database_nodes))
|
||||
checkers.check_hiera_hosts(
|
||||
self, database_nodes,
|
||||
cmd='hiera corosync_roles')
|
||||
|
||||
nailgun_node = self.fuel_web.update_nodes(cluster_id, node,
|
||||
False, True)
|
||||
nodes = filter(lambda x: x["pending_deletion"] is True, nailgun_node)
|
||||
@ -250,3 +265,14 @@ class SeparateKeystoneFailover(TestBasic):
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id,
|
||||
test_sets=['sanity', 'smoke', 'ha'])
|
||||
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera memcache_roles')
|
||||
|
||||
database_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id, ['standalone-keystone'])
|
||||
logger.debug("database nodes are {0}".format(database_nodes))
|
||||
checkers.check_hiera_hosts(
|
||||
self, database_nodes,
|
||||
cmd='hiera corosync_roles')
|
||||
|
@ -216,9 +216,13 @@ class SeparateRabbitFailover(TestBasic):
|
||||
2. Add one rabbit node and re-deploy cluster
|
||||
3. Run network verification
|
||||
4. Run OSTF
|
||||
5. Delete one rabbit node
|
||||
6. Run network verification
|
||||
7. Run ostf
|
||||
5. Check hiera hosts are the same for
|
||||
different group of roles
|
||||
6. Delete one rabbit node
|
||||
7. Run network verification
|
||||
8. Run ostf
|
||||
9. Check hiera hosts are the same for
|
||||
different group of roles
|
||||
|
||||
Duration 120m
|
||||
"""
|
||||
@ -233,6 +237,20 @@ class SeparateRabbitFailover(TestBasic):
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id,
|
||||
test_sets=['sanity', 'smoke', 'ha'])
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera amqp_hosts')
|
||||
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera memcache_roles')
|
||||
|
||||
rabbit_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id, ['standalone-rabbitmq'])
|
||||
logger.debug("rabbit nodes are {0}".format(rabbit_nodes))
|
||||
checkers.check_hiera_hosts(
|
||||
self, rabbit_nodes,
|
||||
cmd='hiera corosync_roles')
|
||||
|
||||
nailgun_node = self.fuel_web.update_nodes(cluster_id, node,
|
||||
False, True)
|
||||
@ -243,3 +261,17 @@ class SeparateRabbitFailover(TestBasic):
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
self.fuel_web.run_ostf(cluster_id=cluster_id,
|
||||
test_sets=['sanity', 'smoke', 'ha'])
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera amqp_hosts')
|
||||
|
||||
checkers.check_hiera_hosts(
|
||||
self, self.fuel_web.client.list_cluster_nodes(cluster_id),
|
||||
cmd='hiera memcache_roles')
|
||||
|
||||
rabbit_nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
|
||||
cluster_id, ['standalone-rabbitmq'])
|
||||
logger.debug("rabbit nodes are {0}".format(rabbit_nodes))
|
||||
checkers.check_hiera_hosts(
|
||||
self, rabbit_nodes,
|
||||
cmd='hiera corosync_roles')
|
||||
|
Loading…
Reference in New Issue
Block a user