Esempio n. 1
0
 def test_create_unknown_filesystem(self):
     self.xml_state.get_build_type_name = mock.Mock(
         return_value='super-fs'
     )
     fs = FileSystemBuilder(
         self.xml_state, 'target_dir', 'root_dir'
     )
     fs.create()
Esempio n. 2
0
 def test_create_on_file(self, mock_machine, mock_provider, mock_fs):
     mock_machine.return_value = 'x86_64'
     provider = mock.Mock()
     mock_provider.return_value = provider
     mock_fs.return_value = self.filesystem
     self.xml_state.get_build_type_name = mock.Mock(return_value='squashfs')
     fs = FileSystemBuilder(self.xml_state, 'target_dir', 'root_dir')
     fs.create()
     mock_fs.assert_called_once_with('squashfs', provider, 'root_dir', None)
     self.filesystem.create_on_file.assert_called_once_with(
         'target_dir/myimage.x86_64-1.2.3.squashfs', None)
Esempio n. 3
0
 def test_create_on_loop(self, mock_machine, mock_fs_setup, mock_fs,
                         mock_loop):
     mock_machine.return_value = 'x86_64'
     mock_fs_setup.return_value = self.fs_setup
     mock_fs.return_value = self.filesystem
     mock_loop.return_value = self.loop_provider
     fs = FileSystemBuilder(self.xml_state, 'target_dir', 'root_dir')
     fs.create()
     mock_loop.assert_called_once_with(
         'target_dir/myimage.x86_64-1.2.3.ext3', 42, 4096)
     self.loop_provider.create.assert_called_once_with()
     mock_fs.assert_called_once_with('ext3', self.loop_provider, 'root_dir',
                                     None)
     self.filesystem.create_on_device.assert_called_once_with(None)
     self.filesystem.sync_data.assert_called_once_with(
         ['image', '.profile', '.kconfig', 'var/cache/kiwi'])
Esempio n. 4
0
 def test_create_on_file(
     self, mock_machine, mock_provider, mock_fs
 ):
     mock_machine.return_value = 'x86_64'
     provider = mock.Mock()
     mock_provider.return_value = provider
     mock_fs.return_value = self.filesystem
     self.xml_state.get_build_type_name = mock.Mock(
         return_value='squashfs'
     )
     fs = FileSystemBuilder(
         self.xml_state, 'target_dir', 'root_dir'
     )
     fs.create()
     mock_fs.assert_called_once_with(
         'squashfs', provider, 'root_dir', None
     )
     self.filesystem.create_on_file.assert_called_once_with(
         'target_dir/myimage.x86_64-1.2.3.squashfs', None
     )
Esempio n. 5
0
 def test_create_on_loop(
     self, mock_machine, mock_fs_setup, mock_fs, mock_loop
 ):
     mock_machine.return_value = 'x86_64'
     mock_fs_setup.return_value = self.fs_setup
     mock_fs.return_value = self.filesystem
     mock_loop.return_value = self.loop_provider
     fs = FileSystemBuilder(
         self.xml_state, 'target_dir', 'root_dir'
     )
     fs.create()
     mock_loop.assert_called_once_with(
         'target_dir/myimage.x86_64-1.2.3.ext3', 42, 4096
     )
     self.loop_provider.create.assert_called_once_with()
     mock_fs.assert_called_once_with(
         'ext3', self.loop_provider, 'root_dir', None
     )
     self.filesystem.create_on_device.assert_called_once_with(None)
     self.filesystem.sync_data.assert_called_once_with(
         ['image', '.profile', '.kconfig', 'var/cache/kiwi']
     )
Esempio n. 6
0
 def test_no_filesystem_configured(self):
     self.xml_state.get_build_type_name = mock.Mock(return_value='pxe')
     self.xml_state.build_type.get_filesystem = mock.Mock(return_value=None)
     FileSystemBuilder(self.xml_state, 'target_dir', 'root_dir')
Esempio n. 7
0
 def test_create_unknown_filesystem(self):
     self.xml_state.get_build_type_name = mock.Mock(return_value='super-fs')
     fs = FileSystemBuilder(self.xml_state, 'target_dir', 'root_dir')
     fs.create()