Skip to contentSkip to conversation

tests: display error when trying to run tests out of the root directory

PATCH New Pablo Neira Ayuso 1 participant 1 message Sep 3, 2015 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 tests: display error when trying to run tests out of the root directory

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.

---
 tests/regression/nft-test.py |    5 +++++
 1 file changed, 5 insertions(+)
tests/regression/nft-test.py +5 -0
index c3d2aae..8168203 100755
@@ -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
Signature · 1 line
1.7.10.4