本文整理匯總了Python中revizor2.api.Farm.terminate方法的典型用法代碼示例。如果您正苦於以下問題:Python Farm.terminate方法的具體用法?Python Farm.terminate怎麽用?Python Farm.terminate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類revizor2.api.Farm
的用法示例。
在下文中一共展示了Farm.terminate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_efs_bootstrapping
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_efs_bootstrapping(self, efs: dict, context: dict, farm: Farm, cloud: Cloud):
"""Attach EFS storage"""
lib_farm.clear(farm)
farm.terminate()
context['linked_services'] = {'efs': {'cloud_id': efs['fileSystemId']}}
efs_mount_point = "/media/efsmount"
lib_farm.link_efs_cloud_service_to_farm(farm, efs)
lib_farm.add_role_to_farm(context, farm, role_options=['efs'])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lifecycle.assert_attached_disk_types(context, cloud, farm)
lifecycle.assert_path_exist(cloud, server, efs_mount_point)
lifecycle.create_files(cloud, server, count=100, directory=efs_mount_point)
mount_table = lifecycle.get_mount_table(cloud, server)
lifecycle.assert_mount_point_in_fstab(
cloud,
server,
mount_table=mount_table,
mount_point=efs_mount_point)
# Reboot server
lib_server.execute_server_action(server, 'reboot')
lib_server.assert_server_message(cloud, farm, msgtype='in', msg='RebootFinish', server=server)
# Check after reboot
lifecycle.assert_attached_disk_types(context, cloud, farm)
lifecycle.assert_path_exist(cloud, server, efs_mount_point)
lifecycle.assert_file_count(cloud, server, count=100, directory=efs_mount_point)
示例2: test_update_to_branch_from_ui
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_update_to_branch_from_ui(self, context: dict, cloud: Cloud, farm: Farm, servers: dict, branch: str):
"""Update scalarizr from release to branch via UI"""
farm.terminate()
lib_farm.clear(farm)
farm.launch()
farm_role = lib_farm.add_role_to_farm(context, farm, role_options=['branch_{}'.format(branch)])
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lifecycle.assert_szr_version_last(server, branch=branch)
lib_role.change_branch_in_farm_role(farm_role, 'system')
update.start_scalarizr_update_via_ui(server)
update.wait_szrupd_status(server, 'completed')
lib_server.assert_server_message(cloud, farm, msgtype='in', msg='HostUpdate', server=server)
lifecycle.assert_szr_version_last(server, branch='system')
lib_server.execute_script(context, farm, server, script_name='Windows ping-pong. CMD', synchronous=True)
lib_server.assert_last_script_result(context, cloud, server,
name='Windows ping-pong. CMD',
log_contains='pong',
new_only=True)
lib_node.reboot_scalarizr(cloud, server)
lib_server.execute_script(context, farm, server, script_name='Windows ping-pong. CMD', synchronous=True)
lib_server.assert_last_script_result(context, cloud, server,
name='Windows ping-pong. CMD',
log_contains='pong',
new_only=True)
lib_server.assert_scalarizr_log_errors(cloud, server, log_type='debug')
lib_server.assert_scalarizr_log_errors(cloud, server, log_type='update')
示例3: test_failed_hostname
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_failed_hostname(self, context: dict, cloud: Cloud, farm: Farm):
"""Failed bootstrap by hostname"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm, role_options=['failed_hostname'])
farm.launch()
lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.FAILED)
示例4: test_update_from_branch_to_stable_on_startup
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_update_from_branch_to_stable_on_startup(self, context: dict, cloud: Cloud, farm: Farm, servers: dict):
"""Update scalarizr from branch to stable on startup"""
farm.terminate()
lib_farm.clear(farm)
image = update.get_clean_image(cloud)
role = lib_role.create_role(image)
farm.launch()
lib_farm.add_role_to_farm(context, farm, role=Role.get(role['role']['id']), role_options=['branch_stable'])
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.PENDING)
szr_ver = lib_node.install_scalarizr_to_server(server, cloud)
time.sleep(120)
lib_server.execute_server_action(server, 'reboot', hard=True)
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING, server=server)
update.assert_scalarizr_version(server, cloud, szr_ver)
lib_server.execute_script(context, farm, server, script_name='Windows ping-pong. CMD', synchronous=True)
lib_server.assert_last_script_result(context, cloud, server,
name='Windows ping-pong. CMD',
log_contains='pong',
new_only=True)
lib_node.reboot_scalarizr(cloud, server)
lib_server.execute_script(context, farm, server, script_name='Windows ping-pong. CMD', synchronous=True)
lib_server.assert_last_script_result(context, cloud, server,
name='Windows ping-pong. CMD',
log_contains='pong',
new_only=True)
lib_server.assert_scalarizr_log_errors(cloud, server, log_type='debug')
lib_server.assert_scalarizr_log_errors(cloud, server, log_type='update')
示例5: test_update_from_stable_to_branch_on_startup_and_new_package
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_update_from_stable_to_branch_on_startup_and_new_package(self, context: dict, cloud: Cloud, farm: Farm,
servers: dict):
"""Update scalarizr from stable to branch on startup with new pkg"""
farm.terminate()
lib_farm.clear(farm)
image = update.get_clean_image(cloud)
role = lib_role.create_role(image)
farm.launch()
farm_role = lib_farm.add_role_to_farm(context, farm, role=Role.get(role['role']['id']))
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.PENDING)
szr_ver = lib_node.install_scalarizr_to_server(server, cloud, custom_branch='stable')
time.sleep(120)
lib_server.execute_server_action(server, 'reboot', hard=True)
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING, server=server)
update.assert_scalarizr_version(server, cloud, szr_ver)
update.create_branch_copy(context, branch='system')
update.waiting_new_package(context)
lib_role.change_branch_in_farm_role(farm_role, context['branch_copy_name'])
update.start_scalarizr_update_via_ui(server)
update.wait_szrupd_status(server, 'in-progress')
update.wait_szrupd_status(server, 'completed')
lifecycle.assert_szr_version_last(server, branch=context['branch_copy_name'])
lib_server.execute_script(context, farm, server, script_name='Windows ping-pong. CMD', synchronous=True)
lib_server.assert_last_script_result(context, cloud, server,
name='Windows ping-pong. CMD',
log_contains='pong',
new_only=True)
lib_node.reboot_scalarizr(cloud, server)
lib_server.execute_script(context, farm, server, script_name='Windows ping-pong. CMD', synchronous=True)
lib_server.assert_last_script_result(context, cloud, server,
name='Windows ping-pong. CMD',
log_contains='pong',
new_only=True)
lib_server.assert_scalarizr_log_errors(cloud, server, log_type='debug')
lib_server.assert_scalarizr_log_errors(cloud, server, log_type='update')
示例6: test_restart_farm
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_restart_farm(self, context: dict, cloud: Cloud, farm: Farm, servers: dict):
"""Restart farm"""
farm.terminate()
lib_server.wait_servers_state(farm, 'terminated')
farm.launch()
server = lib_server.expect_server_bootstraping_for_role(context, cloud, farm)
servers['M1'] = server
lifecycle.assert_hostname(server)
示例7: test_restart_bootstrap
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_restart_bootstrap(self, context: dict, cloud: Cloud, farm: Farm, servers: dict):
"""Bootstraping on restart"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm)
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
servers['M1'] = server
lifecycle.assert_hostname(server)
示例8: test_nonblank_volume
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_nonblank_volume(self, context: dict, cloud: Cloud, farm: Farm):
"""Check partition table recognized as a non-blank volume"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm)
snapshot_id = context['volume_snapshot_id']
lifecycle.add_storage_to_role(context, farm, snapshot_id)
farm.launch()
lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.FAILED)
示例9: test_chef_solo_bootstrapping
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_chef_solo_bootstrapping(self, context: dict, cloud: Cloud, farm: Farm, role_options: str):
"""Bootstrapping role with chef-solo"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm, role_options=[role_options])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
node = cloud.get_node(server)
lib_server.assert_file_exist(node, f'C:\{role_options}')
provision.assert_script_data_deleted(cloud, server)
示例10: test_chef_bootstrap_failure
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_chef_bootstrap_failure(self, context: dict, cloud: Cloud, farm: Farm):
"""Chef bootstrap failure"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm, role_options=['chef-fail'])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.FAILED)
lib_server.validate_failed_status_message(server, "beforeHostUp", "/usr/bin/chef-client exited with code 1")
provision.assert_chef_log_contains_text(server, "ERROR: undefined method `fatal!'")
provision.assert_chef_bootstrap_failed(cloud, server)
示例11: test_eph_bootstrap
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_eph_bootstrap(self, context: dict, cloud: Cloud, farm: Farm, servers: dict):
"""Bootstraping with ephemeral"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm, role_options=['ephemeral'])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
servers['M1'] = server
lifecycle.assert_vcpu_count(server)
windows.assert_attached_disks_size(cloud, server, [('Z:\\', 'test_label', 4)])
lifecycle.assert_szr_version_last(server)
示例12: test_bootstrapping_form_chef_role
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_bootstrapping_form_chef_role(self, context: dict, cloud: Cloud, farm: Farm):
"""Bootstrapping from chef role"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm, role_options=['winchef-role'])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
node = cloud.get_node(server)
lib_server.assert_file_exist(node, 'C:\chef_result_file')
lib_server.assert_scalarizr_log_errors(cloud, server)
lifecycle.assert_szr_version_last(server)
lifecycle.assert_hostname(server)
示例13: test_bootstrapping_from_chef_role
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_bootstrapping_from_chef_role(self, context: dict, cloud: Cloud, farm: Farm):
"""Bootstrapping from chef role"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm, role_options=['chef-role'])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lib_server.assert_scalarizr_log_errors(cloud, server)
lifecycle.assert_szr_version_last(server)
provision.assert_node_exists_on_chef_server(server)
provision.assert_chef_node_name_equal_hostname(cloud, server)
provision.assert_chef_log_contains_text(server, "revizor_chef_variable=REVIZOR_CHEF_VARIABLE_VALUE_WORK")
示例14: test_chef_bootstrapping_via_cookbooks_with_hostname_configured
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_chef_bootstrapping_via_cookbooks_with_hostname_configured(self, context: dict, cloud: Cloud, farm: Farm):
"""Chef bootstrapping with hostname configured via cookbooks"""
hostname = f'hostname-LIX{uuid4().hex[16:24]}'
lib_farm.clear(farm)
farm.terminate()
context['chef_hostname_for_cookbook'] = hostname
lib_farm.add_role_to_farm(context, farm, role_options=['chef-hostname'])
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lib_server.assert_scalarizr_log_errors(cloud, server)
server.reload()
assert server.hostname == hostname, \
f'Hostname on server "{saerver.hostname}" != chef hostname configured via the cookbook "{hostname}"'
示例15: test_server_rebundle
# 需要導入模塊: from revizor2.api import Farm [as 別名]
# 或者: from revizor2.api.Farm import terminate [as 別名]
def test_server_rebundle(self, context: dict, cloud: Cloud, farm: Farm):
"""Verify server rebundle work"""
lib_farm.clear(farm)
farm.terminate()
lib_farm.add_role_to_farm(context, farm)
farm.launch()
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
bundle_id = rebundle.start_server_rebundle(server)
rebundle.assert_bundle_task_created(server, bundle_id)
new_role_id = rebundle.wait_bundle_complete(server, bundle_id)
farm.clear_roles()
lib_farm.add_role_to_farm(context, farm, role=Role.get(new_role_id))
server = lib_server.wait_server_status(context, cloud, farm, status=ServerStatus.RUNNING)
lifecycle.assert_szr_version_last(server)
lib_server.assert_scalarizr_log_errors(cloud, server)