def test_deploy_partition_image_without_swap(self):
        address = '127.0.0.1'
        port = 3306
        iqn = 'iqn.xyz'
        lun = 1
        image_path = '/tmp/xyz/image'
        root_mb = 128
        swap_mb = 0
        ephemeral_mb = 0
        ephemeral_format = None
        configdrive_mb = 0
        node_uuid = "12345678-1234-1234-1234-1234567890abcxyz"

        dev = '/dev/fake'
        root_part = '/dev/fake-part1'
        root_uuid = '12345678-1234-1234-12345678-12345678abcdef'

        utils_name_list = ['get_dev', 'discovery', 'login_iscsi',
                           'notify', 'logout_iscsi', 'delete_iscsi']

        disk_utils_name_list = ['make_partitions', 'get_image_mb',
                                'is_block_device', 'populate_image',
                                'block_uuid', 'destroy_disk_metadata']

        utils_mock = self._mock_calls(utils_name_list, utils)
        utils_mock.get_dev.return_value = dev

        disk_utils_mock = self._mock_calls(disk_utils_name_list, disk_utils)
        disk_utils_mock.get_image_mb.return_value = 1
        disk_utils_mock.is_block_device.return_value = True
        disk_utils_mock.block_uuid.return_value = root_uuid
        disk_utils_mock.make_partitions.return_value = {'root': root_part}
        utils_calls_expected = [mock.call.get_dev(address, port, iqn, lun),
                                mock.call.discovery(address, port),
                                mock.call.login_iscsi(address, port, iqn),
                                mock.call.logout_iscsi(address, port, iqn),
                                mock.call.delete_iscsi(address, port, iqn)]
        disk_utils_calls_expected = [mock.call.get_image_mb(image_path),
                                     mock.call.is_block_device(dev),
                                     mock.call.destroy_disk_metadata(
                                         dev, node_uuid),
                                     mock.call.make_partitions(
                                         dev, root_mb, swap_mb,
                                         ephemeral_mb,
                                         configdrive_mb,
                                         node_uuid,
                                         commit=True,
                                         boot_option="netboot",
                                         boot_mode="bios",
                                         disk_label=None),
                                     mock.call.is_block_device(root_part),
                                     mock.call.populate_image(
                                         image_path, root_part),
                                     mock.call.block_uuid(root_part)]

        uuid_dict_returned = utils.deploy_partition_image(address, port, iqn,
                                                          lun, image_path,
                                                          root_mb, swap_mb,
                                                          ephemeral_mb,
                                                          ephemeral_format,
                                                          node_uuid)

        self.assertEqual(utils_calls_expected, utils_mock.mock_calls)
        self.assertEqual(disk_utils_calls_expected, disk_utils_mock.mock_calls)
        self.assertEqual(root_uuid, uuid_dict_returned['root uuid'])
Whether the specified node is valid.
dataset/ETHPy150Open openstack/ironic/ironic/tests/unit/drivers/modules/test_deploy_utils.py/PhysicalWorkTestCase.test_deploy_partition_image_without_swap--crossover with--dataset/ETHPy150Open Kuniwak/vint/vint/linting/policy/prohibit_no_abort_function.py/ProhibitNoAbortFunction.is_valid