]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: display error when trying to run tests out of the root directory
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 3 Sep 2015 17:39:48 +0000 (19:39 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 Sep 2015 18:34:32 +0000 (20:34 +0200)
Since 357d8cfcceb2 ("tests: use the src/nft binary instead of $PATH one"), the
tests fail if you try to run them if you are not under the root directory of
the nftables repository.

Display an error so I don't forget I have to do it like this.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/regression/nft-test.py

index c3d2aae59c2f41abcd8b6ea1be92ebc7da6bfe46..8168203b90a581d17e7b6730fdf82507bc042f09 100755 (executable)
@@ -879,6 +879,11 @@ def main():
         print "You need to be root to run this, sorry"
         return
 
+    if not os.path.isdir("tests/regression/"):
+        print "You have to run nft-test.py from the repository root directory, eg.\n\n" + \
+            "  nftables# python tests/regression/nft-test.py\n"
+        return
+
     test_files = files_ok = run_total = 0
     tests = passed = warnings = errors = 0
     global log_file