本文整理匯總了Python中kiwi.iso.Iso.add_efi_loader_parameters方法的典型用法代碼示例。如果您正苦於以下問題:Python Iso.add_efi_loader_parameters方法的具體用法?Python Iso.add_efi_loader_parameters怎麽用?Python Iso.add_efi_loader_parameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kiwi.iso.Iso
的用法示例。
在下文中一共展示了Iso.add_efi_loader_parameters方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_on_file
# 需要導入模塊: from kiwi.iso import Iso [as 別名]
# 或者: from kiwi.iso.Iso import add_efi_loader_parameters [as 別名]
def create_on_file(self, filename, label=None, exclude=None):
"""
Create iso filesystem from data tree
There is no label which could be set for iso filesystem
thus this parameter is not used
:param string filename: result file path name
:param string label: unused
:param string exclude: unused
"""
iso = Iso(self.root_dir)
iso.init_iso_creation_parameters(
self.custom_args['create_options']
)
iso.add_efi_loader_parameters()
Command.run(
[
self._find_iso_creation_tool()
] + iso.get_iso_creation_parameters() + [
'-o', filename, self.root_dir
]
)
hybrid_offset = iso.create_header_end_block(filename)
Command.run(
[
self._find_iso_creation_tool(),
'-hide', iso.header_end_name,
'-hide-joliet', iso.header_end_name
] + iso.get_iso_creation_parameters() + [
'-o', filename, self.root_dir
]
)
iso.relocate_boot_catalog(filename)
iso.fix_boot_catalog(filename)
return hybrid_offset
示例2: TestIso
# 需要導入模塊: from kiwi.iso import Iso [as 別名]
# 或者: from kiwi.iso.Iso import add_efi_loader_parameters [as 別名]
#.........這裏部分代碼省略.........
'source-dir/boot/x86_64/loader/isolinux.bin'
]
)
@patch_open
@patch('kiwi.iso.Command.run')
@patch('kiwi.iso.Path.create')
@patch('os.path.exists')
@patch('os.walk')
def test_init_iso_creation_parameters_failed_isolinux_config(
self, mock_walk, mock_exists, mock_path, mock_command, mock_open
):
mock_exists.return_value = True
mock_open.return_value = self.context_manager_mock
command_raises = [False, True]
def side_effect(arg):
if command_raises.pop():
raise Exception
mock_command.side_effect = side_effect
self.iso.init_iso_creation_parameters(['custom_arg'])
mock_path.assert_called_once_with('source-dir/isolinux')
assert mock_command.call_args_list[1] == call(
[
'bash', '-c',
'ln source-dir/boot/x86_64/loader/* source-dir/isolinux'
]
)
@patch('os.path.exists')
def test_add_efi_loader_parameters(self, mock_exists):
mock_exists.return_value = True
self.iso.add_efi_loader_parameters()
assert self.iso.iso_loaders == [
'-eltorito-alt-boot', '-b', 'boot/x86_64/efi',
'-no-emul-boot', '-joliet-long'
]
def test_get_iso_creation_parameters(self):
self.iso.iso_parameters = ['a']
self.iso.iso_loaders = ['b']
assert self.iso.get_iso_creation_parameters() == ['a', 'b']
@raises(KiwiIsoToolError)
@patch('os.path.exists')
def test_isols_no_tool_found(self, mock_exists):
mock_exists.return_value = False
self.iso.isols('some-iso')
@patch('os.path.exists')
@patch('kiwi.iso.Command.run')
@patch_open
def test_isols_usr_bin_isoinfo_used(
self, mock_open, mock_command, mock_exists
):
exists_results = [False, True]
def side_effect(self):
return exists_results.pop()
mock_exists.side_effect = side_effect
self.iso.isols('some-iso')
mock_command.assert_called_once_with(