tests: enable extended test runs in run.py 51/37451/2
authorNaveen Joy <najoy@cisco.com>
Mon, 17 Oct 2022 22:07:49 +0000 (15:07 -0700)
committerDave Wallace <dwallacelf@gmail.com>
Thu, 20 Oct 2022 19:52:23 +0000 (19:52 +0000)
Change-Id: I5f712614910dc69f04c43efd8958ef8e87906b9e
Type: test
Signed-off-by: Naveen Joy <najoy@cisco.com>
test/run.py

index ddb7995..58112fd 100755 (executable)
@@ -283,6 +283,7 @@ def run_tests_in_venv(
     log_dir,
     socket_dir="",
     running_vpp=False,
+    extended=False,
 ):
     """Runs tests in the virtual environment set by venv_dir.
 
@@ -292,6 +293,7 @@ def run_tests_in_venv(
     log_dir: Directory location for storing log files
     socket_dir: Use running VPP's socket files
     running_vpp: True if tests are run against a running VPP
+    extended: Run extended tests
     """
     script = os.path.join(test_dir, "scripts", "run.sh")
     args = [
@@ -305,6 +307,8 @@ def run_tests_in_venv(
     ]
     if running_vpp:
         args = args + [f"--use-running-vpp"]
+    if extended:
+        args = args + [f"--extended"]
     print(f"Running script: {script} " f"{' '.join(args)}")
     process_args = [script] + args
     call(process_args)
@@ -409,6 +413,15 @@ if __name__ == "__main__":
         "Default: /var/run/vpp if VPP is started as the root user, else "
         "/var/run/user/${uid}/vpp.",
     )
+    parser.add_argument(
+        "-e",
+        "--extended",
+        dest="extended",
+        required=False,
+        action="store_true",
+        default=False,
+        help="Run extended tests.",
+    )
     args = parser.parse_args()
     vm_tests = False
     # Enable VM tests
@@ -436,6 +449,7 @@ if __name__ == "__main__":
             log_dir=args.log_dir,
             socket_dir=args.socket_dir,
             running_vpp=args.running_vpp,
+            extended=args.extended,
         )
     # Run tests against a VPP inside a VM
     else: