Enable LM back and forth flag for SRIOV

With the inclusion of the Mixed RHEL deployments Live Migration is only
supported from older to new hypervisors. Current SR-IOV live migration
tests migrate back and forth by default. Add the
compute_feature_enabled.live_migrate_back_and_forth to the SR-IOV live
migration tests so that when testing Mixed RHEL deployments tests stop
after initial live migration.

By default the flag is false so adding the configuration as True to
devstack if SR-IOV tests are ever enabled upstream.

Change-Id: I0b188a484dcefd846613d05fe4c49e710778a952
This commit is contained in:
James Parker 2023-07-24 14:35:39 -04:00
parent 401cb527c6
commit c059764085
3 changed files with 35 additions and 29 deletions

View File

@ -40,6 +40,7 @@ function configure {
iniset $TEMPEST_CONFIG compute-feature-enabled rbd_download "$COMPUTE_FEATURE_RBD_DOWNLOAD" iniset $TEMPEST_CONFIG compute-feature-enabled rbd_download "$COMPUTE_FEATURE_RBD_DOWNLOAD"
iniset $TEMPEST_CONFIG compute-feature-enabled uefi_secure_boot "$COMPUTE_FEATURE_UEFI_SECURE_BOOT" iniset $TEMPEST_CONFIG compute-feature-enabled uefi_secure_boot "$COMPUTE_FEATURE_UEFI_SECURE_BOOT"
iniset $TEMPEST_CONFIG compute-feature-enabled vtpm_device_supported "$COMPUTE_FEATURE_VTPM_ENABLED" iniset $TEMPEST_CONFIG compute-feature-enabled vtpm_device_supported "$COMPUTE_FEATURE_VTPM_ENABLED"
iniset $TEMPEST_CONFIG compute-feature-enabled live_migrate_back_and_forth "$COMPUTE_FEATURE_LIVE_MIGRATE_BACK_AND_FORTH"
} }
if [[ "$1" == "stack" ]]; then if [[ "$1" == "stack" ]]; then

View File

@ -24,3 +24,4 @@ COMPUTE_FEATURE_VIRTIO_RNG=${COMPUTE_FEATURE_VIRTIO_RNG:-'True'}
COMPUTE_FEATURE_RBD_DOWNLOAD=${COMPUTE_FEATURE_RBD_DOWNLOAD:-'False'} COMPUTE_FEATURE_RBD_DOWNLOAD=${COMPUTE_FEATURE_RBD_DOWNLOAD:-'False'}
COMPUTE_FEATURE_UEFI_SECURE_BOOT=${COMPUTE_FEATURE_UEFI_SECURE_BOOT:-'True'} COMPUTE_FEATURE_UEFI_SECURE_BOOT=${COMPUTE_FEATURE_UEFI_SECURE_BOOT:-'True'}
COMPUTE_FEATURE_VTPM_ENABLED=${COMPUTE_FEATURE_VTPM_ENABLED:-'True'} COMPUTE_FEATURE_VTPM_ENABLED=${COMPUTE_FEATURE_VTPM_ENABLED:-'True'}
COMPUTE_FEATURE_LIVE_MIGRATE_BACK_AND_FORTH=${COMPUTE_FEATURE_LIVE_MIGRATE_BACK_AND_FORTH:-'True'}

View File

@ -748,34 +748,38 @@ class SRIOVMigration(SRIOVBase):
'after first migration should be 1 but instead ' 'after first migration should be 1 but instead '
'is %s' % pci_allocated_count) 'is %s' % pci_allocated_count)
# Migrate server back to the original host if CONF.compute_feature_enabled.live_migrate_back_and_forth:
self.live_migrate(self.os_admin, server['id'], 'ACTIVE', # Migrate server back to the original host
target_host=host) self.live_migrate(self.os_admin, server['id'], 'ACTIVE',
target_host=host)
# Again find the instance's network device element based on the mac # Again find the instance's network device element based on the
# address and binding:vnic_type from the port info provided by ports # mac address and binding:vnic_type from the port info provided by
# client # ports client
interface_xml_element = self._get_xml_interface_device( interface_xml_element = self._get_xml_interface_device(
server['id'], server['id'],
port['port']['id'], port['port']['id'],
) )
# Confirm vlan tag in interface XML, dev_type, allocation status, and # Confirm vlan tag in interface XML, dev_type, allocation status,
# pci address information are correct in pci_devices table of openstack # and pci address information are correct in pci_devices table of
# DB after second migration # openstack DB after second migration
self._validate_port_xml_vlan_tag(interface_xml_element, self.vlan_id) self._validate_port_xml_vlan_tag(
self._verify_neutron_port_binding( interface_xml_element,
server['id'], self.vlan_id
port['port']['id'] )
) self._verify_neutron_port_binding(
server['id'],
port['port']['id']
)
# Confirm total port allocations still remains one after final # Confirm total port allocations still remains one after final
# migration # migration
pci_allocated_count = self._get_pci_status_count( pci_allocated_count = self._get_pci_status_count(
pci_device_status_regex) pci_device_status_regex)
self.assertEqual(pci_allocated_count, 1, 'Total allocated pci devices ' self.assertEqual(pci_allocated_count, 1, 'Total allocated pci '
'after second migration should be 1 but instead ' 'devices after second migration should be 1 but '
'is %s' % pci_allocated_count) 'instead is %s' % pci_allocated_count)
def test_sriov_direct_live_migration(self): def test_sriov_direct_live_migration(self):
"""Verify sriov live migration using direct type ports """Verify sriov live migration using direct type ports
@ -798,7 +802,7 @@ class SRIOVAttachAndDetach(SRIOVBase):
self.network = self._create_net_from_physical_network( self.network = self._create_net_from_physical_network(
self.vlan_id, self.vlan_id,
self.physical_net) self.physical_net)
self._create_subnet(self.sriov_network['network']['id']) self._create_subnet(self.network['network']['id'])
@classmethod @classmethod
def skip_checks(cls): def skip_checks(cls):
@ -900,7 +904,7 @@ class SRIOVAttachAndDetach(SRIOVBase):
attached port attached port
:param after_attached: dict, original port data when first created :param after_attached: dict, original port data when first created
""" """
net_id = self.sriov_network.get('network').get('id') net_id = self.network.get('network').get('id')
port_id = pre_attached_port['port']['id'] port_id = pre_attached_port['port']['id']
port_ip_addr = pre_attached_port['port']['fixed_ips'][0]['ip_address'] port_ip_addr = pre_attached_port['port']['fixed_ips'][0]['ip_address']
port_mac_addr = pre_attached_port['port']['mac_address'] port_mac_addr = pre_attached_port['port']['mac_address']
@ -941,7 +945,7 @@ class SRIOVAttachAndDetach(SRIOVBase):
servers = [self.create_server_and_ssh(), servers = [self.create_server_and_ssh(),
self.create_server_and_ssh()] self.create_server_and_ssh()]
port = self._create_port_from_vnic_type( port = self._create_port_from_vnic_type(
net=self.sriov_network, net=self.network,
vnic_type=vnic_type vnic_type=vnic_type
) )
@ -1024,7 +1028,7 @@ class SRIOVAttachAndDetach(SRIOVBase):
servers = [self.create_server_and_ssh(), servers = [self.create_server_and_ssh(),
self.create_server_and_ssh()] self.create_server_and_ssh()]
port = self._create_port_from_vnic_type( port = self._create_port_from_vnic_type(
net=self.sriov_network, net=self.network,
vnic_type='direct-physical' vnic_type='direct-physical'
) )