Skip to content

Commit

Permalink
kubevirt: run new fuzzers
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Korczynski <[email protected]>
  • Loading branch information
AdamKorcz committed Feb 8, 2025
1 parent d5c0688 commit 4cde946
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion projects/kubevirt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
FROM gcr.io/oss-fuzz-base/base-builder-go
RUN apt update && apt install -y qemu-kvm libvirt-daemon-system
RUN git clone --depth 1 https://github.com/kubevirt/kubevirt
RUN git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=include-all-test-files
RUN git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=november-backup
RUN git clone --depth=1 https://github.com/AdamKorcz/kubevirt --branch=fuzz1 $SRC/kubevirt-fuzz1
RUN git clone --depth=1 https://github.com/AdamKorcz/kubevirt --branch=fuzz2 $SRC/kubevirt-fuzz2
RUN git clone --depth=1 https://github.com/AdamKorcz/kubevirt --branch=fuzz3 $SRC/kubevirt-fuzz3
RUN git clone --depth=1 https://github.com/AdamKorcz/kubevirt --branch=fuzz4 $SRC/kubevirt-fuzz4
COPY build.sh fuzz*test.go $SRC/
WORKDIR $SRC/kubevirt
13 changes: 13 additions & 0 deletions projects/kubevirt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ go build .
mv go-118-fuzz-build /root/go/bin/
cd "$SRC"/kubevirt

cp $SRC/kubevirt-fuzz1/pkg/virt-operator/resource/apply/fuzz_test.go $SRC/kubevirt/pkg/virt-operator/resource/apply/
cp $SRC/kubevirt-fuzz2/pkg/virt-controller/watch/clone/fuzz_test.go $SRC/kubevirt/pkg/virt-controller/watch/clone/
cp $SRC/kubevirt-fuzz3/pkg/virt-controller/watch/vm/fuzz_test.go $SRC/kubevirt/pkg/virt-controller/watch/vm/
cp $SRC/kubevirt-fuzz3/pkg/virt-controller/watch/vmi/fuzz_test.go $SRC/kubevirt/pkg/virt-controller/watch/vmi/
cp $SRC/kubevirt-fuzz4/pkg/virt-controller/watch/node/fuzz_test.go $SRC/kubevirt/pkg/virt-controller/watch/node/

printf "package webhooks\nimport _ \"github.com/AdamKorcz/go-118-fuzz-build/testing\"\n" > pkg/util/webhooks/register_fuzz_dep.go
go mod tidy
go mod vendor
go mod edit -replace github.com/AdamKorcz/go-118-fuzz-build="$SRC"/go-118-fuzz-build
go mod tidy
go mod vendor

compile_native_go_fuzzer kubevirt.io/kubevirt/pkg/virt-controller/watch/node FuzzExecute FuzzNodeWatchExecute
exit 0
compile_native_go_fuzzer kubevirt.io/kubevirt/pkg/virt-controller/watch/vm FuzzExecute FuzzVMWatchExecute
compile_native_go_fuzzer kubevirt.io/kubevirt/pkg/virt-controller/watch/vmi FuzzExecute FuzzVMIWatchExecute
compile_native_go_fuzzer kubevirt.io/kubevirt/pkg/virt-controller/watch/clone FuzzVMCloneController FuzzVMCloneController
compile_native_go_fuzzer kubevirt.io/kubevirt/pkg/virt-operator/resource/apply FuzzReconciler FuzzVirtOperatorResApplyReconciler

mv $SRC/fuzz_test.go ./pkg/certificates/triple/cert/
compile_native_go_fuzzer kubevirt.io/kubevirt/pkg/certificates/triple/cert FuzzKeyParsers FuzzKeyParsers

Expand Down

0 comments on commit 4cde946

Please sign in to comment.