From: Jason Ish Date: Thu, 18 Jan 2018 16:08:55 +0000 (-0600) Subject: test.yaml: allow a test to be skipped if running as a specific uid X-Git-Tag: suricata-6.0.4~519 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a684133d12928066109e0725a71e20d60465403;p=thirdparty%2Fsuricata-verify.git test.yaml: allow a test to be skipped if running as a specific uid --- diff --git a/run.py b/run.py index 6b75897a5..2b8afafa4 100755 --- a/run.py +++ b/run.py @@ -239,6 +239,18 @@ class TestRunner: shell=True, cwd=self.directory) + def check_skip(self): + if not "skip" in self.config: + return + for skip in self.config["skip"]: + if "uid" in skip: + if os.getuid() == skip["uid"]: + if "msg" in skip: + msg = skip["msg"] + else: + msg = "not for uid %d" % (skip["uid"]) + raise UnsatisfiedRequirementError(msg) + def check_requires(self): if "requires" in self.config: requires = self.config["requires"] @@ -298,6 +310,7 @@ class TestRunner: sys.stdout.flush() self.check_requires() + self.check_skip() shell = False