From 7a66f70b5b66573dad4be467294e06b76f3f932a Mon Sep 17 00:00:00 2001 From: Samuel Karp Date: Fri, 23 Sep 2022 13:14:31 -0700 Subject: [PATCH] cri-integration: pass ENABLE_CRI_SANDBOXES to test ENABLE_CRI_SANDBOXES is already passed to the daemon, but was not passed to the tests prior to this commit. Passing ENABLE_CRI_SANDBOXES to the tests allows tests to be skipped if they're not appropriate for sbserver (or the functionality hasn't been implemented in sbserver yet). Signed-off-by: Samuel Karp --- script/test/cri-integration.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/script/test/cri-integration.sh b/script/test/cri-integration.sh index 76cd738f0..5835d53d7 100755 --- a/script/test/cri-integration.sh +++ b/script/test/cri-integration.sh @@ -42,7 +42,17 @@ mkdir -p "${REPORT_DIR}" test_setup "${REPORT_DIR}" # Run integration test. -${sudo} bin/cri-integration.test --test.run="${FOCUS}" --test.v \ +CMD="" +if [ -n "${sudo}" ]; then + CMD+="${sudo} " + # sudo strips environment variables, so add ENABLE_CRI_SANDBOXES back if present + if [ -n "${ENABLE_CRI_SANDBOXES}" ]; then + CMD+="ENABLE_CRI_SANDBOXES='${ENABLE_CRI_SANDBOXES}' " + fi +fi +CMD+="${PWD}/bin/cri-integration.test" + +${CMD} --test.run="${FOCUS}" --test.v \ --cri-endpoint="${CONTAINERD_SOCK}" \ --cri-root="${CRI_ROOT}" \ --runtime-handler="${RUNTIME}" \