]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
createst: add strictcsum option
authorShivani Bhardwaj <shivanib134@gmail.com>
Fri, 5 Jun 2020 13:13:16 +0000 (18:43 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Wed, 5 Aug 2020 06:44:08 +0000 (12:14 +0530)
createst.py

index 6b8fa4c25635f18c696352ae402c0ef99e268567..3801873e34a5c6a46a84bfd1dd9d6817dd863a84 100755 (executable)
@@ -141,6 +141,8 @@ def write_to_file(data):
         sys.exit(1)
     with open(test_yaml_path, "w+") as fp:
         fp.write("# *** Add configuration here ***\n\n")
+        if not args["strictcsums"]:
+            fp.write("args:\n- -k none\n\n")
         fp.write(data)
 
 
@@ -340,6 +342,8 @@ def parse_args():
                         help="Create filter blocks based on event types only")
     parser.add_argument("--allow-events", nargs="?", default=None,
                         help="Create filter blocks for the specified events")
+    parser.add_argument("--strictcsums", default=None, action="store_true",
+                        help="Stricly validate checksum")
 
     # add arg to allow stdout only
     args = parser.parse_args()
@@ -379,6 +383,8 @@ def generate_eve():
     largs = create_local_args()
     env = create_env()
 
+    if not args["strictcsums"]:
+        largs += ["-k", "none"]
     p = subprocess.Popen(
         largs, cwd=cwd, env=env,
         stdout=subprocess.PIPE, stderr=subprocess.PIPE)