Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubevirt: run new fuzzers #13021

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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