本文整理汇总了Python中fuelweb_test.helpers.common.Common.delete_instance方法的典型用法代码示例。如果您正苦于以下问题:Python Common.delete_instance方法的具体用法?Python Common.delete_instance怎么用?Python Common.delete_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fuelweb_test.helpers.common.Common
的用法示例。
在下文中一共展示了Common.delete_instance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deploy_murano_ha_with_gre
# 需要导入模块: from fuelweb_test.helpers.common import Common [as 别名]
# 或者: from fuelweb_test.helpers.common.Common import delete_instance [as 别名]
def deploy_murano_ha_with_gre(self):
"""Deploy cluster in ha mode with Murano and Neutron GRE
Scenario:
1. Create cluster. Set install Murano option
2. Add 3 node with controller role
3. Add 1 nodes with compute role
4. Deploy the cluster
5. Verify Murano services
6. Run OSTF
7. Register Murano image
8. Run OSTF Murano platform tests
Duration 100m
Snapshot: deploy_murano_ha_with_gre
"""
self.env.revert_snapshot("ready_with_5_slaves")
LOGGER.debug('Check MD5 of image')
check_image = checkers.check_image(
settings.SERVTEST_MURANO_IMAGE,
settings.SERVTEST_MURANO_IMAGE_MD5,
settings.SERVTEST_LOCAL_PATH)
asserts.assert_true(check_image, "Image verification failed")
data = {
'murano': True,
'net_provider': 'neutron',
'net_segment_type': 'gre',
'tenant': 'muranoHA',
'user': 'muranoHA',
'password': 'muranoHA'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=settings.DEPLOYMENT_MODE,
settings=data)
self.fuel_web.update_nodes(
cluster_id,
{
'slave-01': ['controller'],
'slave-02': ['controller'],
'slave-03': ['controller'],
'slave-04': ['compute']
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
cluster_vip = self.fuel_web.get_public_vip(cluster_id)
os_conn = os_actions.OpenStackActions(
cluster_vip, data['user'], data['password'], data['tenant'])
self.fuel_web.assert_cluster_ready(
os_conn, smiles_count=13, networks_count=2, timeout=300)
for slave in ["slave-01", "slave-02", "slave-03"]:
checkers.verify_service(
self.env.get_ssh_to_remote_by_name(slave),
service_name='murano-api')
common_func = Common(cluster_vip, data['user'], data['password'],
data['tenant'])
LOGGER.debug('Run sanity and functional Murano OSTF tests')
self.fuel_web.run_single_ostf_test(
cluster_id=self.fuel_web.get_last_created_cluster(),
test_sets=['sanity'],
test_name=('fuel_health.tests.sanity.test_sanity_murano.'
'MuranoSanityTests.test_create_and_delete_service')
)
LOGGER.debug('Import Murano image')
common_func.image_import(
settings.SERVTEST_LOCAL_PATH,
settings.SERVTEST_MURANO_IMAGE,
settings.SERVTEST_MURANO_IMAGE_NAME,
settings.SERVTEST_MURANO_IMAGE_META)
LOGGER.debug('Boot instance with Murano image')
image_name = settings.SERVTEST_MURANO_IMAGE_NAME
srv = common_func.create_instance(flavor_name='test_murano_flavor',
ram=2048, vcpus=1, disk=20,
server_name='murano_instance',
image_name=image_name,
neutron_network=True)
wait(lambda: common_func.get_instance_detail(srv).status == 'ACTIVE',
timeout=60 * 60)
common_func.delete_instance(srv)
LOGGER.debug('Run OSTF platform tests')
test_class_main = ('fuel_health.tests.platform_tests'
'.test_murano_linux.MuranoDeployLinuxServicesTests')
tests_names = ['test_deploy_apache_service', ]
test_classes = []
#.........这里部分代码省略.........
示例2: deploy_murano_simple
# 需要导入模块: from fuelweb_test.helpers.common import Common [as 别名]
# 或者: from fuelweb_test.helpers.common.Common import delete_instance [as 别名]
def deploy_murano_simple(self):
"""Deploy cluster in simple mode with Murano
Scenario:
1. Create cluster. Set install Murano option
2. Add 1 node with controller role
3. Add 1 nodes with compute role
4. Deploy the cluster
5. Verify Murano services
6. Run OSTF
7. Register Murano image
8. Run OSTF Murano platform tests
Snapshot: deploy_murano_simple
"""
if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
raise SkipTest()
self.env.revert_snapshot("ready_with_3_slaves")
LOGGER.debug('Check MD5 of image')
check_image = checkers.check_image(
settings.SERVTEST_MURANO_IMAGE,
settings.SERVTEST_MURANO_IMAGE_MD5,
settings.SERVTEST_LOCAL_PATH)
asserts.assert_true(check_image, "Image verification failed")
data = {
'murano': True,
'net_provider': 'neutron',
'net_segment_type': 'gre',
'tenant': 'muranoSimple',
'user': 'muranoSimple',
'password': 'muranoSimple'
}
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
settings=data)
self.fuel_web.update_nodes(
cluster_id,
{
'slave-01': ['controller'],
'slave-02': ['compute']
}
)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.fuel_web.assert_cluster_ready(
'slave-01', smiles_count=5, networks_count=1, timeout=300)
checkers.verify_service(
self.env.get_ssh_to_remote_by_name("slave-01"),
service_name='murano-api')
controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
common_func = Common(controller['ip'], data['user'], data['password'],
data['tenant'])
LOGGER.debug('Run sanity and functional Murano OSTF tests')
self.fuel_web.run_single_ostf_test(
cluster_id=self.fuel_web.get_last_created_cluster(),
test_sets=['sanity'],
test_name=('fuel_health.tests.sanity.test_sanity_murano.'
'MuranoSanityTests.test_create_and_delete_service')
)
LOGGER.debug('Import Murano image')
common_func.image_import(
settings.SERVTEST_LOCAL_PATH,
settings.SERVTEST_MURANO_IMAGE,
settings.SERVTEST_MURANO_IMAGE_NAME,
settings.SERVTEST_MURANO_IMAGE_META)
LOGGER.debug('Boot instance with Murano image')
image_name = settings.SERVTEST_MURANO_IMAGE_NAME
srv = common_func.create_instance(flavor_name='test_murano_flavor',
ram=2048, vcpus=1, disk=20,
server_name='murano_instance',
image_name=image_name,
neutron_network=True)
wait(lambda: common_func.get_instance_detail(srv).status == 'ACTIVE',
timeout=60 * 60)
common_func.delete_instance(srv)
LOGGER.debug('Run OSTF platform tests')
test_class_main = ('fuel_health.tests.platform_tests'
'.test_platform_murano_linux.'
'MuranoDeployLinuxServicesTests')
tests_names = ['test_deploy_telnet_service',
'test_deploy_apache_service']
test_classes = []
for test_name in tests_names:
test_classes.append('{0}.{1}'.format(test_class_main,
#.........这里部分代码省略.........