Example #1
0
    def test_clean_up_instance(self, _remove_share_file_mock,
                               _cleanup_vmedia_boot_mock):
        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=False) as task:
            task.node.instance_info['irmc_boot_iso'] = 'glance://deploy_iso'
            task.node.driver_internal_info['irmc_boot_iso'] = 'irmc_boot.iso'
            task.node.driver_internal_info = {'root_uuid_or_disk_id': (
                "12312642-09d3-467f-8e09-12385826a123")}

            task.driver.boot.clean_up_instance(task)

            _remove_share_file_mock.assert_called_once_with(
                irmc_boot._get_boot_iso_name(task.node))
            self.assertNotIn('irmc_boot_iso',
                             task.node.driver_internal_info)
            self.assertNotIn('root_uuid_or_disk_id',
                             task.node.driver_internal_info)
            _cleanup_vmedia_boot_mock.assert_called_once_with(task)
Example #2
0
    def test_clean_up_instance(self, _remove_share_file_mock,
                               _cleanup_vmedia_boot_mock):
        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=False) as task:
            task.node.instance_info['irmc_boot_iso'] = 'glance://deploy_iso'
            task.node.driver_internal_info['irmc_boot_iso'] = 'irmc_boot.iso'
            task.node.driver_internal_info = {'root_uuid_or_disk_id': (
                "12312642-09d3-467f-8e09-12385826a123")}

            task.driver.boot.clean_up_instance(task)

            _remove_share_file_mock.assert_called_once_with(
                irmc_boot._get_boot_iso_name(task.node))
            self.assertNotIn('irmc_boot_iso',
                             task.node.driver_internal_info)
            self.assertNotIn('root_uuid_or_disk_id',
                             task.node.driver_internal_info)
            _cleanup_vmedia_boot_mock.assert_called_once_with(task)
Example #3
0
 def test__get_boot_iso_name(self):
     actual = irmc_boot._get_boot_iso_name(self.node)
     expected = "boot-%s.iso" % self.node.uuid
     self.assertEqual(expected, actual)
Example #4
0
 def test__get_boot_iso_name(self):
     actual = irmc_boot._get_boot_iso_name(self.node)
     expected = "boot-%s.iso" % self.node.uuid
     self.assertEqual(expected, actual)