host-test.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. .host_test_template:
  2. extends: .rules:test:host_test
  3. stage: host_test
  4. image: $ESP_ENV_IMAGE
  5. variables:
  6. PYTHON_VER: 3.6.13
  7. tags:
  8. - host_test
  9. dependencies: []
  10. needs: [] # run host_test jobs immediately
  11. test_nvs_on_host:
  12. extends: .host_test_template
  13. script:
  14. - cd components/nvs_flash/test_nvs_host
  15. - make test
  16. test_nvs_coverage:
  17. extends:
  18. - .host_test_template
  19. - .rules:labels:nvs_coverage
  20. artifacts:
  21. paths:
  22. - components/nvs_flash/test_nvs_host/coverage_report
  23. expire_in: 1 week
  24. script:
  25. - cd components/nvs_flash/test_nvs_host
  26. - make coverage_report
  27. # the 'long' host tests take approx 11 hours on our current runners. Adding some margin here for possible CPU contention
  28. timeout: 18 hours
  29. test_partition_table_on_host:
  30. extends: .host_test_template
  31. tags:
  32. - build
  33. script:
  34. - cd components/partition_table/test_gen_esp32part_host
  35. - ./gen_esp32part_tests.py
  36. test_wl_on_host:
  37. extends: .host_test_template
  38. artifacts:
  39. paths:
  40. - components/wear_levelling/test_wl_host/coverage_report.zip
  41. expire_in: 1 week
  42. script:
  43. - cd components/wear_levelling/test_wl_host
  44. - make test
  45. test_fatfs_on_host:
  46. extends: .host_test_template
  47. script:
  48. - cd components/fatfs/test_fatfs_host/
  49. - make test
  50. test_ldgen_on_host:
  51. extends: .host_test_template
  52. script:
  53. - cd tools/ldgen/test
  54. - ./test_fragments.py
  55. - ./test_generation.py
  56. - ./test_entity.py
  57. - ./test_output_commands.py
  58. variables:
  59. LC_ALL: C.UTF-8
  60. .host_fuzzer_test_template:
  61. extends:
  62. - .host_test_template
  63. - .rules:labels:fuzzer_test-weekend_test
  64. image: $AFL_FUZZER_TEST_IMAGE
  65. artifacts:
  66. when: always
  67. paths:
  68. - ${FUZZER_TEST_DIR}/out/crashes
  69. - ${FUZZER_TEST_DIR}/fuzz_output.log
  70. expire_in: 1 week
  71. script:
  72. - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
  73. - cd ${FUZZER_TEST_DIR}
  74. # run AFL fuzzer for one hour
  75. - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
  76. - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
  77. # check no crashes found
  78. - test -z "$(ls out/crashes/)" || exit 1
  79. test_mdns_fuzzer_on_host:
  80. extends: .host_fuzzer_test_template
  81. variables:
  82. FUZZER_TEST_DIR: components/mdns/test_afl_fuzz_host
  83. test_lwip_dns_fuzzer_on_host:
  84. extends: .host_fuzzer_test_template
  85. variables:
  86. FUZZER_TEST_DIR: components/lwip/test_afl_host
  87. FUZZER_PARAMS: MODE=dns
  88. test_lwip_dhcp_fuzzer_on_host:
  89. extends: .host_fuzzer_test_template
  90. variables:
  91. FUZZER_TEST_DIR: components/lwip/test_afl_host
  92. FUZZER_PARAMS: MODE=dhcp_client
  93. test_lwip_dhcps_fuzzer_on_host:
  94. extends: .host_fuzzer_test_template
  95. variables:
  96. FUZZER_TEST_DIR: components/lwip/test_afl_host
  97. FUZZER_PARAMS: MODE=dhcp_server
  98. test_spiffs_on_host:
  99. extends: .host_test_template
  100. script:
  101. - cd components/spiffs/test_spiffs_host/
  102. - make test
  103. - cd ../test_spiffsgen
  104. - ./test_spiffsgen.py
  105. test_multi_heap_on_host:
  106. extends: .host_test_template
  107. script:
  108. - cd components/heap/test_multi_heap_host
  109. - ./test_all_configs.sh
  110. test_certificate_bundle_on_host:
  111. extends: .host_test_template
  112. tags:
  113. - build
  114. script:
  115. - cd components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/
  116. - ./test_gen_crt_bundle.py
  117. test_confserver:
  118. extends: .host_test_template
  119. script:
  120. - cd tools/kconfig_new/test/confserver
  121. - ./test_confserver.py
  122. test_gen_kconfig_doc:
  123. extends: .host_test_template
  124. script:
  125. - cd tools/kconfig_new/test/gen_kconfig_doc/
  126. - ./test_target_visibility.py
  127. - ./test_kconfig_out.py
  128. test_confgen:
  129. extends: .host_test_template
  130. script:
  131. - cd tools/kconfig_new/test/confgen/
  132. - ./test_confgen.py
  133. test_idf_monitor:
  134. extends: .host_test_template
  135. artifacts:
  136. # save artifacts always in order to access results which were retried without consequent failure
  137. when: always
  138. paths:
  139. - tools/test_idf_monitor/outputs/*
  140. expire_in: 1 week
  141. script:
  142. - cd ${IDF_PATH}/tools/test_idf_monitor
  143. - ./run_test_idf_monitor.py
  144. test_idf_size:
  145. extends: .host_test_template
  146. artifacts:
  147. when: on_failure
  148. paths:
  149. - tools/test_idf_size/output
  150. - tools/test_idf_size/.coverage
  151. expire_in: 1 week
  152. script:
  153. - cd ${IDF_PATH}/tools/test_idf_size
  154. - ./test.sh
  155. test_idf_py:
  156. extends: .host_test_template
  157. variables:
  158. LC_ALL: C.UTF-8
  159. script:
  160. - cd ${IDF_PATH}/tools/test_idf_py
  161. - ./test_idf_py.py
  162. test_idf_tools:
  163. extends: .host_test_template
  164. artifacts:
  165. when: on_failure
  166. paths:
  167. - tools/tools.new.json
  168. expire_in: 1 week
  169. script:
  170. # Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
  171. - export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})
  172. - cd ${IDF_PATH}/tools/test_idf_tools
  173. - ./test_idf_tools.py
  174. # Test for create virtualenv. It must be invoked from Python, not from virtualenv.
  175. - cd ${IDF_PATH}/tools
  176. - python3 ./idf_tools.py install-python-env
  177. .test_efuse_table_on_host_template:
  178. extends: .host_test_template
  179. variables:
  180. IDF_TARGET: "esp32"
  181. artifacts:
  182. when: on_failure
  183. paths:
  184. - components/efuse/${IDF_TARGET}/esp_efuse_table.c
  185. expire_in: 1 week
  186. script:
  187. - cd ${IDF_PATH}/components/efuse/
  188. - ./efuse_table_gen.py -t "${IDF_TARGET}" ${IDF_PATH}/components/efuse/${IDF_TARGET}/esp_efuse_table.csv
  189. - git diff --exit-code -- ${IDF_TARGET}/esp_efuse_table.c || { echo 'Differences found for ${IDF_TARGET} target. Please run make efuse_common_table or idf.py efuse-common-table and commit the changes.'; exit 1; }
  190. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  191. - ./efuse_tests.py
  192. test_efuse_table_on_host_esp32:
  193. extends: .test_efuse_table_on_host_template
  194. test_efuse_table_on_host_esp32s2:
  195. extends: .test_efuse_table_on_host_template
  196. variables:
  197. IDF_TARGET: esp32s2
  198. test_efuse_table_on_host_esp32s3:
  199. extends: .test_efuse_table_on_host_template
  200. variables:
  201. IDF_TARGET: esp32s3
  202. test_efuse_table_on_host_esp32c3:
  203. extends: .test_efuse_table_on_host_template
  204. variables:
  205. IDF_TARGET: esp32c3
  206. test_efuse_table_on_host_esp32h2:
  207. extends: .test_efuse_table_on_host_template
  208. variables:
  209. IDF_TARGET: esp32h2
  210. test_espcoredump:
  211. extends: .host_test_template
  212. artifacts:
  213. when: always
  214. paths:
  215. - components/espcoredump/test/**/.coverage
  216. - components/espcoredump/test/**/output
  217. expire_in: 1 week
  218. variables:
  219. IDF_COREDUMP_ELF_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/idf-coredump-elf.git"
  220. IDF_COREDUMP_ELF_TAG: idf-20210915
  221. # install CMake version specified in tools.json
  222. SETUP_TOOLS_LIST: "all"
  223. script:
  224. - retry_failed git clone ${IDF_COREDUMP_ELF_REPO} -b $IDF_COREDUMP_ELF_TAG
  225. - cd ${IDF_PATH}/components/espcoredump/test/
  226. - ./test_espcoredump.sh ${CI_PROJECT_DIR}/idf-coredump-elf
  227. test_logtrace_proc:
  228. extends: .host_test_template
  229. artifacts:
  230. when: on_failure
  231. paths:
  232. - tools/esp_app_trace/test/logtrace/output
  233. - tools/esp_app_trace/test/logtrace/.coverage
  234. expire_in: 1 week
  235. script:
  236. - cd ${IDF_PATH}/tools/esp_app_trace/test/logtrace
  237. - ./test.sh
  238. test_sysviewtrace_proc:
  239. extends: .host_test_template
  240. artifacts:
  241. when: on_failure
  242. paths:
  243. - tools/esp_app_trace/test/sysview/output
  244. - tools/esp_app_trace/test/sysview/.coverage
  245. expire_in: 1 week
  246. script:
  247. - cd ${IDF_PATH}/tools/esp_app_trace/test/sysview
  248. - ./test.sh
  249. test_mkdfu:
  250. extends: .host_test_template
  251. variables:
  252. LC_ALL: C.UTF-8
  253. script:
  254. - cd ${IDF_PATH}/tools/test_mkdfu
  255. - ./test_mkdfu.py
  256. test_mkuf2:
  257. extends: .host_test_template
  258. script:
  259. - cd ${IDF_PATH}/tools/test_mkuf2
  260. - ./test_mkuf2.py
  261. test_autocomplete:
  262. extends: .host_test_template
  263. image: $CI_DOCKER_REGISTRY/linux-shells:1
  264. artifacts:
  265. when: on_failure
  266. paths:
  267. - ${IDF_PATH}/*.out
  268. expire_in: 1 week
  269. script:
  270. - ${IDF_PATH}/tools/ci/test_autocomplete.py
  271. test_detect_python:
  272. extends: .host_test_template
  273. image: $CI_DOCKER_REGISTRY/linux-shells:1
  274. script:
  275. - cd ${IDF_PATH}
  276. - shellcheck -s sh tools/detect_python.sh
  277. - shellcheck -s bash tools/detect_python.sh
  278. - shellcheck -s dash tools/detect_python.sh
  279. - "bash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  280. - "dash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  281. - "zsh -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  282. - "fish -c 'source tools/detect_python.fish && echo Our Python: $ESP_PYTHON'"
  283. test_nvs_page:
  284. extends: .host_test_template
  285. script:
  286. - cd ${IDF_PATH}/components/nvs_flash/host_test/nvs_page_test
  287. - idf.py build
  288. - build/test_nvs_page_host.elf
  289. test_log:
  290. extends: .host_test_template
  291. script:
  292. - cd ${IDF_PATH}/components/log/host_test/log_test
  293. - idf.py build
  294. - build/test_log_host.elf
  295. test_esp_event:
  296. extends: .host_test_template
  297. script:
  298. - cd ${IDF_PATH}/components/esp_event/host_test/esp_event_unit_test
  299. - idf.py build
  300. - build/test_esp_event_host.elf
  301. test_esp_timer_cxx:
  302. extends: .host_test_template
  303. script:
  304. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/esp_timer
  305. - idf.py build
  306. - build/test_esp_timer_cxx_host.elf
  307. test_eh_frame_parser:
  308. extends: .host_test_template
  309. script:
  310. - cd ${IDF_PATH}/components/esp_system/test_eh_frame_parser
  311. - make
  312. - ./eh_frame_test
  313. test_rom_on_linux_works:
  314. extends: .host_test_template
  315. script:
  316. - cd ${IDF_PATH}/components/esp_rom/host_test/rom_test
  317. - idf.py build
  318. - build/test_rom_host.elf
  319. test_cxx_gpio:
  320. extends: .host_test_template
  321. script:
  322. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/gpio
  323. - idf.py build
  324. - build/test_gpio_cxx_host.elf
  325. test_linux_example:
  326. extends: .host_test_template
  327. script:
  328. - cd ${IDF_PATH}/examples/build_system/cmake/linux_host_app
  329. - idf.py build
  330. - timeout 5 ./build/linux_host_app.elf >test.log || true
  331. - grep "Restarting" test.log