tests: add an argument to select the vpp binary in run.py 47/42847/7
authorNaveen Joy <[email protected]>
Wed, 23 Apr 2025 17:32:08 +0000 (10:32 -0700)
committerDamjan Marion <[email protected]>
Thu, 24 Apr 2025 14:03:08 +0000 (14:03 +0000)
Type: test

Change-Id: I5ec3a54e6f7661e2b742910b1f1fb1f5d4a28a36
Signed-off-by: Naveen Joy <[email protected]>
test/run.py

index 2e7e9c4..489d86b 100644 (file)
@@ -71,9 +71,7 @@ def get_env(args):
         "VENV_PATH": str(ws_root / "build-root" / "test" / "venv"),
         "VPP_BUILD_DIR": str(ws_root / "build-root" / "build-vpp-native" / "vpp"),
         "VPP_INSTALL_PATH": str(ws_root / "build-root" / "install-vpp-native"),
-        "VPP_BIN": str(
-            ws_root / "build-root" / "install-vpp-native" / "vpp" / "bin" / "vpp"
-        ),
+        "VPP_BIN": args.vpp_binary,
         "VPP_PLUGIN_PATH": str(
             ws_root
             / "build-root"
@@ -221,6 +219,7 @@ def run_tests_in_venv(env):
         f"--venv-dir={env['VENV_PATH']}",
         f"--vpp-ws-dir={env['WS_ROOT']}",
         f"--vpp-tag={env['TAG']}",
+        f"--vpp={env['VPP_BIN']}",
         f"--failed-dir={env['FAILED_DIR']}",
         f"--verbose={env['V']}",
         f"--jobs={env['TEST_JOBS']}",
@@ -328,6 +327,17 @@ if __name__ == "__main__":
         "Default: /var/run/vpp if VPP is started as the root user, else "
         "/var/run/user/${uid}/vpp.",
     )
+    parser.add_argument(
+        "--vpp-binary",
+        dest="vpp_binary",
+        required=False,
+        action="store",
+        default=str(
+            ws_root / "build-root" / "install-vpp-native" / "vpp" / "bin" / "vpp"
+        ),
+        help=f"Path to VPP Binary."
+        f"Default: {ws_root}/build-root/install-vpp-native/vpp/bin/vpp",
+    )
     parser.add_argument(
         "-e",
         "--extended",