def test_detach_vm_network_from_host_0(engine_api): engine = engine_api.system_service() host = test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME)[0] host_service = engine.hosts_service().host_service(id=host.id) network_utils_v4.set_network_required_in_cluster(engine, VM_NETWORK, CLUSTER_NAME, False) network_utils_v4.detach_network_from_host(engine, host_service, VM_NETWORK) assert not _host_is_attached_to_network(engine, host_service, VM_NETWORK)
def detach_vm_network_from_host_0(api): engine = api.system_service() host = test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME)[0] host_service = engine.hosts_service().host_service(id=host.id) network_utils_v4.set_network_required_in_cluster( engine, VM_NETWORK, CLUSTER_NAME, False) network_utils_v4.detach_network_from_host(engine, host_service, VM_NETWORK) nt.assert_false(_host_is_attached_to_network(engine, host_service, VM_NETWORK))
def test_remove_bonding(engine_api): engine = engine_api.system_service() def _remove_bonding(host): host_service = engine.hosts_service().host_service(id=host.id) network_utils_v4.detach_network_from_host(engine, host_service, MIGRATION_NETWORK, BOND_NAME) network_utils_v4.set_network_required_in_cluster(engine, MIGRATION_NETWORK, CLUSTER_NAME, False) utils.invoke_in_parallel( _remove_bonding, test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME)) for host in test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME): host_service = engine.hosts_service().host_service(id=host.id) assert not _host_is_attached_to_network(engine, host_service, MIGRATION_NETWORK)
def remove_bonding(api): engine = api.system_service() def _remove_bonding(host): host_service = engine.hosts_service().host_service(id=host.id) network_utils_v4.detach_network_from_host( engine, host_service, MIGRATION_NETWORK, BOND_NAME) network_utils_v4.set_network_required_in_cluster(engine, MIGRATION_NETWORK, CLUSTER_NAME, False) utils.invoke_in_parallel( _remove_bonding, test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME)) for host in test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME): host_service = engine.hosts_service().host_service(id=host.id) nt.assert_false(_host_is_attached_to_network(engine, host_service, MIGRATION_NETWORK))