Update after recent removal of cred manager aliases
In tempest, alias 'admin_manager' has been moved to 'os_admin' 'alt_manager' to 'os_alt' and 'manager' to 'os_primary' in version Pike, and it will be removed in version Queens[1]. [1]I5f7164f7a7ec5d4380ca22885000caa0183a0bf7 Change-Id: Ifec0e661031647555dbc03ad1000c50c590afa8c Closes-bug: 1697588
This commit is contained in:
parent
fbc57abb17
commit
5ef15a4dc3
@ -102,7 +102,7 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
mgr_utils.mock_the_extension_manager(driver='fake_oneview')
|
||||
self.driver = driver_factory.get_driver('fake_oneview')
|
||||
self.deploy = OneViewDriverDeploy()
|
||||
self.manager = mock.MagicMock(spec=METHODS)
|
||||
self.os_primary = mock.MagicMock(spec=METHODS)
|
||||
self.node = obj_utils.create_test_node(
|
||||
self.context, driver='fake_oneview',
|
||||
properties=db_utils.get_test_oneview_properties(),
|
||||
@ -113,16 +113,16 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
self, mock_is_node_in_use_by_oneview, mock_node_get):
|
||||
mock_node_get.get.return_value = self.node
|
||||
_setup_node_in_available_state(self.node)
|
||||
self.manager.iter_nodes.return_value = nodes_taken_by_oneview
|
||||
self.os_primary.iter_nodes.return_value = nodes_taken_by_oneview
|
||||
mock_is_node_in_use_by_oneview.return_value = True
|
||||
self.deploy._periodic_check_nodes_taken_by_oneview(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
mock_is_node_in_use_by_oneview.assert_called_once_with(
|
||||
self.deploy.client, self.node
|
||||
)
|
||||
self.assertTrue(self.manager.update_node.called)
|
||||
self.assertTrue(self.manager.do_provisioning_action.called)
|
||||
self.assertTrue(self.os_primary.update_node.called)
|
||||
self.assertTrue(self.os_primary.do_provisioning_action.called)
|
||||
self.assertTrue(self.node.maintenance)
|
||||
self.assertEqual(common.NODE_IN_USE_BY_ONEVIEW,
|
||||
self.node.maintenance_reason)
|
||||
@ -133,15 +133,15 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
_setup_node_in_available_state(self.node)
|
||||
mock_node_get.return_value = self.node
|
||||
mock_is_node_in_use_by_oneview.return_value = False
|
||||
self.manager.iter_nodes.return_value = nodes_taken_by_oneview
|
||||
self.os_primary.iter_nodes.return_value = nodes_taken_by_oneview
|
||||
self.deploy._periodic_check_nodes_taken_by_oneview(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
mock_is_node_in_use_by_oneview.assert_called_once_with(
|
||||
self.deploy.client, self.node
|
||||
)
|
||||
self.assertFalse(self.manager.update_node.called)
|
||||
self.assertFalse(self.manager.do_provisioning_action.called)
|
||||
self.assertFalse(self.os_primary.update_node.called)
|
||||
self.assertFalse(self.os_primary.do_provisioning_action.called)
|
||||
self.assertFalse(self.node.maintenance)
|
||||
self.assertIsNone(self.node.maintenance_reason)
|
||||
|
||||
@ -151,15 +151,15 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
_setup_node_in_available_state(self.node)
|
||||
side_effect = exception.OneViewError('boom')
|
||||
mock_is_node_in_use_by_oneview.side_effect = side_effect
|
||||
self.manager.iter_nodes.return_value = nodes_taken_by_oneview
|
||||
self.os_primary.iter_nodes.return_value = nodes_taken_by_oneview
|
||||
self.deploy._periodic_check_nodes_taken_by_oneview(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
mock_is_node_in_use_by_oneview.assert_called_once_with(
|
||||
self.deploy.client, self.node
|
||||
)
|
||||
self.assertFalse(self.manager.update_node.called)
|
||||
self.assertFalse(self.manager.do_provisioning_action.called)
|
||||
self.assertFalse(self.os_primary.update_node.called)
|
||||
self.assertFalse(self.os_primary.do_provisioning_action.called)
|
||||
self.assertFalse(self.node.maintenance)
|
||||
self.assertNotEqual(common.NODE_IN_USE_BY_ONEVIEW,
|
||||
self.node.maintenance_reason)
|
||||
@ -168,16 +168,16 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
self, mock_is_node_in_use_by_oneview, mock_node_get):
|
||||
mock_node_get.get.return_value = self.node
|
||||
_setup_node_in_manageable_state(self.node)
|
||||
self.manager.iter_nodes.return_value = nodes_freed_by_oneview
|
||||
self.os_primary.iter_nodes.return_value = nodes_freed_by_oneview
|
||||
mock_is_node_in_use_by_oneview.return_value = False
|
||||
self.deploy._periodic_check_nodes_freed_by_oneview(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
mock_is_node_in_use_by_oneview.assert_called_once_with(
|
||||
self.deploy.client, self.node
|
||||
)
|
||||
self.assertTrue(self.manager.update_node.called)
|
||||
self.assertTrue(self.manager.do_provisioning_action.called)
|
||||
self.assertTrue(self.os_primary.update_node.called)
|
||||
self.assertTrue(self.os_primary.do_provisioning_action.called)
|
||||
self.assertFalse(self.node.maintenance)
|
||||
self.assertIsNone(self.node.maintenance_reason)
|
||||
|
||||
@ -186,15 +186,15 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
mock_node_get.get.return_value = self.node
|
||||
_setup_node_in_manageable_state(self.node)
|
||||
mock_is_node_in_use_by_oneview.return_value = True
|
||||
self.manager.iter_nodes.return_value = nodes_freed_by_oneview
|
||||
self.os_primary.iter_nodes.return_value = nodes_freed_by_oneview
|
||||
self.deploy._periodic_check_nodes_freed_by_oneview(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
mock_is_node_in_use_by_oneview.assert_called_once_with(
|
||||
self.deploy.client, self.node
|
||||
)
|
||||
self.assertFalse(self.manager.update_node.called)
|
||||
self.assertFalse(self.manager.do_provisioning_action.called)
|
||||
self.assertFalse(self.os_primary.update_node.called)
|
||||
self.assertFalse(self.os_primary.do_provisioning_action.called)
|
||||
self.assertTrue(self.node.maintenance)
|
||||
self.assertEqual(common.NODE_IN_USE_BY_ONEVIEW,
|
||||
self.node.maintenance_reason)
|
||||
@ -205,15 +205,15 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
_setup_node_in_manageable_state(self.node)
|
||||
side_effect = exception.OneViewError('boom')
|
||||
mock_is_node_in_use_by_oneview.side_effect = side_effect
|
||||
self.manager.iter_nodes.return_value = nodes_freed_by_oneview
|
||||
self.os_primary.iter_nodes.return_value = nodes_freed_by_oneview
|
||||
self.deploy._periodic_check_nodes_freed_by_oneview(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
mock_is_node_in_use_by_oneview.assert_called_once_with(
|
||||
self.deploy.client, self.node
|
||||
)
|
||||
self.assertFalse(self.manager.update_node.called)
|
||||
self.assertFalse(self.manager.do_provisioning_action.called)
|
||||
self.assertFalse(self.os_primary.update_node.called)
|
||||
self.assertFalse(self.os_primary.do_provisioning_action.called)
|
||||
self.assertTrue(self.node.maintenance)
|
||||
self.assertEqual(common.NODE_IN_USE_BY_ONEVIEW,
|
||||
self.node.maintenance_reason)
|
||||
@ -222,12 +222,12 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
self, mock_is_node_in_use_by_oneview, mock_node_get):
|
||||
mock_node_get.get.return_value = self.node
|
||||
_setup_node_in_cleanfailed_state_with_oneview_error(self.node)
|
||||
self.manager.iter_nodes.return_value = nodes_taken_on_cleanfail
|
||||
self.os_primary.iter_nodes.return_value = nodes_taken_on_cleanfail
|
||||
self.deploy._periodic_check_nodes_taken_on_cleanfail(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
self.assertTrue(self.manager.update_node.called)
|
||||
self.assertTrue(self.manager.do_provisioning_action.called)
|
||||
self.assertTrue(self.os_primary.update_node.called)
|
||||
self.assertTrue(self.os_primary.do_provisioning_action.called)
|
||||
self.assertTrue(self.node.maintenance)
|
||||
self.assertEqual(common.NODE_IN_USE_BY_ONEVIEW,
|
||||
self.node.maintenance_reason)
|
||||
@ -237,12 +237,13 @@ class OneViewPeriodicTasks(db_base.DbTestCase):
|
||||
self, mock_is_node_in_use_by_oneview, mock_node_get):
|
||||
mock_node_get.get.return_value = self.node
|
||||
_setup_node_in_cleanfailed_state_without_oneview_error(self.node)
|
||||
self.manager.iter_nodes.return_value = nodes_taken_on_cleanfail_no_info
|
||||
self.os_primary.iter_nodes.return_value = \
|
||||
nodes_taken_on_cleanfail_no_info
|
||||
self.deploy._periodic_check_nodes_taken_on_cleanfail(
|
||||
self.manager, self.context
|
||||
self.os_primary, self.context
|
||||
)
|
||||
self.assertFalse(self.manager.update_node.called)
|
||||
self.assertFalse(self.manager.do_provisioning_action.called)
|
||||
self.assertFalse(self.os_primary.update_node.called)
|
||||
self.assertFalse(self.os_primary.do_provisioning_action.called)
|
||||
self.assertFalse(self.node.maintenance)
|
||||
self.assertNotEqual(common.NODE_IN_USE_BY_ONEVIEW,
|
||||
self.node.maintenance_reason)
|
||||
|
@ -114,7 +114,7 @@ class BaremetalBFV(baremetal_manager.BaremetalScenarioTest):
|
||||
delete_on_termination=delete_on_termination))
|
||||
|
||||
return self.boot_instance(
|
||||
clients=self.manager,
|
||||
clients=self.os_primary,
|
||||
keypair=keypair,
|
||||
**create_kwargs
|
||||
)
|
||||
|
@ -108,19 +108,19 @@ class BaremetalMultitenancy(baremetal_manager.BaremetalScenarioTest,
|
||||
|
||||
# Boot instance in the alt tenant network and ensure there is no
|
||||
# L2 connectivity between instances of the different tenants
|
||||
alt_keypair = self.create_keypair(self.alt_manager.keypairs_client)
|
||||
alt_keypair = self.create_keypair(self.os_alt.keypairs_client)
|
||||
alt_network, alt_subnet, alt_router = self.create_tenant_network(
|
||||
self.alt_manager, tenant_cidr)
|
||||
self.os_alt, tenant_cidr)
|
||||
|
||||
alt_instance, alt_node = self.boot_instance(
|
||||
keypair=alt_keypair,
|
||||
clients=self.alt_manager,
|
||||
clients=self.os_alt,
|
||||
net_id=alt_network['id'],
|
||||
fixed_ip=fixed_ip2
|
||||
)
|
||||
alt_floating_ip = self.create_floating_ip(
|
||||
alt_instance,
|
||||
client=self.alt_manager.floating_ips_client
|
||||
client=self.os_alt.floating_ips_client
|
||||
)['floating_ip_address']
|
||||
|
||||
self.check_vm_connectivity(ip_address=alt_floating_ip,
|
||||
@ -149,5 +149,5 @@ class BaremetalMultitenancy(baremetal_manager.BaremetalScenarioTest,
|
||||
|
||||
self.terminate_instance(
|
||||
instance=alt_instance,
|
||||
servers_client=self.alt_manager.servers_client)
|
||||
servers_client=self.os_alt.servers_client)
|
||||
self.terminate_instance(instance=instance1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user