Skip to content

Commit 791a266

Browse files
committed
fix(tests/startup): find seccompiler-bin also if binary dir changes
If we pass a different binary dir, the test fails because it can't find seccompiler-bin in the default folder. Signed-off-by: Riccardo Mancini <[email protected]>
1 parent 43c5c97 commit 791a266

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/host_tools/cargo_build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ def get_example(name, *args, package="firecracker", **kwargs):
6969
return get_binary(package, *args, **kwargs, example=name)
7070

7171

72-
def run_seccompiler_bin(bpf_path, json_path=defs.SECCOMP_JSON_DIR, basic=False):
72+
def run_seccompiler_bin(
73+
bpf_path,
74+
json_path=defs.SECCOMP_JSON_DIR,
75+
basic=False,
76+
binary_dir=DEFAULT_BINARY_DIR,
77+
):
7378
"""
7479
Run seccompiler-bin.
7580
@@ -85,7 +90,7 @@ def run_seccompiler_bin(bpf_path, json_path=defs.SECCOMP_JSON_DIR, basic=False):
8590
if basic:
8691
seccompiler_args += " --basic"
8792

88-
seccompiler = get_binary("seccompiler-bin")
93+
seccompiler = get_binary("seccompiler-bin", binary_dir=binary_dir)
8994
utils.check_output(f"{seccompiler} {seccompiler_args}")
9095

9196

tests/integration_tests/performance/test_process_startup_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _test_startup_time(microvm, metrics, test_suffix: str):
8181
def _custom_filter_setup(test_microvm):
8282
bpf_path = os.path.join(test_microvm.path, "bpf.out")
8383

84-
run_seccompiler_bin(bpf_path)
84+
run_seccompiler_bin(bpf_path, binary_dir=test_microvm.fc_binary_path.parent)
8585

8686
test_microvm.create_jailed_resource(bpf_path)
8787
test_microvm.jailer.extra_args.update({"seccomp-filter": "bpf.out"})

0 commit comments

Comments
 (0)