Description: Remove broken test
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2023-02-23

Index: ironic-python-agent/ironic_python_agent/tests/unit/test_hardware.py
===================================================================
--- ironic-python-agent.orig/ironic_python_agent/tests/unit/test_hardware.py
+++ ironic-python-agent/ironic_python_agent/tests/unit/test_hardware.py
@@ -4719,92 +4719,6 @@
                                self.hardware.create_configuration,
                                self.node, [])
 
-    @mock.patch.object(utils, 'get_node_boot_mode', lambda node: 'bios')
-    @mock.patch.object(raid_utils, 'get_volume_name_of_raid_device',
-                       autospec=True)
-    @mock.patch.object(raid_utils, '_get_actual_component_devices',
-                       autospec=True)
-    @mock.patch.object(hardware, 'list_all_block_devices', autospec=True)
-    @mock.patch.object(disk_utils, 'list_partitions', autospec=True)
-    @mock.patch.object(utils, 'execute', autospec=True)
-    def test_create_configuration_with_skip_list(
-            self, mocked_execute, mock_list_parts, mocked_list_all_devices,
-            mocked_actual_comp, mocked_get_volume_name):
-        node = self.node
-
-        raid_config = {
-            "logical_disks": [
-                {
-                    "size_gb": "10",
-                    "raid_level": "1",
-                    "controller": "software",
-                    "volume_name": "small"
-                },
-                {
-                    "size_gb": "MAX",
-                    "raid_level": "0",
-                    "controller": "software",
-                    "volume_name": "large"
-                },
-            ]
-        }
-        node['target_raid_config'] = raid_config
-        node['properties'] = {'skip_block_devices': [{'volume_name': 'large'}]}
-        device1 = hardware.BlockDevice('/dev/sda', 'sda', 107374182400, True)
-        device2 = hardware.BlockDevice('/dev/sdb', 'sdb', 107374182400, True)
-        raid_device1 = hardware.BlockDevice('/dev/md0', 'RAID-1',
-                                            107374182400, True)
-        self.hardware.list_block_devices = mock.Mock()
-        self.hardware.list_block_devices.return_value = [device1, device2]
-        hardware.list_all_block_devices.side_effect = [
-            [raid_device1],  # block_type raid
-            []               # block type md
-        ]
-        mocked_get_volume_name.return_value = "large"
-
-        mocked_execute.side_effect = [
-            None,  # examine md0
-            None,  # mklabel sda
-            ('42', None),  # sgdisk -F sda
-            None,  # mklabel sda
-            ('42', None),  # sgdisk -F sdb
-            None, None, None,  # parted + partx + udevadm_settle sda
-            None, None, None,  # parted + partx + udevadm_settle sdb
-            None, None, None,  # parted + partx + udevadm_settle sda
-            None, None, None,  # parted + partx + udevadm_settle sdb
-            None, None  # mdadms
-        ]
-
-        mocked_actual_comp.side_effect = [
-            ('/dev/sda1', '/dev/sdb1'),
-            ('/dev/sda2', '/dev/sdb2'),
-        ]
-
-        result = self.hardware.create_configuration(node, [])
-        mocked_execute.assert_has_calls([
-            mock.call('mdadm', '--examine', '/dev/md0',
-                      use_standard_locale=True),
-            mock.call('parted', '/dev/sda', '-s', '--', 'mklabel', 'msdos'),
-            mock.call('sgdisk', '-F', '/dev/sda'),
-            mock.call('parted', '/dev/sdb', '-s', '--', 'mklabel', 'msdos'),
-            mock.call('sgdisk', '-F', '/dev/sdb'),
-            mock.call('parted', '/dev/sda', '-s', '-a', 'optimal', '--',
-                      'mkpart', 'primary', '42s', '10GiB'),
-            mock.call('partx', '-av', '/dev/sda', attempts=3,
-                      delay_on_retry=True),
-            mock.call('udevadm', 'settle'),
-            mock.call('parted', '/dev/sdb', '-s', '-a', 'optimal', '--',
-                      'mkpart', 'primary', '42s', '10GiB'),
-            mock.call('partx', '-av', '/dev/sdb', attempts=3,
-                      delay_on_retry=True),
-            mock.call('udevadm', 'settle'),
-            mock.call('mdadm', '--create', '/dev/md0', '--force', '--run',
-                      '--metadata=1', '--level', '1', '--name', 'small',
-                      '--raid-devices', 2, '/dev/sda1', '/dev/sdb1')])
-        self.assertEqual(raid_config, result)
-
-        self.assertEqual(0, mock_list_parts.call_count)
-
     @mock.patch.object(raid_utils, 'get_volume_name_of_raid_device',
                        autospec=True)
     @mock.patch.object(hardware, 'list_all_block_devices', autospec=True)
@@ -4854,105 +4768,6 @@
         mocked_execute.assert_called_once_with(
             'mdadm', '--examine', '/dev/md0', use_standard_locale=True)
 
