-
Notifications
You must be signed in to change notification settings - Fork 1
/
.cirrus.yml
124 lines (116 loc) · 4.27 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
task:
name: FreeBSD
freebsd_instance:
matrix:
- image_family: freebsd-14-0-snap
# - image_family: freebsd-13-1 # currently not working
cmake_dependencies_cache:
# cache CMake dependencies
folder: ./build/dl
fingerprint_script:
- echo $CIRRUS_OS
# lib/*.cmake files contains the dependencies that we use
- cat lib/*.cmake
install_script: |
# autoconf/automake/pkgconf is required by sqlite
# bison/libtool/gettext is required by util-linux (uuid library)
pkg install -y cmake llvm git lcov autoconf automake bison libtool gettext pkgconf
install_check_version_script: |
llvm-cov gcov --version
clang --version
configure_script: |
cmake --preset freebsd -DCONFIGURE_COVERAGE=BOOL:ON
build_script: |
cmake --build --preset freebsd --parallel "$(($(sysctl -n hw.ncpu) + 1))"
env:
# list of tests that are currently failing on FreeBSD
FAILING_TESTS: test_edgesec
# disable aslr for AddressSanitizer support
test_script: |
proccontrol -m aslr -s disable \
ctest --preset freebsd --output-on-failure --output-junit junit-test-results.xml \
|| true # We look at junit XML output file for failures
check_failing_tests_script: |
# double-check that failing tests actually fail
python -c "$CHECK_FAILING_TESTS" ./build/freebsd/junit-test-results.xml
# test_with_coverage_script: |
# cmake --build --preset freebsd --parallel "$(($(sysctl -n hw.ncpu) + 1))" --target coverage
# uploading coverage is currently a bit difficult
# since the codecoverage uploader doesn't yet support FreeBSD
# Docker config.json that has read access to aloisklink's Docker container
registry_config: ENCRYPTED[5a6b9031edaf3284bf98b4510a3927884f65e0c223583b916c73fff30e9ccabdcede640829b0534a39ccc7916630ba36]
cheribuild_task:
name: CheriBSD (morello-purecap)
container:
image: aloisklink/cheribuild-edgesec:morello-purecap
cmake_dependencies_cache:
# cache CMake dependencies
folder: ./build/dl
fingerprint_script:
- echo "$CIRRUS_OS"
# lib/*.cmake files contains the dependencies that we use
- cat lib/*.cmake
environment:
# list of tests that are currently failing on CheriBSD
FAILING_TESTS: >-
test_edgesec
test_runctl
test_capture_service
test_header_middleware
test_sqlite_header
test_sqlite_pcap
test_os
test_eloop
test_sqliteu
test_supervisor
test_cmd_processor
test_sqlite_macconn_writer
test_hostapd
test_ap_service_failure
test_dnsmasq
test_mdns_service
build_script: |
/home/ubuntu/cheribuild/cheribuild.py "edgesec-morello-purecap" \
--edgesec/source-directory "$(pwd)" \
--skip-update
test_script: |
# could use --test-extra-args='' to pass extra stuff to
# https://github.com/CTSRD-CHERI/cheribuild/blob/main/test-scripts/run_ctest_tests.py
/home/ubuntu/cheribuild/cheribuild.py "edgesec-morello-purecap" \
--edgesec/source-directory "$(pwd)" \
--skip-update \
--run-tests \
|| true # We look at junit XML output file for failures
check_failing_tests_script: |
python3 -c "$CHECK_FAILING_TESTS" \
/home/ubuntu/cheri/build/edgesec-morello-purecap-build/test-results*.xml
environment:
# Script that loads a JUnit XML file generated from CTest,
# (generated via `ctest --output-junit <file>`)
# then checks to see if the list of failing tests is exactly the same as the
# space separated list of tests in the `FAILING_TEST` environment variable.
#
# Example:
# FAILING_TESTS='test_a test_b' python3 -c "$CHECK_FAILING_TESTS" junit-test-results.xml
CHECK_FAILING_TESTS: |
#!/usr/bin/env python3
import os
expected_failing_tests=set(
os.getenv("FAILING_TESTS").split(" ")
)
import sys
import xml.etree.ElementTree as ET
tree = ET.parse(sys.argv[1])
root = tree.getroot()
failing_tests = {
testcase.get("name")
for testcase in root.findall('testcase')
if testcase.get("status") == "fail"
}
import unittest
unittest.TestCase().assertSetEqual(
expected_failing_tests,
failing_tests,
"❌ CTest failing tests do not match expected edgesec failing tests."
)
print("✅ CTest failing tests match expected edgesec failing tests.")