]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
tests-extra: move the "knottest-last" symlink to the testers' home directories
authorDavid Vašek <david.vasek@nic.cz>
Mon, 14 Dec 2020 13:25:49 +0000 (14:25 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Thu, 17 Dec 2020 13:46:25 +0000 (14:46 +0100)
Move the "/tmp/knottest-last" symlink to the home directory of every user
who runs the test. The goal is to make the link updatable by every user
and to point to his last test run.
Also, keep the link created by the regular nightly-test runs in its output
directory (like "/tmp/tmp.K9O8sIsRSd/"), but make it a relative link, which
seems more appropriate.

tests-extra/runtests.py
tests-extra/tools/dnstest/params.py

index d6b1ac5d35e29e7bbcd7ddad1112d51aaee93e28..6db875aea779ec771a5bc6c37cade6b750f17b04 100755 (executable)
@@ -260,7 +260,7 @@ def main(args):
     os.chmod(outs_dir, 0o755)
 
     # Try to create symlink to the latest result.
-    last_link = os.path.join(params.outs_dir, "knottest-last")
+    last_link = os.path.join(params.home_dir, "knottest-last")
     try:
         if os.path.exists(last_link):
             os.remove(last_link)
@@ -268,6 +268,16 @@ def main(args):
     except:
         pass
 
+    # Make the symlink in the test directory too.
+    # (For backward compatibility?)
+    if os.path.realpath(params.outs_dir) != "/tmp":
+        outs_dir_relative = os.path.basename(outs_dir)
+        last_link_relative = os.path.join(params.outs_dir,"knottest-last")
+        try:
+            os.symlink(outs_dir_relative, last_link_relative)
+        except:
+            pass
+
     # Write down environment.
     log_environment(os.path.join(outs_dir, "environment.log"))
 
index b997bd6bf4c04cec20e22cf95445faacc37436a2..6bf6f5c08d1012178d408edea69ac989b729e2bd 100644 (file)
@@ -67,6 +67,9 @@ bind_ctl = get_binary("KNOT_TEST_BINDC", "rndc")
 # KNOT_TEST_OUTS_DIR - working directories location.
 outs_dir = get_param("KNOT_TEST_OUTS_DIR", "/tmp")
 
+# HOME - tester's home directory for the "knottest-last" symbolic link.
+home_dir = get_param("HOME", "/tmp")
+
 # Common data directory (e.g. zone files).
 common_data_dir = ""