forked from wolfSSL/wolfMQTT
-
Notifications
You must be signed in to change notification settings - Fork 0
256 lines (233 loc) · 8.32 KB
/
ubuntu-check.yml
File metadata and controls
256 lines (233 loc) · 8.32 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
name: Ubuntu Build Test
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 5
# Serialize across all workflows that exercise the hard-coded
# "demoDevice" MQTT client ID against AWS IoT. Parallel runs from
# different workflows (ubuntu-check, ubuntu-check-curl, this file's
# aws-ca-regression) otherwise collide on the AWS side and produce
# spurious "MQTT Connect/Subscribe: Error (Network) (-8)" failures.
concurrency:
group: wolfmqtt-awsiot-external
cancel-in-progress: false
steps:
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# Install mosquitto
sudo apt-get install -y mosquitto bubblewrap
- name: Setup mosquitto broker
run: |
# Disable default broker daemon
sudo service mosquitto stop
sleep 1
# This is some debug info useful if something goes wrong
- name: Show network status
run: |
sudo ifconfig
sudo route
sudo netstat -tulpan
- uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
path: wolfssl
- name: wolfssl autogen
working-directory: ./wolfssl
run: ./autogen.sh
- name: wolfssl configure
working-directory: ./wolfssl
run: ./configure --enable-enckeys
- name: wolfssl make
working-directory: ./wolfssl
run: make
- name: wolfssl make install
working-directory: ./wolfssl
run: sudo make install
- uses: actions/checkout@master
- name: wolfmqtt autogen
run: ./autogen.sh
- name: wolfmqtt configure
run: ./configure
- name: wolfmqtt make
run: make
# Note: this will run the external tests for this CI only
- name: wolfmqtt make check
run: make check
- name: wolfmqtt configure without TLS
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
run: ./configure --enable-all --disable-tls
- name: wolfmqtt make
run: make
- name: wolfmqtt make check
run: make check
- name: wolfmqtt configure with SN Enabled
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
run: ./configure --enable-sn
- name: wolfmqtt make
run: make
- name: wolfmqtt make check
run: make check
- name: wolfmqtt configure with Non-Block
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK"
- name: wolfmqtt make
run: make
- name: wolfmqtt make check
run: make check
- name: wolfmqtt configure with Non-Block and Multi-threading
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK"
- name: wolfmqtt make
run: make
- name: wolfmqtt make check
run: make check
- name: configure with Multi-threading and WOLFMQTT_DYN_PROP
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
run: ./configure --enable-mt CFLAGS="-DWOLFMQTT_DYN_PROP"
- name: make
run: make
- name: make check
run: make check
- name: wolfmqtt configure with Stress
env:
WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1
run: ./configure --enable-stress
- name: wolfmqtt make
run: make
- name: wolfmqtt make check
run: make check
# capture logs on failure
- name: Show logs on failure
if: failure() || cancelled()
run: |
cat test-suite.log
cat scripts/*.log
aws-ca-regression:
# Exercises examples/aws/awsiot.c trust-anchor handling in three
# configurations. Uses the real AWS IoT ATS endpoint hard-coded in
# the demo, so this job needs external network access (same as the
# `build` job's `make check`).
#
# `needs: build` serializes AWS IoT access within this workflow.
# The repo-wide `concurrency:` group below serializes against other
# workflows (e.g. ubuntu-check-curl) that also run awsiot.test
# against the same hard-coded "demoDevice" client ID. Without both,
# parallel jobs cause AWS IoT to drop connections with "MQTT
# Connect/Subscribe: Error (Network) (-8)".
needs: build
concurrency:
group: wolfmqtt-awsiot-external
cancel-in-progress: false
#
# case 1: default bundle (Amazon Root CA 1 + Starfield G2), wolfSSL
# built WITHOUT WOLFSSL_NO_ASN_STRICT. Strict ASN parsing
# drops Starfield G2 (serial=0); the verify callback's
# accept-anyway branch keeps the test passing. Expect PASS.
#
# case 2: default bundle, wolfSSL built WITH WOLFSSL_NO_ASN_STRICT.
# Full bundle loads, chain verifies cleanly, callback
# never has to mask an error. Expect PASS.
#
# case 3: legacy VeriSign G5 bundle (via
# -DWOLFMQTT_AWSIOT_LEGACY_VERISIGN_CA), wolfSSL built WITH
# WOLFSSL_NO_ASN_STRICT. The strict callback rejects the
# unanchored chain. Expect FAIL.
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y mosquitto bubblewrap
- name: Setup mosquitto broker
run: |
sudo service mosquitto stop
sleep 1
# --- case 1: wolfSSL built with DEFAULT strict ASN parsing ---
- uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
path: wolfssl
- name: wolfssl autogen (strict ASN default)
working-directory: ./wolfssl
run: ./autogen.sh
- name: wolfssl configure (strict ASN default)
working-directory: ./wolfssl
run: ./configure --enable-enckeys
- name: wolfssl make
working-directory: ./wolfssl
run: make
- name: wolfssl make install
working-directory: ./wolfssl
run: sudo make install
- uses: actions/checkout@master
- name: wolfmqtt autogen
run: ./autogen.sh
- name: case 1 - wolfmqtt configure (default bundle, strict ASN)
run: ./configure --enable-tls --enable-examples
- name: case 1 - wolfmqtt make
run: make
- name: case 1 - awsiot.test expect PASS
run: ./scripts/awsiot.test
# --- cases 2 + 3: wolfSSL rebuilt with WOLFSSL_NO_ASN_STRICT ---
# The wolfmqtt checkout above wiped the workspace, so the wolfssl
# source tree is gone even though /usr/local/lib/libwolfssl.* is
# still installed. Re-checkout to get a fresh source tree for the
# NO_ASN_STRICT rebuild.
- uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
path: wolfssl
- name: wolfssl autogen (NO_ASN_STRICT build)
working-directory: ./wolfssl
run: ./autogen.sh
- name: wolfssl configure with -DWOLFSSL_NO_ASN_STRICT
working-directory: ./wolfssl
run: ./configure --enable-enckeys CFLAGS=-DWOLFSSL_NO_ASN_STRICT
- name: wolfssl rebuild
working-directory: ./wolfssl
run: make
- name: wolfssl reinstall
working-directory: ./wolfssl
run: sudo make install
- name: case 2 - wolfmqtt configure (default bundle, WOLFSSL_NO_ASN_STRICT)
run: |
make clean
./configure --enable-tls --enable-examples
- name: case 2 - wolfmqtt make
run: make
- name: case 2 - awsiot.test expect PASS
run: ./scripts/awsiot.test
- name: case 3 - wolfmqtt configure (legacy VeriSign, WOLFSSL_NO_ASN_STRICT)
run: |
make clean
./configure --enable-tls --enable-examples \
CPPFLAGS=-DWOLFMQTT_AWSIOT_LEGACY_VERISIGN_CA
- name: case 3 - wolfmqtt make
run: make
- name: case 3 - awsiot.test expect FAIL
run: |
if ./scripts/awsiot.test; then
echo "case 3 unexpectedly PASSED - legacy VeriSign should not verify AWS IoT chain"
exit 1
fi
echo "case 3 FAILED as expected (legacy VeriSign trust anchor rejected)"
- name: Show logs on failure
if: failure() || cancelled()
run: |
cat test-suite.log || true
cat scripts/*.log || true