From 167c274dc34eed39479e9fbe66d73a47b50fde34 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 4 Jul 2024 00:55:08 +0000 Subject: [PATCH] vm/gvisor: add gvisor presubmit test Download the latest gvisor release and run the syz-manager smoke-test suite. Signed-off-by: Andrei Vagin --- .github/workflows/ci.yml | 20 +++++++++++++++++++ Makefile | 3 +++ tools/gvisor-smoke-test.sh | 39 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100755 tools/gvisor-smoke-test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48bd1078bf38..d7cec9727308 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,3 +186,23 @@ jobs: run: | cd gopath/src/github.com/google/syzkaller .github/workflows/run.sh make presubmit_old + gvisor: + runs-on: ubuntu-latest + container: + image: gcr.io/syzkaller/syzbot:latest + options: --privileged + env: + GOPATH: /__w/syzkaller/syzkaller/gopath + CI: true + TERM: dumb + GITHUB_ACTIONS: true + steps: + - name: checkout + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + path: gopath/src/github.com/google/syzkaller + - name: run + run: | + cd gopath/src/github.com/google/syzkaller + make + .github/workflows/run.sh bash -xe tools/gvisor-smoke-test.sh diff --git a/Makefile b/Makefile index 51f53a032f4d..7d6295913648 100644 --- a/Makefile +++ b/Makefile @@ -382,6 +382,9 @@ presubmit_old: descriptions TARGETARCH=mips64le TARGETVMARCH=mips64le $(MAKE) target TARGETARCH=s390x TARGETVMARCH=s390x $(MAKE) target +presubmit_gvisor: host target + ./tools/gvisor-smoke-test.sh + test: descriptions $(GO) test -short -coverprofile=.coverage.txt ./... diff --git a/tools/gvisor-smoke-test.sh b/tools/gvisor-smoke-test.sh new file mode 100755 index 000000000000..a3af36b1779b --- /dev/null +++ b/tools/gvisor-smoke-test.sh @@ -0,0 +1,39 @@ +#!/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() { + rm -rf "$workdir" +} + +trap cleanup EXIT + +syzdir="$(pwd)" +cat > "$workdir/config" <