Greetings,
I've incorporated the earlier patch feedback on install.py and adjusted it slightly to accomodate how images are landing for RATS drops now. These compose trees contain only boot and install images, and no packages or repodata. I've modified rats.py, rats_install.py and install.py to accomodate installing using the images and packages in different locations. I've tested locally and it works well. This addresses ticket#115.
Also included in the patch is install.py support for adding boot arguments (e.g. updates=http://.../updates.img) as well as support for accepting this information from the control file in rats_install.py. This address ticket#103.
The next step will be adjusting post-tree-compose to watch this additional RATS drop location. But for now, I'm comfortable manually scheduling these tests to work out the kinks.
Please let me know if there are any corrections or suggestions.
Thanks, James
--- lib/python/rats.py | 26 +++++++++++++++++++++----- tests/rats_install/install.py | 11 ++++++++--- tests/rats_install/rats_install.py | 6 +++++- 3 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/lib/python/rats.py b/lib/python/rats.py index b219b87..ec72e43 100644 --- a/lib/python/rats.py +++ b/lib/python/rats.py @@ -76,14 +76,30 @@ def parse_args(): parser.add_option("-b", "--bindir", action="store", default=config.bindir, help="binary dir - contains minimon, ks.cfg, etc. (%default)") + parser.add_option("-i", "--image-url", action="store", + default="", + help="Specify alternative URL for boot and install images") + parser.add_option("-x", "--extra-args", action="store", + default="", + help="Additional arguments to pass to the kernel booted from the specified TREEURL") (opt, args) = parser.parse_args() + + # Validate arguments if len(args) != 1: parser.error("incorrect number of arguments") - uri = args[0] - if not uri.endswith('/'): - uri = uri + '/' - util.grabber.opts.prefix = uri + + # Set the default URL prefix for all urlgrabber operations + url_prefix = opt.image_url or args[0] + if not url_prefix.endswith('/'): + url_prefix = url_prefix + '/' + util.grabber.opts.prefix = url_prefix + + # Process TREEURL + baseurl = args[0] + if not baseurl.endswith('/'): + baseurl = baseurl + '/' + config.set_scratchdir(opt.scratchdir) config.logdir = opt.logdir config.bindir = opt.bindir - return (opt, uri) + return (opt, baseurl) diff --git a/tests/rats_install/install.py b/tests/rats_install/install.py index 01eb572..be43a11 100755 --- a/tests/rats_install/install.py +++ b/tests/rats_install/install.py @@ -90,7 +90,7 @@ def get_initrd(treeinfo): initrd = c.get('images-%s' % arch,'initrd') return initrd
-def create_guest(imgdir, name="RATS", kickstart=None, minimon=None, url=None): +def create_guest(imgdir, name="RATS", kickstart=None, minimon=None, url=None, extra_args=""): '''Attempt to create a new virt guest using the given data''' if kickstart is None: kickstart = os.path.join(config.bindir, "ks.cfg") @@ -149,7 +149,7 @@ def create_guest(imgdir, name="RATS", kickstart=None, minimon=None, url=None): guest = VirtGuest(name="%s_%u" % (name, counter)) print " new guest name: %s" % guest.name print "starting virt guest" - guest.create(location=imgdir) + guest.create(location=imgdir, extra_args=extra_args) guest.minimon = minimon_server # save MinimonServer object guest.steplist = [] # A place to save the list of anaconda steps return guest @@ -323,7 +323,12 @@ if __name__ == '__main__': util.write_keyval("tree_time", int(float(timestamp))) util.write_keyval("treeinfo_localtime", time.ctime(timestamp))
- guest = create_guest(config.scratchdir, url=baseuri) + # If the install images and packages are in different locations, direct the + # installer to the appropriate install.img + if opt.image_url: + opt.extra_args += " stage2=%s/images/install.img" % opt.image_url + + guest = create_guest(config.scratchdir, url=baseuri, extra_args=opt.extra_args)
try: print "\n== kernel boot test ==" diff --git a/tests/rats_install/rats_install.py b/tests/rats_install/rats_install.py index ac5d2ea..6a57754 100644 --- a/tests/rats_install/rats_install.py +++ b/tests/rats_install/rats_install.py @@ -47,9 +47,13 @@ class rats_install(test.test): # use the big hammer until we figure out the right thing to do utils.system('lokkit --disabled')
- def run_once(self, baseurl, treename): + def run_once(self, baseurl, treename, image_url="", boot_args=""): os.chdir(self.bindir) cmd = "./install.py -s %s -l %s" % (self.tmpdir, self.resultsdir) + if image_url != "": + cmd += "-i %s" % image_url + if boot_args != "": + cmd += "-x %s" % boot_args cmd += " %s" % baseurl result = 'PASS' try:
autoqa-devel@lists.fedorahosted.org