Exemplo n.º 1
0
 def test_setup_raises_on_load_config(self, mock_get_plugin_config_file,
                                      mock_yaml_safe_load):
     mock_get_plugin_config_file.return_value = \
         '../data/kiwi_boxed_plugin.yml'
     mock_yaml_safe_load.side_effect = Exception
     with raises(KiwiBoxPluginConfigError):
         BoxConfig('suse')
Exemplo n.º 2
0
 def __init__(self, boxname: str, arch: str = '') -> None:
     self.arch = arch or platform.machine()
     self.box_config = BoxConfig(boxname, arch)
     self.box_dir = os.sep.join(
         [Defaults.get_local_box_cache_dir(), boxname])
     self.box_stage = DirFiles(self.box_dir)
     self.system = ''
     self.kernel = ''
     self.initrd = ''
     Path.create(self.box_dir)
Exemplo n.º 3
0
 def __init__(self, boxname, arch=None):
     self.box_config = BoxConfig(boxname, arch)
     self.box_dir = os.sep.join(
         [Defaults.get_local_box_cache_dir(), boxname])
     self.vm_setup_type = namedtuple(
         'vm_setup_type',
         ['system', 'kernel', 'initrd', 'append', 'ram', 'smp'])
     self.box_stage = DirFiles(self.box_dir)
     self.system = None
     self.kernel = None
     self.initrd = None
     Path.create(self.box_dir)
Exemplo n.º 4
0
 def test_setup_raises_box_not_found(self, mock_get_plugin_config_file):
     mock_get_plugin_config_file.return_value = \
         '../data/kiwi_boxed_plugin.yml'
     with raises(KiwiBoxPluginBoxNameError):
         self.box_config = BoxConfig('foo', 'x86_64')
Exemplo n.º 5
0
 def setup(self, mock_platform_machine, mock_get_plugin_config_file):
     mock_platform_machine.return_value = 'x86_64'
     mock_get_plugin_config_file.return_value = \
         '../data/kiwi_boxed_plugin.yml'
     with self._caplog.at_level(logging.INFO):
         self.box_config = BoxConfig('suse')
Exemplo n.º 6
0
 def test_setup_raises_on_unsupported_arch(self,
                                           mock_get_plugin_config_file):
     mock_get_plugin_config_file.return_value = \
         '../data/kiwi_boxed_plugin.yml'
     with raises(KiwiBoxPluginArchNotFoundError):
         BoxConfig('suse', 'artificial_arch')
Exemplo n.º 7
0
 def setup(self, mock_platform_machine, mock_get_plugin_config_file):
     mock_platform_machine.return_value = 'x86_64'
     mock_get_plugin_config_file.return_value = \
         '../data/kiwi_boxed_plugin.yml'
     self.box_config = BoxConfig('suse')