Пример #1
0
    def setUp(self):
        """ Do any setup required prior to running a test. """
        flags.image_install = True
        self.blivet = InstallerStorage()

        self.addCleanup(self._clean_up)
        self.set_up_storage()
Пример #2
0
    def test_bootloader_in_kickstart(self):
        '''
        test that a bootloader such as prepboot/biosboot shows up
        in the kickstart data
        '''

        with patch('blivet.osinstall.InstallerStorage.bootloader_device',
                   new_callable=PropertyMock) as mock_bootloader_device:
            with patch('blivet.osinstall.InstallerStorage.mountpoints',
                       new_callable=PropertyMock) as mock_mountpoints:
                # set up prepboot partition
                bootloader_device_obj = PartitionDevice(
                    "test_partition_device")
                bootloader_device_obj.size = Size('5 MiB')
                bootloader_device_obj.format = formats.get_format("prepboot")

                blivet_obj = InstallerStorage()

                # mountpoints must exist for update_ksdata to run
                mock_bootloader_device.return_value = bootloader_device_obj
                mock_mountpoints.values.return_value = []

                # initialize ksdata
                test_ksdata = returnClassForVersion()()
                blivet_obj.ksdata = test_ksdata
                blivet_obj.update_ksdata()

        self.assertTrue("part prepboot" in str(blivet_obj.ksdata))