On Wed, 2010-01-06 at 13:35 -0500, James Laska wrote:
---
lib/python/rats.py | 4 ++++
tests/rats_install/install.py | 6 +++---
tests/rats_install/rats_install.py | 4 +++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/lib/python/rats.py b/lib/python/rats.py
index b219b87..6f1b1e6 100644
--- a/lib/python/rats.py
+++ b/lib/python/rats.py
@@ -76,6 +76,10 @@ 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("-x", "--extra-args",
action="store",
+ default="",
+ help="Additional arguments to pass to the kernel booted from the specified
TREEURL")
+
(opt, args) = parser.parse_args()
if len(args) != 1:
parser.error("incorrect number of arguments")
diff --git a/tests/rats_install/install.py b/tests/rats_install/install.py
index 01eb572..72b7171 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,7 @@ 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)
+ guest = create_guest(config.scratchdir, url=baseuri, extra_args=opt.extra)
try:
print "\n== kernel boot test =="
These all look good to me.
diff --git a/tests/rats_install/rats_install.py
b/tests/rats_install/rats_install.py
index ac5d2ea..35544e9 100644
--- a/tests/rats_install/rats_install.py
+++ b/tests/rats_install/rats_install.py
@@ -47,9 +47,11 @@ 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, extra_args=""):
os.chdir(self.bindir)
cmd = "./install.py -s %s -l %s" % (self.tmpdir, self.resultsdir)
+ if extra_args:
+ cmd += " -x \"%s\"" % extra_args
cmd += " %s" % baseurl
result = 'PASS'
try:
Could this use a more specific name, like boot_args or kernel_args?
Also, since (generally) the watcher won't be passing boot_args, it would
help if you added a comment that indicated how someone would pass along
some custom boot_args if they needed to.
-w