]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
createst: Create a default README with every test
authorAlice Akaki <akakialice@gmail.com>
Thu, 24 Nov 2022 18:00:12 +0000 (14:00 -0400)
committerShivani Bhardwaj <shivanib134@gmail.com>
Wed, 22 Mar 2023 06:28:27 +0000 (11:58 +0530)
Feature: #5210

createst.py

index 77554174c9b4db02cc7afc170cce6914160e51c0..2c500a185a81dd7786b4dd5c91ec21a24e1c12d1 100755 (executable)
@@ -126,6 +126,23 @@ def create_directory(path):
         sys.exit(1)
 
 
+def create_readme():
+    """
+    Create a README.md file and write to it.
+    """
+    readme_path = os.path.join(test_dir, "README.md")
+    with open(readme_path, "w+") as fp:
+        fp.write("Description\n")
+        fp.write("===========\n")
+        fp.write("<TODO>\n\n")
+        fp.write("PCAP\n")
+        fp.write("====\n")
+        fp.write("<TODO>\n\n")
+        fp.write("Reported by\n")
+        fp.write("===========\n")
+        fp.write("Your Name <yourmail@example.com>\n")
+
+
 def write_to_file(data):
     """
     Check for the output test.yaml file if it exists, else create one and write
@@ -443,6 +460,7 @@ def main():
     init_global_params()
     create_directory(path=args["test-name"])
     create_directory(path=os.path.join(args["test-name"], "output"))
+    create_readme()
     generate_eve()