def deactivate_storage_domain(connection): dc = test_utils.data_center_service(connection.system_service(), DC_NAME) _get_storage_domain(dc, SD_SECOND_NFS_NAME, service=True).deactivate() testlib.assert_equals_within_short( lambda: _get_storage_domain(dc, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.MAINTENANCE)
def detach_storage_domain(connection): engine = connection.system_service() dc = test_utils.data_center_service(engine, DC_NAME) _get_storage_domain(dc, SD_SECOND_NFS_NAME, service=True).remove() testlib.assert_equals_within_short( lambda: _get_storage_domain(engine, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.UNATTACHED)
def deactivate_storage_domain(connection): raise SkipTest('skipping until reattach test fixed. Jira OVIRT-2264') dc = test_utils.data_center_service(connection.system_service(), DC_NAME) _get_storage_domain(dc, SD_SECOND_NFS_NAME, service=True).deactivate() testlib.assert_equals_within_short( lambda: _get_storage_domain(dc, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.MAINTENANCE)
def reattach_storage_domain(connection): engine = connection.system_service() dc = test_utils.data_center_service(engine, DC_NAME) sd = _get_storage_domain(engine, SD_SECOND_NFS_NAME) dc.storage_domains_service().add(sd) testlib.assert_equals_within_short( lambda: _get_storage_domain(dc, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.ACTIVE)
def detach_storage_domain(connection): raise SkipTest('skipping until reattach test fixed. Jira OVIRT-2264') engine = connection.system_service() dc = test_utils.data_center_service(engine, DC_NAME) _get_storage_domain(dc, SD_SECOND_NFS_NAME, service=True).remove() testlib.assert_equals_within_short( lambda: _get_storage_domain(engine, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.UNATTACHED)
def reattach_storage_domain(connection): raise SkipTest('skipping until reattach test fixed. Jira OVIRT-2264') engine = connection.system_service() dc = test_utils.data_center_service(engine, DC_NAME) sd = _get_storage_domain(engine, SD_SECOND_NFS_NAME) dc.storage_domains_service().add(sd) testlib.assert_equals_within_short( lambda: _get_storage_domain(dc, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.ACTIVE)
def reattach_storage_domain(connection): raise SkipTest('skipping until reattach test fixed. Jira OVIRT-2264') VnicSetup.vnic_setup().remove_some_profiles_and_networks() engine = connection.system_service() dc = test_utils.data_center_service(engine, DC_NAME) sd = _get_storage_domain(engine, SD_SECOND_NFS_NAME) dc.storage_domains_service().add(sd) testlib.assert_equals_within_short( lambda: _get_storage_domain(dc, SD_SECOND_NFS_NAME).status, ovirtsdk4.types.StorageDomainStatus.ACTIVE)
def modify_ip_config(engine, host, network_name, ip_configuration): network_id = engine.networks_service().list( search=u'name={}'.format( test_utils.quote_search_string(network_name)).encode('utf-8'))[0].id attachment = _get_attachment_by_id(host, network_id) attachment.ip_address_assignments = ip_configuration testlib.assert_equals_within_short( lambda: _setup_host_networks_without_conflict( host=host, modified_network_attachments=[attachment], check_connectivity=True), True, [])
def attach_network_to_host(host, nic_name, network_name, ip_configuration, bonds=[]): attachment = NetworkAttachment( network=Network(name=network_name), host_nic=HostNic(name=nic_name), ip_address_assignments=ip_configuration) testlib.assert_equals_within_short( lambda: _setup_host_networks_without_conflict( host=host, modified_bonds=bonds, modified_network_attachments=[attachment], check_connectivity=True), True, [])
def detach_network_from_host(engine, host, network_name, bond_name=None): network_id = engine.networks_service().list( search=u'name={}'.format( test_utils.quote_search_string(network_name)).encode('utf-8'))[0].id attachment = _get_attachment_by_id(host, network_id) bonds = [nic for nic in host.nics_service().list() if bond_name and nic.name == bond_name] # there is no more than one bond testlib.assert_equals_within_short( lambda: _setup_host_networks_without_conflict( host=host, removed_bonds=bonds, removed_network_attachments=[attachment], check_connectivity=True), True, [])