From 9a35efd8f06fdf218cc22e94fd3c3b105bb2364b Mon Sep 17 00:00:00 2001 From: James Parker Date: Tue, 10 May 2022 13:48:18 -0400 Subject: [PATCH] Replace assertItemsEqual with assertCountEqual Based on [1] assertItemsEqual was removed from Python's unittest.Testcase downstream. Relevant methods need to be updated to use assertCountEqual instead. [1] https://code.engineering.redhat.com/gerrit/c/python-openstackclient/+/306648 Change-Id: I954072b16a6987bffb17df23862190f6cd45fd39 --- whitebox_tempest_plugin/api/compute/test_cpu_pinning.py | 6 +++--- .../api/compute/test_virtio_scsi_attach.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py b/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py index ec696350..8175fa30 100644 --- a/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py +++ b/whitebox_tempest_plugin/api/compute/test_cpu_pinning.py @@ -945,7 +945,7 @@ class NUMACPUDedicatedLiveMigrationTest(NUMALiveMigrationBase): (host_sm_a, host_sm_b)): cpu_shared_set = host_sm.get_cpu_shared_set() server_shared_cpus = self._get_shared_cpuset(server['id']) - self.assertItemsEqual( + self.assertCountEqual( server_shared_cpus, cpu_shared_set, 'Shared CPU Set %s of ' 'shared server %s is not equal to shared set of %s' % (server_shared_cpus, server['id'], cpu_shared_set)) @@ -962,7 +962,7 @@ class NUMACPUDedicatedLiveMigrationTest(NUMALiveMigrationBase): # Nova bug 1869804 has been addressed shared_set_a = self._get_shared_cpuset(shared_server_a['id']) host_a_shared_set = host_sm_a.get_cpu_shared_set() - self.assertItemsEqual( + self.assertCountEqual( shared_set_a, host_a_shared_set, 'After migration of server %s, ' 'shared CPU set %s is not equal to new shared set %s' % (shared_server_a['id'], shared_set_a, host_a_shared_set)) @@ -1056,7 +1056,7 @@ class MixedCPUPolicyTest(BasePinningTest, numa_helper.NUMAHelperMixin): # Validate the PCPUs mapped to core 0 are a subset of the cpu shared # set of the host - self.assertItemsEqual(guest_shared_cpus, host_shared_cpus, + self.assertCountEqual(guest_shared_cpus, host_shared_cpus, 'Shared CPU Set %s of shared server %s is ' 'not equal to shared set of host %s' % (guest_shared_cpus, server['id'], diff --git a/whitebox_tempest_plugin/api/compute/test_virtio_scsi_attach.py b/whitebox_tempest_plugin/api/compute/test_virtio_scsi_attach.py index 7cb65123..914cc2c5 100644 --- a/whitebox_tempest_plugin/api/compute/test_virtio_scsi_attach.py +++ b/whitebox_tempest_plugin/api/compute/test_virtio_scsi_attach.py @@ -155,7 +155,7 @@ class VirtioSCSIDisk(base.BaseWhiteboxComputeTest): attached_serial_ids = self.get_attached_serial_ids(scsi_disks) # Assert that the attached volume ids are present as serials - self.assertItemsEqual(attached_volume_ids, attached_serial_ids) + self.assertCountEqual(attached_volume_ids, attached_serial_ids) @testtools.skipUnless(CONF.whitebox.available_cinder_storage > (CONF.whitebox.flavor_volume_size + disks_to_create), @@ -200,7 +200,7 @@ class VirtioSCSIDisk(base.BaseWhiteboxComputeTest): attached_serial_ids = self.get_attached_serial_ids(scsi_disks) # Assert that the volumes IDs we attached are listed as attached - self.assertItemsEqual(vol_ids, attached_volume_ids) + self.assertCountEqual(vol_ids, attached_volume_ids) # Assert that the volume IDs we attached are present in the serials - self.assertItemsEqual(vol_ids, attached_serial_ids) + self.assertCountEqual(vol_ids, attached_serial_ids)