-    @mock.patch.object(utils, 'get_node_boot_mode', lambda node: 'bios')
-    @mock.patch.object(raid_utils, '_get_actual_component_devices',
-                       autospec=True)
-    @mock.patch.object(hardware, 'list_all_block_devices', autospec=True)
-    @mock.patch.object(disk_utils, 'list_partitions', autospec=True)
-    @mock.patch.object(utils, 'execute', autospec=True)
-    def test_create_configuration_with_skip_list_no_existing_device(
-            self, mocked_execute, mock_list_parts,
-            mocked_list_all_devices, mocked_actual_comp):
-        node = self.node
-
-        raid_config = {
-            "logical_disks": [
-                {
-                    "size_gb": "10",
-                    "raid_level": "1",
-                    "controller": "software",
-                    "volume_name": "small"
-                },
-                {
-                    "size_gb": "MAX",
-                    "raid_level": "0",
-                    "controller": "software",
-                    "volume_name": "large"
-                },
-            ]
-        }
-        node['target_raid_config'] = raid_config
-        node['properties'] = {'skip_block_devices': [{'volume_name': 'large'}]}
-        device1 = hardware.BlockDevice('/dev/sda', 'sda', 107374182400, True)
-        device2 = hardware.BlockDevice('/dev/sdb', 'sdb', 107374182400, True)
-        self.hardware.list_block_devices = mock.Mock()
-        self.hardware.list_block_devices.return_value = [device1, device2]
-        mock_list_parts.side_effect = [
-            [],
-            processutils.ProcessExecutionError
-        ]
-        hardware.list_all_block_devices.side_effect = [
-            [],  # block_type raid
-            []               # block type md
-        ]
-
-        mocked_execute.side_effect = [
-            None,  # mklabel sda
-            ('42', None),  # sgdisk -F sda
-            None,  # mklabel sda
-            ('42', None),  # sgdisk -F sdb
-            None, None, None,  # parted + partx + udevadm_settle sda
-            None, None, None,  # parted + partx + udevadm_settle sdb
-            None, None, None,  # parted + partx + udevadm_settle sda
-            None, None, None,  # parted + partx + udevadm_settle sdb
-            None, None  # mdadms
-        ]
-
-        mocked_actual_comp.side_effect = [
-            ('/dev/sda1', '/dev/sdb1'),
-            ('/dev/sda2', '/dev/sdb2'),
-        ]
-
-        result = self.hardware.create_configuration(node, [])
-        mocked_execute.assert_has_calls([
-            mock.call('parted', '/dev/sda', '-s', '--', 'mklabel', 'msdos'),
-            mock.call('sgdisk', '-F', '/dev/sda'),
-            mock.call('parted', '/dev/sdb', '-s', '--', 'mklabel', 'msdos'),
-            mock.call('sgdisk', '-F', '/dev/sdb'),
-            mock.call('parted', '/dev/sda', '-s', '-a', 'optimal', '--',
-                      'mkpart', 'primary', '42s', '10GiB'),
-            mock.call('partx', '-av', '/dev/sda', attempts=3,
-                      delay_on_retry=True),
-            mock.call('udevadm', 'settle'),
-            mock.call('parted', '/dev/sdb', '-s', '-a', 'optimal', '--',
-                      'mkpart', 'primary', '42s', '10GiB'),
-            mock.call('partx', '-av', '/dev/sdb', attempts=3,
-                      delay_on_retry=True),
-            mock.call('udevadm', 'settle'),
-            mock.call('parted', '/dev/sda', '-s', '-a', 'optimal', '--',
-                      'mkpart', 'primary', '10GiB', '-1'),
-            mock.call('partx', '-av', '/dev/sda', attempts=3,
-                      delay_on_retry=True),
-            mock.call('udevadm', 'settle'),
-            mock.call('parted', '/dev/sdb', '-s', '-a', 'optimal', '--',
-                      'mkpart', 'primary', '10GiB', '-1'),
-            mock.call('partx', '-av', '/dev/sdb', attempts=3,
-                      delay_on_retry=True),
-            mock.call('udevadm', 'settle'),
-            mock.call('mdadm', '--create', '/dev/md0', '--force', '--run',
-                      '--metadata=1', '--level', '1', '--name', 'small',
-                      '--raid-devices', 2, '/dev/sda1', '/dev/sdb1'),
-            mock.call('mdadm', '--create', '/dev/md1', '--force', '--run',
-                      '--metadata=1', '--level', '0', '--name', 'large',
-                      '--raid-devices', 2, '/dev/sda2', '/dev/sdb2')])
-
-        self.assertEqual(raid_config, result)
-
-        self.assertEqual(2, mock_list_parts.call_count)
-        mock_list_parts.assert_has_calls([
-            mock.call(x) for x in ['/dev/sda', '/dev/sdb']
-        ])
-
     @mock.patch.object(raid_utils, 'get_volume_name_of_raid_device',
                        autospec=True)
     @mock.patch.object(raid_utils, '_get_actual_component_devices',
