Skip to content

Commit

Permalink
Enable LM back and forth flag for SRIOV
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jamepark4 committed Jul 24, 2023
1 parent 401cb52 commit c059764
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
1 change: 1 addition & 0 deletions devstack/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function configure {
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 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
Expand Down
1 change: 1 addition & 0 deletions devstack/settings
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ COMPUTE_FEATURE_VIRTIO_RNG=${COMPUTE_FEATURE_VIRTIO_RNG:-'True'}
COMPUTE_FEATURE_RBD_DOWNLOAD=${COMPUTE_FEATURE_RBD_DOWNLOAD:-'False'}
COMPUTE_FEATURE_UEFI_SECURE_BOOT=${COMPUTE_FEATURE_UEFI_SECURE_BOOT:-'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'}
64 changes: 34 additions & 30 deletions whitebox_tempest_plugin/api/compute/test_sriov.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,34 +748,38 @@ def _base_test_live_migration(self, vnic_type):
'after first migration should be 1 but instead '
'is %s' % pci_allocated_count)

# Migrate server back to the original 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
# address and binding:vnic_type from the port info provided by ports
# client
interface_xml_element = self._get_xml_interface_device(
server['id'],
port['port']['id'],
)
if CONF.compute_feature_enabled.live_migrate_back_and_forth:
# Migrate server back to the original 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 address and binding:vnic_type from the port info provided by
# ports client
interface_xml_element = self._get_xml_interface_device(
server['id'],
port['port']['id'],
)

# Confirm vlan tag in interface XML, dev_type, allocation status, and
# pci address information are correct in pci_devices table of openstack
# DB after second migration
self._validate_port_xml_vlan_tag(interface_xml_element, self.vlan_id)
self._verify_neutron_port_binding(
server['id'],
port['port']['id']
)
# Confirm vlan tag in interface XML, dev_type, allocation status,
# and pci address information are correct in pci_devices table of
# openstack DB after second migration
self._validate_port_xml_vlan_tag(
interface_xml_element,
self.vlan_id
)
self._verify_neutron_port_binding(
server['id'],
port['port']['id']
)

# Confirm total port allocations still remains one after final
# migration
pci_allocated_count = self._get_pci_status_count(
pci_device_status_regex)
self.assertEqual(pci_allocated_count, 1, 'Total allocated pci devices '
'after second migration should be 1 but instead '
'is %s' % pci_allocated_count)
# Confirm total port allocations still remains one after final
# migration
pci_allocated_count = self._get_pci_status_count(
pci_device_status_regex)
self.assertEqual(pci_allocated_count, 1, 'Total allocated pci '
'devices after second migration should be 1 but '
'instead is %s' % pci_allocated_count)

def test_sriov_direct_live_migration(self):
"""Verify sriov live migration using direct type ports
Expand All @@ -798,7 +802,7 @@ def setUp(self):
self.network = self._create_net_from_physical_network(
self.vlan_id,
self.physical_net)
self._create_subnet(self.sriov_network['network']['id'])
self._create_subnet(self.network['network']['id'])

@classmethod
def skip_checks(cls):
Expand Down Expand Up @@ -900,7 +904,7 @@ def _validate_port_data_after_attach(self, pre_attached_port,
attached port
: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_ip_addr = pre_attached_port['port']['fixed_ips'][0]['ip_address']
port_mac_addr = pre_attached_port['port']['mac_address']
Expand Down Expand Up @@ -941,7 +945,7 @@ def _base_test_attach_and_detach_sriov_port(self, vnic_type):
servers = [self.create_server_and_ssh(),
self.create_server_and_ssh()]
port = self._create_port_from_vnic_type(
net=self.sriov_network,
net=self.network,
vnic_type=vnic_type
)

Expand Down Expand Up @@ -1024,7 +1028,7 @@ def test_sriov_direct_physical_attach_detach_port(self):
servers = [self.create_server_and_ssh(),
self.create_server_and_ssh()]
port = self._create_port_from_vnic_type(
net=self.sriov_network,
net=self.network,
vnic_type='direct-physical'
)

Expand Down

0 comments on commit c059764

Please sign in to comment.