1
0
mirror of https://github.com/containers/youki synced 2025-10-09 15:14:56 +02:00
youki/tests/runc/runc_integration_test.sh
Yusuke 83bdc3eb91 setup runc integration test
Signed-off-by: Yusuke Sakurai <yusuke.sakurai@3-shake.com>
2025-08-24 06:26:30 +00:00

31 lines
840 B
Bash
Executable File

#!/bin/bash -u
RUNTIME=${1:-./youki}
ROOT=$(git rev-parse --show-toplevel)
RUNC_DIR="${ROOT}/tests/runc/src/github.com/opencontainers/runc"
PATTERN_FILE="${ROOT}/${2:-tests/runc/runc_test_pattern}"
if [[ ! -x "$RUNTIME" ]]; then
echo "$RUNTIME binary not found"
exit 1
fi
cp "$RUNTIME" "$RUNC_DIR/runc"
chmod +x "$RUNC_DIR/runc"
cd "$RUNC_DIR"
sudo make test-binaries
readarray -t TEST_NAMES < "$PATTERN_FILE"
for name in "${TEST_NAMES[@]}"; do
if [[ $name =~ ^\[skip\] ]]; then
echo "skip: $name"
continue
fi
# escape [](){}+?*.,'
TEST_CASE=$(echo "$name" | sed 's/\\/\\\\/g; s/\[/\\[/g; s/\]/\\]/g; s/(/\\(/g; s/)/\\)/g; s/+/\\+/g; s/?/\\?/g; s/*/\\*/g; s/\./\\./g; s/{/\\{/g; s/}/\\}/g; s/,/\\,/g;')
echo $TEST_CASE
sudo -E PATH="$PATH" script -q -e -c "bats -f \"^$TEST_CASE$\" -t tests/integration"
done