From: David VaĊĦek Date: Mon, 14 Dec 2020 13:25:49 +0000 (+0100) Subject: tests-extra: move the "knottest-last" symlink to the testers' home directories X-Git-Tag: v3.1.0~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=875a4beea977f5ae1abdb19e31093feea650b186;p=thirdparty%2Fknot-dns.git tests-extra: move the "knottest-last" symlink to the testers' home directories 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. --- diff --git a/tests-extra/runtests.py b/tests-extra/runtests.py index d6b1ac5d35..6db875aea7 100755 --- a/tests-extra/runtests.py +++ b/tests-extra/runtests.py @@ -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")) diff --git a/tests-extra/tools/dnstest/params.py b/tests-extra/tools/dnstest/params.py index b997bd6bf4..6bf6f5c08d 100644 --- a/tests-extra/tools/dnstest/params.py +++ b/tests-extra/tools/dnstest/params.py @@ -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 = ""