Skip to content

Commit 60633bb

Browse files
committed
fix(test): do not override Firecracker binary
test_redundant_seccomp_rules builds the Firecracker binary using the nightly toolchain (we need this to be able to run its static analysis). This replaces the binary used by all subsequent tests and it causes them to fail since nightly might introduce a system call that is not allowed by our seccomp rules. In order to avoid such situations, build the binary used by the test in a different build directory. Signed-off-by: Babis Chalios <[email protected]>
1 parent d569ff3 commit 60633bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/integration_tests/build/test_seccomp_no_redundant_rules.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
load_seccomp_rules,
1414
)
1515

16+
# Make sure we don't override the Firecracker binary used from other tests
17+
TMP_BUILD_DIR = "../redundant_seccomp_rules_build"
18+
1619

1720
def test_redundant_seccomp_rules():
1821
"""Test that fails if static analysis determines redundant seccomp rules"""
@@ -24,11 +27,11 @@ def test_redundant_seccomp_rules():
2427
target = f"{arch}-unknown-linux-musl"
2528

2629
utils.check_output(
27-
f'RUSTFLAGS="-C relocation-model=static -C link-args=-no-pie" cargo +{nightly_toolchain} -Zbuild-std=panic_abort,std build --release --target {target} -p firecracker'
30+
f'CARGO_TARGET_DIR={TMP_BUILD_DIR} RUSTFLAGS="-C relocation-model=static -C link-args=-no-pie" cargo +{nightly_toolchain} -Zbuild-std=panic_abort,std build --release --target {target} -p firecracker'
2831
)
2932

3033
found_syscalls = find_syscalls_in_binary(
31-
Path(f"../build/cargo_target/{target}/release/firecracker")
34+
Path(f"{TMP_BUILD_DIR}/{target}/release/firecracker")
3235
)
3336

3437
seccomp_rules = load_seccomp_rules(Path(f"../resources/seccomp/{target}.json"))

0 commit comments

Comments
 (0)