forked from lxc/lxc
-
Notifications
You must be signed in to change notification settings - Fork 7
177 lines (158 loc) · 4.96 KB
/
Copy pathtests.yml
File metadata and controls
177 lines (158 loc) · 4.96 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Tests
on:
- push
- pull_request
permissions:
contents: read
jobs:
code-tests:
name: Code
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq coccinelle
- name: Confirm coccinelle output is clean
run: |
./coccinelle/run-coccinelle.sh -i
git diff --exit-code
- name: Confirm apparmor profile is up to date
run: |
cd config/apparmor/
./lxc-generate-aa-rules.py container-rules.base > container-rules
cat abstractions/container-base.in container-rules > abstractions/container-base
git diff --exit-code
testsuite:
name: Test suite
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
os:
- ubuntu-22.04
- ubuntu-24.04
- ubuntu-22.04-arm
- ubuntu-24.04-arm
async-api:
- epoll
- io_uring
variant:
- default
- sanitizer
exclude:
- variant: sanitizer
compiler: gcc
- variant: sanitizer
os: ubuntu-22.04-arm
- variant: sanitizer
os: ubuntu-24.04-arm
- async-api: io_uring
os: ubuntu-22.04-arm
- async-api: io_uring
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq \
${{ matrix.compiler }} \
meson \
pkg-config \
uuid-runtime \
docbook2x \
linux-libc-dev \
llvm \
libapparmor-dev \
libcap-dev \
libdbus-1-dev \
libpam0g-dev \
libseccomp-dev \
libselinux1-dev \
liburing-dev
- name: Compiler version
env:
CC: ${{ matrix.compiler }}
run: |
${CC} --version
- name: Build
env:
CC: ${{ matrix.compiler }}
run: |
# Landlock support
landlock=false
if [ -e /usr/include/linux/landlock.h ]; then
landlock=true
fi
# Standard build
if [ "${{ matrix.variant }}" = "default" ]; then
meson setup build \
-Dprefix=/usr \
-Dio-uring-event-loop=${{ matrix.async-api == 'io_uring' }} \
-Dtests=true \
-Dpam-cgroup=true \
-Dtools-multicall=true \
-Dlandlock-monitor=${landlock} \
-Dwerror=true \
-Db_lto_mode=default
elif [ "${{ matrix.variant }}" = "sanitizer" ]; then
meson setup build \
-Dprefix=/usr \
-Dio-uring-event-loop=${{ matrix.async-api == 'io_uring' }} \
-Dtests=true \
-Dpam-cgroup=true \
-Dtools-multicall=true \
-Dwerror=true \
-Db_lto_mode=default \
-Db_lundef=false \
-Db_sanitize=address,undefined
fi
meson compile -C build
- name: Remove existing installation
run: |
sudo apt-get remove --purge -qq \
liblxc1 \
liblxc-common \
liblxc-dev \
lxc-utils
- name: Install dependencies
run: |
sudo apt-get install --purge -qq \
apparmor \
acl \
busybox-static \
dnsmasq-base \
iptables \
rsync \
uidmap
- name: Test
env:
CC: ${{ matrix.compiler }}
run: |
# Install LXC on the system
sudo meson install -C build
if [ "${{ matrix.variant }}" = "sanitizer" ]; then
# Set sanitizer configuration
export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:strict_string_checks=1:detect_odr_violation=0"
export UBSAN_OPTIONS="print_stacktrace=1:print_summary=1:halt_on_error=1"
# Disable problematic tests
sudo rm /usr/bin/lxc-test-concurrent
sudo rm /usr/bin/lxc-test-share-ns
fi
# Bring up systemd units
sudo sed -i 's/USE_LXC_BRIDGE="false"/USE_LXC_BRIDGE="true"/' /etc/default/lxc
sudo systemctl daemon-reload
sudo systemctl restart apparmor
sudo systemctl restart lxc-net
# Undo default ACLs from Github
sudo setfacl -b -R /home
# Run the testsuite
git clone --depth=1 https://github.com/lxc/lxc-ci
sudo -E lxc-ci/deps/lxc-exercise