From: Pablo M. Bermudo Garay Date: Tue, 18 Apr 2017 23:19:09 +0000 (+0200) Subject: tests: xlate: check if it is being run as root X-Git-Tag: v1.6.2~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fe96cfb71baa915d02d7734739bed7ecc9d79cd;p=thirdparty%2Fiptables.git tests: xlate: check if it is being run as root Signed-off-by: Pablo M. Bermudo Garay Signed-off-by: Pablo Neira Ayuso --- diff --git a/xlate-test.py b/xlate-test.py index 37760e96..43c4be19 100755 --- a/xlate-test.py +++ b/xlate-test.py @@ -72,7 +72,9 @@ def load_test_files(): def main(): - if args.test: + if os.getuid() != 0: + print(red("Error: ") + "You need to be root to run this, sorry") + elif args.test: if not args.test.endswith(".txlate"): args.test += ".txlate" try: