コード例 #1
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_build_type_oemconfig_section(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, None, 'oem')
     assert state.get_build_type_oemconfig_section().get_oem_swap()[0] is \
         True
コード例 #2
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_oemconfig_swap_mbytes(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['containerFlavour'], 'docker')
     assert state.get_oemconfig_swap_mbytes() is None
     state = XMLState(xml_data, ['vmxFlavour'], 'oem')
     assert state.get_oemconfig_swap_mbytes() == 42
コード例 #3
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_is_xen_guest_by_architecture(self, mock_platform_machine):
     mock_platform_machine.return_value = 'unsupported'
     xml_data = self.description.load()
     state = XMLState(xml_data, ['ec2Flavour'], 'oem')
     assert state.is_xen_guest() is False
コード例 #4
0
 def test_build_type_not_found(self):
     description = XMLDescription('../data/example_config.xml')
     xml_data = description.load()
     XMLState(xml_data, ['vmxFlavour'], 'foo')
コード例 #5
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_add_container_label_without_contianerconfig(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['xenDom0Flavour'], 'docker')
     state.add_container_config_label('somelabel', 'newlabelvalue')
     config = state.get_container_config()
     assert config['labels'] == {'somelabel': 'newlabelvalue'}
コード例 #6
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_set_derived_from_image_uri(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['derivedContainer'], 'docker')
     state.set_derived_from_image_uri('file:///new_uri')
     assert state.get_derived_from_image_uri().translate() == '/new_uri'
コード例 #7
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_build_type_explicitly_selected(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['vmxFlavour'], 'oem')
     assert state.get_build_type_name() == 'oem'
コード例 #8
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_build_type_vmconfig_entries_no_machine_section(self):
     description = XMLDescription('../data/example_disk_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data)
     assert state.get_build_type_vmconfig_entries() == []
コード例 #9
0
 def test_get_build_type_oemconfig_section(self):
     description = XMLDescription('../data/example_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data, None, 'oem')
     assert state.get_build_type_oemconfig_section().get_oem_swap()[0] is \
         True
コード例 #10
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_volume_management_lvm_default(self):
     description = XMLDescription('../data/example_lvm_default_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data)
     assert state.get_volume_management() == 'lvm'
コード例 #11
0
 def test_get_build_type_pxedeploy_section(self):
     description = XMLDescription('../data/example_pxe_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data, None, 'pxe')
     assert state.get_build_type_pxedeploy_section().get_server() == \
         '192.168.100.2'
コード例 #12
0
 def test_get_build_type_machine_section(self):
     description = XMLDescription('../data/example_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data, None, 'vmx')
     assert state.get_build_type_machine_section().get_guestOS() == 'suse'
コード例 #13
0
 def test_profile_not_found(self):
     description = XMLDescription('../data/example_config.xml')
     xml_data = description.load()
     XMLState(xml_data, ['foo'])
コード例 #14
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_oemconfig_swap_mbytes_default(self):
     description = XMLDescription('../data/example_btrfs_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data)
     assert state.get_oemconfig_swap_mbytes() == 128
コード例 #15
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_build_type_not_found(self):
     xml_data = self.description.load()
     with raises(KiwiTypeNotFound):
         XMLState(xml_data, ['vmxFlavour'], 'foo')
コード例 #16
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_build_type_vmconfig_entries_for_simple_disk(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['vmxSimpleFlavour'], 'oem')
     assert state.get_build_type_vmconfig_entries() == [
         'numvcpus = "4"', 'cpuid.coresPerSocket = "2"'
     ]
コード例 #17
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_build_type_not_found_no_default_type(self):
     description = XMLDescription('../data/example_no_default_type.xml')
     xml_data = description.load()
     with raises(KiwiTypeNotFound):
         XMLState(xml_data, ['minimal'])
コード例 #18
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_set_container_tag(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['containerFlavour'], 'docker')
     state.set_container_config_tag('new_tag')
     config = state.get_container_config()
     assert config['container_tag'] == 'new_tag'
コード例 #19
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_profile_not_found(self):
     xml_data = self.description.load()
     with raises(KiwiProfileNotFound):
         XMLState(xml_data, ['foo'])
コード例 #20
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_derived_from_image_uri(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['derivedContainer'], 'docker')
     assert state.get_derived_from_image_uri().uri == \
         'obs://project/repo/image#mytag'
コード例 #21
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_profile_requires(self):
     xml_data = self.description.load()
     xml_state = XMLState(xml_data, ['composedProfile'])
     assert xml_state.profiles == [
         'composedProfile', 'vmxSimpleFlavour', 'xenDomUFlavour'
     ]
コード例 #22
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_is_xen_guest_by_firmware_setup(self, mock_platform_machine):
     mock_platform_machine.return_value = 'x86_64'
     xml_data = self.description.load()
     state = XMLState(xml_data, ['ec2Flavour'], 'oem')
     assert state.is_xen_guest() is True
コード例 #23
0
ファイル: xml_state_test.py プロジェクト: quatran/kiwi
 def test_get_build_type_machine_section(self):
     xml_data = self.description.load()
     state = XMLState(xml_data, ['vmxSimpleFlavour'], 'oem')
     assert state.get_build_type_machine_section().get_guestOS() == 'suse'
コード例 #24
0
ファイル: builder_disk_test.py プロジェクト: hwoarang/kiwi
 def test_setup_ix86(self, mock_machine):
     mock_machine.return_value = 'i686'
     description = XMLDescription('../data/example_disk_config.xml')
     disk_builder = DiskBuilder(XMLState(description.load()), 'target_dir',
                                'root_dir')
     assert disk_builder.arch == 'ix86'
コード例 #25
0
 def test_build_type_explicitly_selected(self):
     description = XMLDescription('../data/example_config.xml')
     xml_data = description.load()
     state = XMLState(xml_data, ['vmxFlavour'], 'vmx')
     assert state.get_build_type_name() == 'vmx'