diff options
| author | Andrei Vagin <avagin@google.com> | 2024-07-04 00:55:08 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-07-08 06:39:50 +0000 |
| commit | 7ca8bbea5b1d25d89927d7b017d7f7da4ab226a7 (patch) | |
| tree | 4f36913f3a146462b82053e4a233fbce9069ffd9 /tools | |
| parent | eb4d8036c1b6035539881d798dd7e557b4a7d78f (diff) | |
vm/gvisor: add gvisor presubmit test
Download the latest gvisor release and run the syz-manager smoke-test
suite.
Signed-off-by: Andrei Vagin <avagin@google.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/gvisor-smoke-test.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/gvisor-smoke-test.sh b/tools/gvisor-smoke-test.sh new file mode 100755 index 000000000..fdc75f64a --- /dev/null +++ b/tools/gvisor-smoke-test.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# 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 + +workdir="$(mktemp -d /tmp/syzkaller-gvisor-test.XXXXXX)" + +cleanup() { + sudo -E rm -rf "$workdir" +} + +trap cleanup EXIT + +syzdir="$(pwd)" +cat > "$workdir/config" <<EOF +{ + "name": "gvisor", + "target": "linux/amd64", + "http": ":54321", + "workdir": "/$workdir/workdir/", + "image": "$workdir/kernel/vmlinux", + "kernel_obj": "$workdir/kernel/", + "syzkaller": "$syzdir", + "cover": false, + "procs": 1, + "type": "gvisor", + "vm": { + "count": 1, + "runsc_args": "--ignore-cgroups --network none" + } +} +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" + +sudo -E ./bin/syz-manager -config "$workdir/config" --mode smoke-test |
