Update lorax wrapper to use --installpkgs
The lorax wrapper class now understands the --installpkgs argument and can use it to pass multiple package names to the command. There is a simple test to make sure the commands includes all specified options. A bug is fixed where the bug URL would not be correctly included. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
791448cc32
commit
94f519d01c
2 changed files with 59 additions and 2 deletions
52
tests/test_lorax_wrapper.py
Executable file
52
tests/test_lorax_wrapper.py
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||
|
||||
from pungi.wrappers.lorax import LoraxWrapper
|
||||
|
||||
|
||||
class LoraxWrapperTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.lorax = LoraxWrapper()
|
||||
|
||||
def test_get_command_with_minimal_arguments(self):
|
||||
cmd = self.lorax.get_lorax_cmd("product", "version", "release",
|
||||
"/mnt/repo_baseurl", "/mnt/output_dir")
|
||||
|
||||
self.assertEqual(cmd[0], 'lorax')
|
||||
self.assertItemsEqual(cmd[1:],
|
||||
['--product=product',
|
||||
'--version=version',
|
||||
'--release=release',
|
||||
'--source=file:///mnt/repo_baseurl',
|
||||
'/mnt/output_dir'])
|
||||
|
||||
def test_get_command_with_all_arguments(self):
|
||||
cmd = self.lorax.get_lorax_cmd("product", "version", "release",
|
||||
"/mnt/repo_baseurl", "/mnt/output_dir",
|
||||
variant="Server", bugurl="http://example.com/",
|
||||
nomacboot=True, noupgrade=True, is_final=True,
|
||||
buildarch='x86_64', volid='VOLUME_ID',
|
||||
buildinstallpackages=['bash', 'vim'])
|
||||
|
||||
self.assertEqual(cmd[0], 'lorax')
|
||||
self.assertItemsEqual(cmd[1:],
|
||||
['--product=product', '--version=version',
|
||||
'--release=release', '--variant=Server',
|
||||
'--source=file:///mnt/repo_baseurl',
|
||||
'--bugurl=http://example.com/',
|
||||
'--buildarch=x86_64', '--volid=VOLUME_ID',
|
||||
'--nomacboot', '--noupgrade', '--isfinal',
|
||||
'--installpkgs=bash', '--installpkgs=vim',
|
||||
'/mnt/output_dir'])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue