]> granicus.if.org Git - zfs/commitdiff
Create a symlink to current test-runner output
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Tue, 18 Oct 2016 17:19:28 +0000 (10:19 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 18 Oct 2016 17:19:28 +0000 (10:19 -0700)
Generate a symlink in the current working directory to
test-runner.py output. This will make it easier for the
ZFS buildbot to collect logs.

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5293

tests/test-runner/cmd/test-runner.py

index 68728490789c7d5787ef345291f76a7ab2153613..cbe8cfbf436a547ad91060055ac31d918fc35ad3 100755 (executable)
@@ -685,10 +685,18 @@ class TestRun(object):
         """
         Walk through all the Tests and TestGroups, calling run().
         """
+        logsymlink = os.path.join(os.getcwd(), 'current')
         try:
             os.chdir(self.outputdir)
         except OSError:
             fail('Could not change to directory %s' % self.outputdir)
+        if os.path.islink(logsymlink):
+            os.unlink(logsymlink)
+        if not os.path.exists(logsymlink):
+            os.symlink(self.outputdir, logsymlink)
+        else:
+            print 'Could not make a symlink to directory %s' % (
+                self.outputdir)
         for test in sorted(self.tests.keys()):
             self.tests[test].run(self.logger, options)
         for testgroup in sorted(self.testgroups.keys()):