From: Jason Ish Date: Mon, 11 Feb 2019 19:53:48 +0000 (-0600) Subject: tests: test rule without rev gets rev 0 X-Git-Tag: 1.1.0rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a13adac64eef9c0a4ebe4cc8343287c8f683339;p=thirdparty%2Fsuricata-update.git tests: test rule without rev gets rev 0 --- diff --git a/tests/test_rule.py b/tests/test_rule.py index aed7b90..3c78803 100644 --- a/tests/test_rule.py +++ b/tests/test_rule.py @@ -174,3 +174,9 @@ alert dnp3 any any -> any any (msg:"SURICATA DNP3 Request flood detected"; \ self.assertIsNotNone(rule) self.assertEqual(rule["dest_port"], "[!2200, 5500]") + def test_parse_no_rev(self): + """Test that a rule with no revision gets assigned the default + revision of 0.""" + rule_string = u"""alert ip any any -> any any (content:"uid=0|28|root|29|"; classtype:bad-unknown; sid:10000000;)""" + rule = suricata.update.rule.parse(rule_string) + self.assertEqual(0, rule["rev"])