diff --git a/libpermian/plugins/kickstart_test/__init__.py b/libpermian/plugins/kickstart_test/__init__.py index 1c75589..16f5305 100644 --- a/libpermian/plugins/kickstart_test/__init__.py +++ b/libpermian/plugins/kickstart_test/__init__.py @@ -202,6 +202,7 @@ def __init__(self, testRuns, crcList, arch): self.retry = self.settings.getboolean('kickstart_test', 'retry_on_failure') self.timeout = self.settings.get('kickstart_test', 'timeout') self.boot_opts = self.settings.get('kickstart_test', 'added_boot_options') + self.updates_img = self.settings.get('kickstart_test', 'kstest_updates_image') def _create_overrides_file(self, content): with tempfile.NamedTemporaryFile("w", delete=False, prefix="defaults-") as f: @@ -361,6 +362,9 @@ def execute(self): f"-eKSTEST_EXTRA_BOOTOPTS={boot_opts}", ] + if self.updates_img: + command = command + ["--updates", self.updates_img] + command = command + tests LOGGER.info(f"Runner is starting. {current_results.summary_message()}") LOGGER.info("Running %s", command) diff --git a/libpermian/plugins/kickstart_test/settings.ini b/libpermian/plugins/kickstart_test/settings.ini index aef4143..396b017 100644 --- a/libpermian/plugins/kickstart_test/settings.ini +++ b/libpermian/plugins/kickstart_test/settings.ini @@ -20,3 +20,6 @@ kstest_repo=https://github.com/rhinstaller/kickstart-tests.git kstest_repo_branch=master # Path to local kickstart-test checkout to be used kstest_local_repo= + +# Path or URL of anaconda updates image to be used +kstest_updates_image= diff --git a/libpermian/plugins/kickstart_test/test.py b/libpermian/plugins/kickstart_test/test.py index ec30b15..2b29cf9 100644 --- a/libpermian/plugins/kickstart_test/test.py +++ b/libpermian/plugins/kickstart_test/test.py @@ -538,3 +538,28 @@ def testParamsPriority(self): kstest_workflow = KickstartTestWorkflow(testRuns, [], 'x86_64') kstest_workflow.setup() self.assertAlmostEqual(kstest_workflow.boot_iso_url, DUMMY_BOOT_ISO_URL) + +class TestSupportedSettings(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.library = Library('./tests/test_library/kickstart-test/basic') + cls.settings = Settings( + cmdline_overrides={}, + environment={}, + settings_locations=['./tests/test_library/kickstart-test/test-settings.ini'] + ) + + def testSupportedSettingsParsing(self): + event = TestFakeMinimalEvent(self.settings) + testRuns = TestRuns(self.library, event, self.settings) + kstest_workflow = KickstartTestWorkflow(testRuns, [], 'x86_64') + self.assertEqual(kstest_workflow.runner_command, ["runner_cmd", "arg1", "arg2"]) + self.assertEqual(kstest_workflow.boot_opts, "inst.xtimeout=100 inst.sshd=1") + self.assertEqual(kstest_workflow.retry, False) + self.assertEqual(kstest_workflow.timeout, "0") + self.assertEqual(kstest_workflow.ksrepo, + "https://github.com/rhinstaller/kickstart-tests.git") + self.assertEqual(kstest_workflow.ksrepo_branch, "master") + self.assertEqual(kstest_workflow.ksrepo_local_dir, "/var/tmp/kickstart-tests") + self.assertEqual(kstest_workflow.updates_img, + "http://cobra02/users/rv/updates.getmac.img") diff --git a/tests/test_library/kickstart-test/test-settings.ini b/tests/test_library/kickstart-test/test-settings.ini new file mode 100644 index 0000000..48bc805 --- /dev/null +++ b/tests/test_library/kickstart-test/test-settings.ini @@ -0,0 +1,9 @@ +[kickstart_test] +runner_command=runner_cmd arg1 arg2 +added_boot_options=inst.xtimeout=100 inst.sshd=1 +retry_on_failure=False +timeout=0 +kstest_repo=https://github.com/rhinstaller/kickstart-tests.git +kstest_repo_branch=master +kstest_local_repo=/var/tmp/kickstart-tests +kstest_updates_image=http://cobra02/users/rv/updates.getmac.img