コード例 #1
0
    def setup(self, mock_machine, mock_firmware):
        self.command_type = namedtuple('command_return_type', ['output'])

        mock_machine.return_value = 's390'

        self.firmware = mock.Mock()
        self.firmware.get_partition_table_type = mock.Mock(return_value='dasd')
        mock_firmware.return_value = self.firmware

        self.zipl = mock.Mock()
        self.template = mock.Mock()
        self.zipl.get_template.return_value = self.template
        kiwi.bootloader_config_zipl.BootLoaderTemplateZipl = mock.Mock(
            return_value=self.zipl)

        self.xml_state = mock.Mock()
        self.xml_state.build_type.get_firmware = mock.Mock(return_value=None)
        self.xml_state.build_type.get_boottimeout = mock.Mock(
            return_value='200')
        self.xml_state.build_type.get_target_blocksize = mock.Mock(
            return_value='4096')
        self.xml_state.build_type.get_zipl_targettype = mock.Mock(
            return_value='CDL')
        self.xml_state.build_type.get_kernelcmdline = mock.Mock(
            return_value='cmdline')
        self.xml_state.xml_data.get_name = mock.Mock(return_value='image-name')
        self.xml_state.xml_data.get_displayname = mock.Mock(return_value=None)
        self.xml_state.build_type.get_image = mock.Mock(return_value='oem')
        self.bootloader = BootLoaderConfigZipl(self.xml_state, 'root_dir',
                                               {'targetbase': '/dev/loop0'})
コード例 #2
0
 def test_post_init_no_target_base(self, mock_machine):
     mock_machine.return_value = 's390'
     BootLoaderConfigZipl(mock.Mock(), 'root_dir')
コード例 #3
0
 def test_post_init_invalid_platform(self, mock_machine):
     mock_machine.return_value = 'unsupported-arch'
     BootLoaderConfigZipl(mock.Mock(), 'root_dir')