aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorEtienne Perot <eperot@google.com>2024-07-12 20:22:54 -0700
committerAndrei Vagin <avagin@google.com>2024-07-16 01:04:06 +0000
commitb66b37bddfae6c25ab8146aae081e25ed554eafd (patch)
tree7ed0a290dcd68e38dbdb06f1ad7c584777caf97d /tools
parent1b8d04d0f39d8a579d6797de8364c0b3c0614b0a (diff)
vm/gvisor: smoke test script: allow specifying gVisor path as env var
The gVisor smoke test script now accepts the `GVISOR_VMLINUX_PATH` environment variable. When set and non-empty, it will use this path to find the `runsc` runtime, rather than downloading it from the Internet. The intent is to use this as part of the gVisor testing pipeline using a locally-built version of the gVisor runtime (`runsc`).
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gvisor-smoke-test.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/gvisor-smoke-test.sh b/tools/gvisor-smoke-test.sh
index fdc75f64a..48f18da3c 100755
--- a/tools/gvisor-smoke-test.sh
+++ b/tools/gvisor-smoke-test.sh
@@ -2,7 +2,7 @@
# Copyright 2024 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-set -xe -o pipefail
+set -xeuo pipefail
workdir="$(mktemp -d /tmp/syzkaller-gvisor-test.XXXXXX)"
@@ -32,10 +32,14 @@ cat > "$workdir/config" <<EOF
}
EOF
-arch="$(uname -m)"
-url="https://storage.googleapis.com/gvisor/releases/release/latest/${arch}"
mkdir "$workdir/kernel"
-curl --output "$workdir/kernel/vmlinux" "${url}/runsc"
-chmod a+rx "$workdir/kernel/vmlinux"
+if [[ -z "${GVISOR_VMLINUX_PATH:-}" ]]; then
+ arch="$(uname -m)"
+ url="https://storage.googleapis.com/gvisor/releases/release/latest/${arch}"
+ curl --output "$workdir/kernel/vmlinux" "${url}/runsc"
+ chmod a+rx "$workdir/kernel/vmlinux"
+else
+ install -m555 "$GVISOR_VMLINUX_PATH" "$workdir/kernel/vmlinux"
+fi
sudo -E ./bin/syz-manager -config "$workdir/config" --mode smoke-test