Allow to put a disk.sh script as part of the image description which is called for the disk image types `vmx` and `oem` only and runs after the synchronisation of the root tree into the disk image loop file. At call time of the script the device name of the currently mapped root device is passed as a parameter. The chroot environment for the call is the mounted disk itself which makes this different from the config.sh/images.sh caller environment. This Fixes #1464
19 lines
781 B
Python
19 lines
781 B
Python
from pytest import raises
|
|
|
|
from kiwi.system.shell import Shell
|
|
from kiwi.exceptions import KiwiShellVariableValueError
|
|
|
|
|
|
class TestSystemShell:
|
|
def test_format_to_variable_value(self):
|
|
assert Shell.format_to_variable_value('text') == 'text'
|
|
assert Shell.format_to_variable_value(True) == 'true'
|
|
assert Shell.format_to_variable_value(False) == 'false'
|
|
assert Shell.format_to_variable_value('42') == '42'
|
|
assert Shell.format_to_variable_value(0) == '0'
|
|
assert Shell.format_to_variable_value(42) == '42'
|
|
assert Shell.format_to_variable_value(None) == ''
|
|
assert Shell.format_to_variable_value(b"42") == '42'
|
|
with raises(KiwiShellVariableValueError):
|
|
Shell.format_to_variable_value(['foo', 'bar'])
|