mirror of https://github.com/cbeuw/Cloak
Use gitlab fuzzing
This commit is contained in:
parent
535e187d51
commit
e4756f91c8
|
|
@ -0,0 +1,13 @@
|
||||||
|
image: golang:latest
|
||||||
|
|
||||||
|
include:
|
||||||
|
- template: Coverage-Fuzzing.gitlab-ci.yml
|
||||||
|
|
||||||
|
multiplex_fuzz:
|
||||||
|
extends: .fuzz_base
|
||||||
|
script:
|
||||||
|
- pushd internal/multiplex
|
||||||
|
- go-fuzz-build -libfuzzer -o multiplex_fuzz.a .
|
||||||
|
- clang -fsanitize=fuzzer multiplex_fuzz.a -o multiplex_fuzz
|
||||||
|
- popd
|
||||||
|
- ./gitlab-cov-fuzz run --regression=$REGRESSION -- ./internal/multiplex/multiplex_fuzz
|
||||||
25
.travis.yml
25
.travis.yml
|
|
@ -3,27 +3,8 @@ language: go
|
||||||
go:
|
go:
|
||||||
- "1.14"
|
- "1.14"
|
||||||
|
|
||||||
services:
|
script:
|
||||||
- docker
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
secure: Iidyp9e/IdH26KxE1aQfrdTLPDKQlGndfEiGXAo6Kw57DP7AXeC99c6TxQv1AGK71Qtorufvps0FVYrfTWT86OXw6ncNWaaCNDicPg1Sy/PmljqpnC/2sfkOgZ0CFOnlfL2qxUIZoNi4r6BwaKrd2cffSaq8+kCr0LPWyRTZIE8Q67LoHVEcEJcnOOp887GxIAAj8KSYpN2qu1hBS/NN6znPUxToT3az11g9Ik88Ut9iQmbwVf56+QJD+kD/RMkwhw5FmZh8fj1JaeLw6IIxmKd5g1FuAIC4lRb7fkv+zRpApFfVsPgEOk425a/g1hk5cKox5m6qRrq+REngWam3TSiDsdpsNHT+nUmAbXCXOijC59yNYffQ05DLUugChtmqdWPfCoJfWaVPH5T8Kc610thcovQmIXrJyBeGJQSwzyZvSGoreyon2klk+2Dpp2XSqN9Htwkeldy0kibCPlRO7dR12rrMP8mASda0hTqK8TV2CV2LWdDVcJHmOh6KpWP+grwSKJh6NbxdCJKjSejNp7f39DsqiW5W36AQoA4iFewjG4IwCqtdlJQMLbnZrGmLBF/c6yJ6DUnJZp4p5DcOmMGFzggEPLs8kB1f/kYJ6HBgAGlLpJ+swhUtSPKyf0jQ7Of7zsjFOrC+MTyfrxyGckPpQm1RUrj7c6jwOwasbZo=
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- stage: Build, Unit-Tests
|
|
||||||
script:
|
|
||||||
- go test -race -coverprofile=coverage.txt -coverpkg=./... -covermode=atomic ./...
|
- go test -race -coverprofile=coverage.txt -coverpkg=./... -covermode=atomic ./...
|
||||||
|
|
||||||
|
after_success:
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
||||||
- stage: Fuzz-Tests
|
|
||||||
script:
|
|
||||||
- chmod +x ./fuzzit.sh
|
|
||||||
- ./fuzzit.sh local-regression
|
|
||||||
|
|
||||||
- stage: Fuzzit (Fuzzing)
|
|
||||||
if: branch = master AND type IN (push)
|
|
||||||
script:
|
|
||||||
- chmod +x ./fuzzit.sh
|
|
||||||
- ./fuzzit.sh fuzzing
|
|
||||||
|
|
|
||||||
29
fuzzit.sh
29
fuzzit.sh
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
## Build fuzzing targets
|
|
||||||
## go-fuzz doesn't support modules for now, so ensure we do everything
|
|
||||||
## in the old style GOPATH way
|
|
||||||
export GO111MODULE="off"
|
|
||||||
|
|
||||||
## Install go-fuzz
|
|
||||||
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
|
|
||||||
|
|
||||||
# download dependencies into ${GOPATH}
|
|
||||||
# -d : only download (don't install)f
|
|
||||||
# -v : verbose
|
|
||||||
# -u : use the latest version
|
|
||||||
# will be different if you use vendoring or a dependency manager
|
|
||||||
# like godep
|
|
||||||
go get -d -v -u ./...
|
|
||||||
|
|
||||||
cd internal/multiplex
|
|
||||||
go-fuzz-build -libfuzzer -o multiplex.a .
|
|
||||||
clang -fsanitize=fuzzer multiplex.a -o cloak-multiplex
|
|
||||||
|
|
||||||
## Install fuzzit latest version:
|
|
||||||
wget -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_Linux_x86_64
|
|
||||||
chmod a+x fuzzit
|
|
||||||
|
|
||||||
## upload fuzz target for long fuzz testing on fuzzit.dev server or run locally for regression
|
|
||||||
./fuzzit create job --type ${1} cbeuw/cloak-multiplex cloak-multiplex
|
|
||||||
Loading…
Reference in New Issue