]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
tests: test rule without rev gets rev 0
authorJason Ish <ish@unx.ca>
Mon, 11 Feb 2019 19:53:48 +0000 (13:53 -0600)
committerJason Ish <ish@unx.ca>
Wed, 13 Feb 2019 14:53:08 +0000 (08:53 -0600)
tests/test_rule.py

index aed7b9026c6f0f4470f83c41528f9a60a908b80f..3c788032a7e3e0d8b4045ee2bea8791754a4828d 100644 (file)
@@ -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"])