summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-01-23 12:19:03 -0500
committerChris Lumens <clumens@redhat.com>2008-01-23 12:19:03 -0500
commit38dbc4db50dc16c687bd98c26d850eec1d0392f9 (patch)
tree88a71edeb861632e432bde34eb476658f13c40d2 /anaconda
parentb7a5a31f4c0c908e4025cf1a2bcaf2930b64150b (diff)
downloadanaconda-38dbc4db50dc16c687bd98c26d850eec1d0392f9.tar.gz
anaconda-38dbc4db50dc16c687bd98c26d850eec1d0392f9.tar.xz
anaconda-38dbc4db50dc16c687bd98c26d850eec1d0392f9.zip
Add dogtail support (#172891, #239024).
Patches are from Alexander Todorov <atodorov AT redhat DOT com>.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda33
1 files changed, 33 insertions, 0 deletions
diff --git a/anaconda b/anaconda
index a192a17df..e641ce9bb 100755
--- a/anaconda
+++ b/anaconda
@@ -273,6 +273,7 @@ def parseOptions():
op.add_option("--module", action="append", default=[])
op.add_option("--nomount", dest="rescue_nomount", action="store_true", default=False)
op.add_option("--updates", dest="updateSrc", action="store", type="string")
+ op.add_option("--dogtail", dest="dogtail", action="store", type="string")
return op.parse_args()
@@ -983,6 +984,38 @@ if __name__ == "__main__":
anaconda.setDispatch()
+ # download and run Dogtail script
+ if opts.dogtail:
+ try:
+ import urlgrabber
+
+ try:
+ fr = urlgrabber.urlopen(opts.dogtail)
+ except urlgrabber.grabber.URLGrabError, e:
+ log.error("Could not retrieve Dogtail script from %s.\nError was\n%s" % (opts.dogtail, e))
+ fr = None
+
+ if fr:
+ from tempfile import mkstemp
+
+ (fw, testcase) = mkstemp(prefix='testcase.py.', dir='/tmp')
+ os.write(fw, fr.read())
+ fr.close()
+ os.close(fw)
+
+ # download completed, run the test
+ if not os.fork():
+ # we are in the child
+ os.chmod(testcase, 0755)
+ os.execv(testcase, [testcase])
+ sys.exit(0)
+ else:
+ # we are in the parent, sleep to give time for the testcase to initialize
+ # todo: is this needed, how to avoid possible race conditions
+ time.sleep(1)
+ except Exception, e:
+ log.error("Exception %s while running Dogtail testcase" % e)
+
if opts.lang:
anaconda.dispatch.skipStep("language", permanent = 1)
instClass.setLanguage(anaconda.id, opts.lang)