When building container images an extra create_fstab method exists that created an empty fstab file. The reasons for this are historical and also related to appx support from obs. The obs based support for appx containers was based on the creation of a kiwi docker image that got modified and turned into an appx container. Now with native appx support by kiwi this special fstab handling is no longer needed and should be deleted. This Fixes #1329
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
from mock import patch
|
|
from mock import call
|
|
import mock
|
|
|
|
from kiwi.container.setup.oci import ContainerSetupOCI
|
|
|
|
|
|
class TestContainerSetupOCI:
|
|
@patch('os.path.exists')
|
|
def setup(self, mock_exists):
|
|
mock_exists.return_value = True
|
|
|
|
self.container = ContainerSetupOCI(
|
|
'root_dir', {'container_name': 'system'}
|
|
)
|
|
|
|
self.container.deactivate_bootloader_setup = mock.Mock()
|
|
self.container.deactivate_root_filesystem_check = mock.Mock()
|
|
self.container.setup_static_device_nodes = mock.Mock()
|
|
self.container.setup_root_console = mock.Mock()
|
|
self.container.deactivate_systemd_service = mock.Mock()
|
|
|
|
def test_setup(self):
|
|
self.container.setup()
|
|
self.container.deactivate_bootloader_setup.assert_called_once_with()
|
|
self.container.deactivate_root_filesystem_check.assert_called_once_with()
|
|
self.container.setup_static_device_nodes.assert_called_once_with()
|
|
assert self.container.deactivate_systemd_service.call_args_list == [
|
|
call('device-mapper.service'),
|
|
call('kbd.service'),
|
|
call('swap.service'),
|
|
call('udev.service'),
|
|
call('proc-sys-fs-binfmt_misc.automount')
|
|
]
|
|
|
|
def test_post_init(self):
|
|
self.container.custom_args['container_name'] == 'system'
|