Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
- Loading branch information
1 parent
3547e77
commit 3113acb
Showing
3 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
with import <nixpkgs> { }; | ||
pkgs.mkShell { | ||
name = "go-fuzz"; | ||
buildInputs = [ go ]; | ||
shellHook = '' | ||
function setup() { | ||
export GOPATH=$(mktemp -d /tmp/GOPATH.XXXXXX) | ||
mkdir -p $GOPATH/src | ||
pushd $GOPATH/src | ||
go get github.com/dvyukov/go-fuzz/go-fuzz | ||
go get github.com/dvyukov/go-fuzz/go-fuzz-build | ||
popd | ||
} | ||
function teardown() { | ||
chmod -R u+w $GOPATH | ||
rm -rf $GOPATH | ||
} | ||
setup | ||
trap teardown EXIT | ||
alias fuzzbuild="$GOPATH/bin/go-fuzz-build -tags gofuzz" | ||
alias fuzzlink="$GOPATH/bin/go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzLinkMessage" | ||
alias fuzzaddress="$GOPATH/bin/go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzAddressMessage" | ||
alias fuzzroute="$GOPATH/bin/go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzRouteMessage" | ||
alias fuzzneigh="$GOPATH/bin/go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzNeighMessage" | ||
echo "Fuzz environment ready. There are 5 aliases available:" | ||
echo "" | ||
echo "fuzzbuild - will build the fuzzing file" | ||
echo "fuzzlink - will start fuzzing Link Messages" | ||
echo "fuzzaddress - will start fuzzing Address Messages" | ||
echo "fuzzroute - will start fuzzing Route Messages" | ||
echo "fuzzneigh - will start fuzzing Neigh Messages" | ||
echo "" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters