overlay disk images uses a readonly root partition and are overlayed using overlayfs to hook in a cow based read-write space. This commit implements the basic disk setup. Implementation to boot such a disk in the kiwi boot code is still missing, as well as the investigation if dracut is able to boot such a disk too. References #65
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
|
|
from mock import patch
|
|
|
|
import mock
|
|
|
|
from .test_helper import *
|
|
|
|
from kiwi.exceptions import *
|
|
from kiwi.filesystem.squashfs import FileSystemSquashFs
|
|
|
|
|
|
class TestFileSystemSquashfs(object):
|
|
@patch('os.path.exists')
|
|
def setup(self, mock_exists):
|
|
mock_exists.return_value = True
|
|
self.squashfs = FileSystemSquashFs(mock.Mock(), 'root_dir')
|
|
|
|
@patch('kiwi.filesystem.squashfs.Command.run')
|
|
def test_create_on_file(self, mock_command):
|
|
self.squashfs.create_on_file('myimage', 'label')
|
|
mock_command.assert_called_once_with(
|
|
['mksquashfs', 'root_dir', 'myimage', '-noappend', '-comp', 'xz']
|
|
)
|
|
|
|
@patch('kiwi.filesystem.squashfs.Command.run')
|
|
def test_create_on_file_exclude_data(self, mock_command):
|
|
self.squashfs.create_on_file('myimage', 'label', ['foo'])
|
|
mock_command.assert_called_once_with(
|
|
[
|
|
'mksquashfs', 'root_dir', 'myimage',
|
|
'-noappend', '-comp', 'xz', '-e', 'foo'
|
|
]
|
|
)
|