From 0c147648f7642d058b63fbe2ddd5de31c2326304 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 11 Jun 2018 08:32:40 +0200 Subject: [PATCH] added CI job for AFL fuzzer tests --- .gitlab-ci.yml | 25 +++++++++++++++++++ .../mdns/test_afl_fuzz_host/esp32_compat.h | 1 + 2 files changed, 26 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a44f5bd7..c58daaa4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -305,6 +305,31 @@ test_fatfs_on_host: - cd components/fatfs/test_fatfs_host/ - make test +test_mdns_fuzzer_on_host: + stage: host_test + image: $CI_DOCKER_REGISTRY/afl-fuzzer-test$BOT_DOCKER_IMAGE_TAG + tags: + - host_test + dependencies: [] + artifacts: + when: always + paths: + - components/mdns/test_afl_fuzz_host/out/crashes + expire_in: 1 mos + only: + # can only be triggered + - triggers + variables: + BOT_NEEDS_TRIGGER_BY_NAME: 1 + script: + - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1 + - cd components/mdns/test_afl_fuzz_host/ + # run AFL fuzzer for one hour + - ( make fuzz || pkill sleep ) & + - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz + # check no crashes found + - "[ -z `ls out/crashes/` ] || exit 1" + test_spiffs_on_host: <<: *host_test_template tags: diff --git a/components/mdns/test_afl_fuzz_host/esp32_compat.h b/components/mdns/test_afl_fuzz_host/esp32_compat.h index 402807c4f..7a662607c 100644 --- a/components/mdns/test_afl_fuzz_host/esp32_compat.h +++ b/components/mdns/test_afl_fuzz_host/esp32_compat.h @@ -34,6 +34,7 @@ #include #include +#define CONFIG_MDNS_MAX_SERVICES 25 #define ERR_OK 0 #define ESP_OK 0