diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-09-03 19:39:48 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-09-07 20:34:32 +0200 |
commit | d041181325714c462a9f9d6f7a7b8fb5cf97e567 (patch) | |
tree | e365d89b197e6f0cc1f7c09f26621433fc1adef6 /tests/regression | |
parent | ff6f6957564f900298d9f493a5a15816e9e165ac (diff) |
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.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/regression')
-rwxr-xr-x | tests/regression/nft-test.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/regression/nft-test.py b/tests/regression/nft-test.py index c3d2aae5..8168203b 100755 --- a/tests/regression/nft-test.py +++ b/tests/regression/nft-test.py @@ -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 |