diff options
| author | Phil Sutter <phil@nwl.cc> | 2023-08-31 12:50:54 +0200 |
|---|---|---|
| committer | Phil Sutter <phil@nwl.cc> | 2025-09-11 18:11:53 +0200 |
| commit | 904ce10112c9d1c5a751dee214860d43b08b569d (patch) | |
| tree | b429961a8ceebc30be1993751ad55f4f22106dd1 | |
| parent | 15c01d744a6b8f428e785a36687e7ecdbc3e7a15 (diff) | |
tests: json_echo: Skip if run as non-root
The test suite manipulates the kernel ruleset. Use the well-known return
code 77 to indicate test execution being skipped.
Signed-off-by: Phil Sutter <phil@nwl.cc>
| -rwxr-xr-x | tests/json_echo/run-test.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/json_echo/run-test.py b/tests/json_echo/run-test.py index a6bdfc61..a3085b35 100755 --- a/tests/json_echo/run-test.py +++ b/tests/json_echo/run-test.py @@ -6,6 +6,10 @@ import os import json import argparse +if os.getuid() != 0: + print("You need to be root to run this, sorry") + sys.exit(77) + TESTS_PATH = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/')) |
