aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-06-07 13:41:46 +0200
committerTaras Madan <tarasmadan@google.com>2024-06-07 17:06:01 +0000
commit82c05ab8ae0b7da9a799b45753b4b14f3369d790 (patch)
treeab07dacbfe9ce85d173503dac8dc0d7d1e577d84 /tools
parent121701b62358a454bbfdccfadfcce9bb843602d6 (diff)
tools/docker/syzbot: add run-syz-command.sh
It enables us to use CloudRun. The goal is to run syzkaller tools as a gcp job.
Diffstat (limited to 'tools')
-rw-r--r--tools/docker/syzbot/Dockerfile2
-rwxr-xr-xtools/docker/syzbot/run-syz-command.sh15
2 files changed, 17 insertions, 0 deletions
diff --git a/tools/docker/syzbot/Dockerfile b/tools/docker/syzbot/Dockerfile
index a18aa0f27..3d23642fb 100644
--- a/tools/docker/syzbot/Dockerfile
+++ b/tools/docker/syzbot/Dockerfile
@@ -69,3 +69,5 @@ RUN test "$(uname -m)" != x86_64 && exit 0 || \
# pkg/osutil uses syzkaller user for sandboxing.
RUN useradd --create-home syzkaller
RUN echo "export PS1='\n\W🤖 '" >> /root/.bashrc
+
+COPY run-syz-command.sh /run-syz-command.sh
diff --git a/tools/docker/syzbot/run-syz-command.sh b/tools/docker/syzbot/run-syz-command.sh
new file mode 100755
index 000000000..be3e77413
--- /dev/null
+++ b/tools/docker/syzbot/run-syz-command.sh
@@ -0,0 +1,15 @@
+#!/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 -e # exit on any problem
+set -o pipefail
+
+syzDir=$(mktemp -d)
+
+git clone --depth 1 --branch master --single-branch \
+ https://github.com/google/syzkaller $syzDir
+cd $syzDir
+"$@"
+cd -
+rm -rf $syzDir