Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kstests: add updates.img support to settings #59

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libpermian/plugins/kickstart_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions libpermian/plugins/kickstart_test/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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=
25 changes: 25 additions & 0 deletions libpermian/plugins/kickstart_test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
9 changes: 9 additions & 0 deletions tests/test_library/kickstart-test/test-settings.ini
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link shouldn't be here.