blob: 2232b467fbc0cebc6c0fc20689d83ca874a040dc [file] [log] [blame]
From 3f13aaec087a539f0b3d92b8e910d07cb34cac81 Mon Sep 17 00:00:00 2001
From: Nandhini Rengaraj <nrengaraj@google.com>
Date: Wed, 12 Apr 2023 19:57:27 +0000
Subject: [PATCH] Disable gcc and use test binaries compiled during build time
We don't package gcc in the COS test image. These tests require test
files to be compiled and placed into the runc bundle inside the workdir
created when the tests are run. We will be compiling these test files
from the autotest setup() during build time and moving them to the
appropriate locations during test run time.
---
tests/integration/dev.bats | 3 ++-
tests/integration/seccomp.bats | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/integration/dev.bats b/tests/integration/dev.bats
index 24331571..3b90fd36 100644
--- a/tests/integration/dev.bats
+++ b/tests/integration/dev.bats
@@ -96,7 +96,8 @@ function teardown() {
# test access
TEST_NAME="dev_access_test"
- gcc -static -o "rootfs/bin/${TEST_NAME}" "${TESTDATA}/${TEST_NAME}.c"
+ # gcc -static -o "rootfs/bin/${TEST_NAME}" "${TESTDATA}/${TEST_NAME}.c"
+ cp "${TESTDATA}/${TEST_NAME}" rootfs/bin
runc exec test_allow_char sh -c "${TEST_NAME} /dev/kmsg"
[ "$status" -eq 0 ]
}
diff --git a/tests/integration/seccomp.bats b/tests/integration/seccomp.bats
index e81beca3..65a4a866 100644
--- a/tests/integration/seccomp.bats
+++ b/tests/integration/seccomp.bats
@@ -14,7 +14,8 @@ function teardown() {
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"
+ # gcc -static -o rootfs/seccomp_test "${TESTDATA}/${TEST_NAME}.c"
+ cp "${TESTDATA}/seccomp_test" rootfs/
update_config ".linux.seccomp = $(<"${TESTDATA}/${TEST_NAME}.json")"
update_config '.process.args = ["/seccomp_test"]'
@@ -26,7 +27,8 @@ function teardown() {
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"
+ # gcc -static -o rootfs/seccomp_test2 "${TESTDATA}/${TEST_NAME}.c"
+ cp "${TESTDATA}/seccomp_test2" rootfs/
update_config ".linux.seccomp = $(<"${TESTDATA}/${TEST_NAME}.json")"
update_config '.process.args = ["/seccomp_test2"]'
--
2.40.0.577.gac1e443424-goog