Skip to content
Snippets Groups Projects
Commit 513168d5 authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

Merge branch '21-need-ubuntu22-support-revive-fuzzing' into 'master'

Resolve "need ubuntu22 support, revive fuzzing"

Closes #21

See merge request !15
parents 5e41e26b 1399afca
No related branches found
No related tags found
1 merge request!15Resolve "need ubuntu22 support, revive fuzzing"
Pipeline #18845 passed
before_script: before_script:
- "source ~gitlab-runner/cicd_support/cicd_support.shinc" - "source ~gitlab-runner/cicd_support/cicd_support.shinc"
...@@ -38,12 +37,6 @@ do-clean-ubuntu18: ...@@ -38,12 +37,6 @@ do-clean-ubuntu18:
tags: tags:
- ubuntu18 - ubuntu18
do-clean-ubuntu16:
stage: clean
script:
- ./cicd_testing/do-clean.sh
tags:
- ubuntu16
do-clean-arm32: do-clean-arm32:
stage: clean stage: clean
...@@ -90,12 +83,6 @@ do-build-ubuntu18: ...@@ -90,12 +83,6 @@ do-build-ubuntu18:
tags: tags:
- ubuntu18 - ubuntu18
do-build-ubuntu16:
stage: build
script:
- ./cicd_testing/do-build.sh
tags:
- ubuntu16
do-build-arm64: do-build-arm64:
stage: build stage: build
...@@ -143,12 +130,6 @@ do-test-ubuntu18: ...@@ -143,12 +130,6 @@ do-test-ubuntu18:
tags: tags:
- ubuntu18 - ubuntu18
do-test-ubuntu16:
stage: test
script:
- ./cicd_testing/do-test.sh
tags:
- ubuntu16
do-test-arm32: do-test-arm32:
stage: test stage: test
...@@ -173,12 +154,25 @@ do-test-centos76: ...@@ -173,12 +154,25 @@ do-test-centos76:
- centos76 - centos76
#
# Fuzz
#
fuzz:
stage: fuzz
script:
- ./cicd_testing/do-fuzz.sh
artifacts:
paths:
- artifacts
tags:
- fuzz
# #
# Deploy # Deploy
# #
do-deploy-ubuntu18: do-deploy-ubuntu22:
stage: deploy stage: deploy
script: script:
- ./cicd_testing/do-deploy.sh - ./cicd_testing/do-deploy.sh
tags: tags:
- ubuntu18 - ubuntu22
name: 'baseline afl config' name: 'baseline afl config'
fuzzing-time: '10 minutes' fuzzing-time: '10 minutes'
input-timeout: '30 seconds' input-timeout: '60 seconds'
memory-limit: '50 MB' memory-limit: '50 MB'
num-cores: 2 num-cores: 2
working-dir: /tmp/libehp-fuzzing working-dir: /tmp/libehp-fuzzing
...@@ -13,11 +13,11 @@ function main() ...@@ -13,11 +13,11 @@ function main()
cd .. cd ..
# force reinstall tools so we are always up-to-date # force reinstall tools so we are always up-to-date
yes | sudo bash -c "$(curl -fsSL allzp.pages.zephyr-software.com/turbo/cli-install.sh)" yes | sudo bash -c "$(curl -fsSL opensrc.pages.zephyr-software.com/turbo/cli-install.sh)"
sudo bash -c 'echo core >/proc/sys/kernel/core_pattern' sudo bash -c 'echo core >/proc/sys/kernel/core_pattern'
# docker run starts a container. since we started with --restart, it should come back up # docker run starts a container. since we started with --restart, it should come back up
# docker run -d --restart unless-stopped -p 55155:55155 git.zephyr-software.com:4567/allzp/turbo/turbo:latest # docker run -d --restart unless-stopped -p 55155:55155 git.zephyr-software.com:4567/opensrc/turbo/turbo:latest
# better done with boost add -q -i # better done with boost add -q -i
turbo-cli boost add libehp || true turbo-cli boost add libehp || true
...@@ -33,19 +33,22 @@ function main() ...@@ -33,19 +33,22 @@ function main()
turbo-cli fuzz --fuzz-config cicd_testing/afl.yaml --app-config cicd_testing/ehp-config.yaml --ver-id $vid turbo-cli fuzz --fuzz-config cicd_testing/afl.yaml --app-config cicd_testing/ehp-config.yaml --ver-id $vid
local report="$(turbo-cli log get report $vid)" local report="$(turbo-cli log get report $vid)"
local proj_id=$CI_PROJECT_ID
local proj_urld=$CI_PROJECT_URL
echo "The report is: " echo "The report is: "
echo "$report" | tee fail_report.yaml mkdir -p artifacts
echo "$report" | tee artifacts/fuzz_report.yaml
local declare crash_count=$(echo "$report"|shyaml get-value failing-input-count) local declare crash_count=$(echo "$report"|shyaml get-value failing-input-count)
if [[ $crash_count == 0 ]]; then if [[ $crash_count == 0 ]]; then
echo "No crashes found" echo "No crashes found"
echo "See [job details]($proj_url/-/jobs/$CI_JOB_ID), look at the artifacts for the full report."
exit 0 exit 0
else else
# upload the report. # upload the report.
local proj_id=114 #local upload_report=$(curl --request POST --header "PRIVATE-TOKEN: PXLgVFpgjmmugAiHTJzx " --form "file=@artifacts/fuzz_report.yaml" https://git.zephyr-software.com/api/v4/projects/$proj_id/uploads)
local upload_report=$(curl --request POST --header "PRIVATE-TOKEN: PXLgVFpgjmmugAiHTJzx " --form "file=@fail_report.yaml" https://git.zephyr-software.com/api/v4/projects/$proj_id/uploads)
local date=$(date) local date=$(date)
local mach=$(uname -a) local mach=$(uname -a)
local host=$(hostname) local host=$(hostname)
...@@ -60,17 +63,15 @@ Date: $date ...@@ -60,17 +63,15 @@ Date: $date
Machine details: $mach Machine details: $mach
Full crash report is available here: $md See [job details]($proj_url/-/jobs/$CI_JOB_ID), look at the artifacts for the full report.
and [pipeline details]($proj_url/pipelines/$CI_PIPELINE_ID).
See [job details](https://git.zephyr-software.com/opensrc/libehp/-/jobs/$CI_JOB_ID)
and [pipeline details](https://git.zephyr-software.com/opensrc/libehp/pipelines/$CI_PIPELINE_ID).
EOM EOM
local title="Turbo found $crash_count bugs in libEHP on $date" local title="Turbo found $crash_count bugs in libEHP on $date"
local assignee_id="$GITLAB_USER_ID" local assignee_id="$GITLAB_USER_ID"
# finally post an issue # finally post an issue
curl --request POST --data-urlencode "description=$desc" --data-urlencode "title=$title" --header "PRIVATE-TOKEN: PXLgVFpgjmmugAiHTJzx " "https://git.zephyr-software.com//api/v4/projects/$proj_id/issues?&labels=bug,turbo&assignee_ids[]=$assignee_id" # curl --request POST --data-urlencode "description=$desc" --data-urlencode "title=$title" --header "PRIVATE-TOKEN: PXLgVFpgjmmugAiHTJzx " "https://git.zephyr-software.com//api/v4/projects/$proj_id/issues?&labels=bug,turbo&assignee_ids[]=$assignee_id"
echo "$crash_count count crashes found!" echo "$crash_count count crashes found!"
exit 1 exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment