mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
c61f606254
https://github.com/opencontainers/runtime-spec/pull/1087 added support for defaultErrnoRet to the OCI runtime specs. If a defaultErrnoRet is specified, disable patching the generated libseccomp cBPF. Closes: https://github.com/opencontainers/runc/issues/2943 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
36 lines
872 B
Bash
36 lines
872 B
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
function setup() {
|
|
setup_busybox
|
|
}
|
|
|
|
function teardown() {
|
|
teardown_bundle
|
|
}
|
|
|
|
@test "runc run [seccomp -ENOSYS handling]" {
|
|
TEST_NAME="seccomp_syscall_test1"
|
|
|
|
# Compile the test binary and update the config to run it.
|
|
gcc -static -o rootfs/seccomp_test "${TESTDATA}/${TEST_NAME}.c"
|
|
update_config ".linux.seccomp = $(<"${TESTDATA}/${TEST_NAME}.json")"
|
|
update_config '.process.args = ["/seccomp_test"]'
|
|
|
|
runc run test_busybox
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "runc run [seccomp defaultErrnoRet=ENXIO]" {
|
|
TEST_NAME="seccomp_syscall_test2"
|
|
|
|
# Compile the test binary and update the config to run it.
|
|
gcc -static -o rootfs/seccomp_test2 "${TESTDATA}/${TEST_NAME}.c"
|
|
update_config ".linux.seccomp = $(<"${TESTDATA}/${TEST_NAME}.json")"
|
|
update_config '.process.args = ["/seccomp_test2"]'
|
|
|
|
runc run test_busybox
|
|
[ "$status" -eq 0 ]
|
|
}
|