Skip to content

Commit

Permalink
feat: moved fuzz test related into fuzz_test directory
Browse files Browse the repository at this point in the history
Signed-off-by: Valina Li <[email protected]>
  • Loading branch information
vli11 committed Aug 15, 2023
1 parent 4913631 commit 323adb0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ snap/.snapcraft/*
squashfs-root/

# result files
fuzz_results/*
fuzz_test/fuzz_results/*
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
#

.PHONY: build clean unittest hadolint lint test docker run sbom docker-fuzz fuzz-test
.PHONY: build clean unittest hadolint lint test docker run sbom docker-fuzz fuzz-test-command

# change the following boolean flag to include or exclude the delayed start libs for builds for most of core services except support services
INCLUDE_DELAYED_START_BUILD_CORE:="false"
Expand Down Expand Up @@ -369,8 +369,8 @@ sbom:
spdx/spdx-sbom-generator -p /edgex-go/ -o /sbom/ --include-license-text true

docker-fuzz:
docker build -f Dockerfile.fuzz -t fuzz-edgex-go:latest .
docker build -f Dockerfile.fuzz -t fuzz-edgex-go:latest -f fuzz_test/Dockerfile.fuzz .

fuzz-test:
fuzz-test-command:
# not joining the edgex-network due to swagger file url pointing to localhost for fuzz testing in the container
docker run --net host --rm -v "$$PWD/fuzz_results:/fuzz_results" fuzz-edgex-go:latest
docker run --net host --rm -v "$$PWD/fuzz_test/fuzz_results:/fuzz_results" fuzz-edgex-go:latest core-command /restler-fuzzer/openapi/core-command.yaml
12 changes: 6 additions & 6 deletions Dockerfile.fuzz → fuzz_test/Dockerfile.fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ RUN wget -q -O - https://github.com/microsoft/restler-fuzzer/archive/refs/tags/v

RUN python3 ./build-restler.py --dest_dir ./restler_bin/

COPY fuzzing_docker.sh /restler-fuzzer/fuzzing.sh
COPY fuzz_test/fuzzing_docker.sh /restler-fuzzer/fuzzing.sh
COPY /openapi/v3/* /restler-fuzzer/openapi/

ENTRYPOINT ["/restler-fuzzer/fuzzing.sh"]
# CMD core-data below only do fuzz-lean for core-data
# CMD [ "<service-name>", "<swagger-path>"] must be specified as CMD to `docker run`
# Example: CMD core-data below only do fuzz-lean for core-data
# This can take about 2 minutes to finish
# You may swap out core-data to other server to perform fuzz-lean
CMD ["core-data", "/restler-fuzzer/openapi/core-data.yaml"]
# CMD of "all" will do fuzz-lean test for core-commmand, core-data, core-metadata, support-notifications, and support-scheduler,
# docker run --net host --rm -v "$$PWD/fuzz_results:/fuzz_results" fuzz-edgex-go:latest core-data /restler-fuzzer/openapi/core-data.yaml"
# Example: CMD of "all" will do fuzz-lean test for core-commmand, core-data, core-metadata, support-notifications, and support-scheduler,
# basically all services under openapi/v3/ directory
# This can take more than 20 minutes to finish
# Comment out above CMD and uncomment below CMD of "all" to fuzz all services
# CMD ["all"]
# docker run --net host --rm -v "$$PWD/fuzz_results:/fuzz_results" fuzz-edgex-go:latest all
File renamed without changes.

0 comments on commit 323adb0

Please sign in to comment.