From: Jason Ish Date: Thu, 18 Jan 2018 16:21:47 +0000 (-0600) Subject: remove requires.not-features support: use skip instead X-Git-Tag: suricata-6.0.4~517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be2b99e03ed1e46eb1935265fdc98e7b906726a8;p=thirdparty%2Fsuricata-verify.git remove requires.not-features support: use skip instead --- diff --git a/README.md b/README.md index c4721540f..5a0a89dda 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,6 @@ requires: # Restrict the test to builds with HAVE_LUA. - HAVE_LUA - # Require that Suricata not be built with specific features. - not-features: - RUST: option reason - # Don't require a pcap file to be present. By default a test will be skipped # if there is no pcap file in the test directory. Not applicable if a # command is provided. diff --git a/run.py b/run.py index 2b8afafa4..1233cdb2f 100755 --- a/run.py +++ b/run.py @@ -243,6 +243,7 @@ class TestRunner: 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: @@ -251,6 +252,14 @@ class TestRunner: msg = "not for uid %d" % (skip["uid"]) raise UnsatisfiedRequirementError(msg) + if "feature" in skip: + if self.suricata_config.has_feature(skip["feature"]): + if "msg" in skip: + msg = skip["msg"] + else: + msg = "not for feature %s" % (skip["feature"]) + raise UnsatisfiedRequirementError(msg) + def check_requires(self): if "requires" in self.config: requires = self.config["requires"] @@ -270,16 +279,6 @@ class TestRunner: raise UnsatisfiedRequirementError( "requires feature %s" % (feature)) - if "not-features" in requires: - for feature in requires["not-features"]: - if self.suricata_config.has_feature(feature): - if requires["not-features"][feature]: - comment = "%s" % ( - requires["not-features"][feature]) - else: - comment = "not for feature %s" % (feature) - raise UnsatisfiedRequirementError(comment) - if "env" in requires: for env in requires["env"]: if not env in os.environ: diff --git a/tests/dns-lua-rules/test.yaml b/tests/dns-lua-rules/test.yaml index 79ff97513..e3fc984da 100644 --- a/tests/dns-lua-rules/test.yaml +++ b/tests/dns-lua-rules/test.yaml @@ -1,8 +1,10 @@ requires: features: - HAVE_LUA - not-features: - RUST: known issue with feature RUST + +skip: + - feature: RUST + msg: Known issue with feature RUST checks: - filter: diff --git a/tests/dns-udp-dns-log-unanswered/test.yaml b/tests/dns-udp-dns-log-unanswered/test.yaml index d00be7485..6af8ec795 100644 --- a/tests/dns-udp-dns-log-unanswered/test.yaml +++ b/tests/dns-udp-dns-log-unanswered/test.yaml @@ -1,4 +1,2 @@ -requires: - # Test will be skipped if any of these features are present. - not-features: - RUST: +skip: + - feature: RUST diff --git a/tests/dns-udp-unsolicited-response/test.yaml b/tests/dns-udp-unsolicited-response/test.yaml index 0546b5b1e..1d9dd5bcb 100644 --- a/tests/dns-udp-unsolicited-response/test.yaml +++ b/tests/dns-udp-unsolicited-response/test.yaml @@ -1,6 +1,6 @@ requires: - # Test will be skipped if any of these features are present. - not-features: - RUST: features: - HAVE_LIBJANSSON + +skip: + - feature: RUST