加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fuzzit.sh 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
Simon Pasquier 提交于 2019-09-11 09:08 . Fix fuzzit job (#6005)
#!/bin/bash
set -xe
# Go-fuzz doesn't support modules yet, 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
# Target names on fuzzit.dev
TARGETS=("promql-parse-metric" "promql-parse-open-metric" "promql-parse-metric-selector" "promql-parse-expr")
# Prometheus fuzz functions
FUZZ_FUNCTIONS=("FuzzParseMetric" "FuzzParseOpenMetric" "FuzzParseMetricSelector" "FuzzParseExpr")
# Compiling prometheus fuzz targets in fuzz.go with go-fuzz (https://github.com/dvyukov/go-fuzz) and libFuzzer support
for ((i=0;i<${#TARGETS[@]};++i));
do
go-fuzz-build -libfuzzer -func ${FUZZ_FUNCTIONS[i]} -o ${TARGETS[i]}.a ./promql
clang-9 -fsanitize=fuzzer ${TARGETS[i]}.a -o ${TARGETS[i]}
done
# Install fuzzit CLI
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.45/fuzzit_Linux_x86_64
chmod a+x fuzzit
for TARGET in "${TARGETS[@]}"
do
./fuzzit create job --type $1 prometheus/${TARGET} ${TARGET}
done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化