Change location of current symlink created by test-runner

test-runner should be creating the current symlink in the
directory above the output directory. In a previous commit,
the current symlink was placed in the current working
directory, which could be inaccessible. It is more likely
that the output directory is always accessible.

This is needed because without this there's no deterministic
way to get the path to ZFS Test Suite results until after the
test suite has started. This makes it difficult for buildbot to
follow the log file.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5314
This commit is contained in:
Giuseppe Di Natale 2016-10-24 10:24:10 -07:00 committed by Brian Behlendorf
parent 24cdeaf12e
commit a85cefa35c
1 changed files with 2 additions and 1 deletions

View File

@ -685,11 +685,12 @@ 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)
# make a symlink to the output for the currently running test
logsymlink = os.path.join(self.outputdir, '../current')
if os.path.islink(logsymlink):
os.unlink(logsymlink)
if not os.path.exists(logsymlink):