Skip to content

Commit 32e31d3

Browse files
authored
Merge pull request #114 from danielinux/zephyr-tcpip-replace
Zephyr TCP/IP replacement
2 parents 57a879b + 1d9288f commit 32e31d3

16 files changed

Lines changed: 5874 additions & 189 deletions

.github/workflows/stm32h563-m33mu-freertos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
stm32h563_m33mu_echo_freertos:
1010
runs-on: ubuntu-latest
1111
container:
12-
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:v1.2
12+
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:latest
1313
options: --privileged
1414
steps:
1515
- name: Checkout

.github/workflows/stm32h563-m33mu-ssh-tzen.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
set -euo pipefail
2323
apt-get update
24-
apt-get install -y sudo dnsmasq iproute2 netcat-openbsd git \
24+
apt-get install -y dnsmasq iproute2 netcat-openbsd git \
2525
openssh-client sshpass
2626
2727
- name: Fetch wolfSSL/wolfSSH/wolfBoot
@@ -34,9 +34,9 @@ jobs:
3434
git clone --depth 1 --branch master https://github.com/wolfSSL/wolfssh.git ../wolfssh
3535
fi
3636
if [ ! -d ../wolfboot ]; then
37-
git clone --depth 1 --branch stm32tz https://github.com/dgarske/wolfboot.git ../wolfboot
38-
git -C ../wolfboot submodule update --init --single-branch
37+
git clone --depth 1 https://github.com/wolfSSL/wolfBoot.git ../wolfboot
3938
fi
39+
git -C ../wolfboot submodule update --init --single-branch
4040
4141
- name: Build wolfBoot (stm32h5-tz)
4242
run: |
@@ -63,19 +63,19 @@ jobs:
6363
cleanup() {
6464
set +e
6565
if [ -f /tmp/m33mu.pid ]; then
66-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
66+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
6767
fi
68-
sudo pkill -x m33mu 2>/dev/null || true
68+
pkill -x m33mu 2>/dev/null || true
6969
if [ -f /tmp/dnsmasq.pid ]; then
70-
sudo kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
70+
kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
7171
fi
72-
sudo ip link del tap0 2>/dev/null || true
72+
ip link del tap0 2>/dev/null || true
7373
}
7474
trap cleanup EXIT
7575
76-
sudo ip tuntap add dev tap0 mode tap
77-
sudo ip addr add 192.168.12.1/24 dev tap0
78-
sudo ip link set tap0 up
76+
ip tuntap add dev tap0 mode tap
77+
ip addr add 192.168.12.1/24 dev tap0
78+
ip link set tap0 up
7979
8080
cat > /tmp/dnsmasq.conf <<'CONF'
8181
interface=tap0
@@ -84,12 +84,9 @@ jobs:
8484
dhcp-leasefile=/tmp/dnsmasq.leases
8585
log-dhcp
8686
CONF
87-
sudo dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
87+
dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
8888
89-
# wolfBoot does a full software ECC256 verify of the 300 KB
90-
# signed NS image before it BLXNSes into wolfIP. End-to-end the
91-
# m33mu run takes ~3 minutes; 360s gives ~2x headroom.
92-
sudo m33mu \
89+
/usr/local/bin/m33mu \
9390
../wolfboot/wolfboot.bin \
9491
src/port/stm32h563/app_v1_signed.bin:0x60000 \
9592
--cpu stm32h563 --tap:tap0 --uart-stdout --timeout 360 --quit-on-faults \
@@ -142,5 +139,5 @@ jobs:
142139
fi
143140
echo "SSH test succeeded."
144141
if [ -f /tmp/m33mu.pid ]; then
145-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
142+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
146143
fi

.github/workflows/stm32h563-m33mu.yml

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 20
1313
container:
14-
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:v1.2
14+
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:latest
1515
options: --privileged
1616

1717
steps:
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
set -euo pipefail
2323
apt-get update
24-
apt-get install -y sudo dnsmasq iproute2 netcat-openbsd
24+
apt-get install -y dnsmasq iproute2 netcat-openbsd
2525
2626
- name: Build STM32H563 echo firmware
2727
run: |
@@ -36,19 +36,19 @@ jobs:
3636
cleanup() {
3737
set +e
3838
if [ -f /tmp/m33mu.pid ]; then
39-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
39+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
4040
fi
41-
sudo pkill -x m33mu 2>/dev/null || true
41+
pkill -x m33mu 2>/dev/null || true
4242
if [ -f /tmp/dnsmasq.pid ]; then
43-
sudo kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
43+
kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
4444
fi
45-
sudo ip link del tap0 2>/dev/null || true
45+
ip link del tap0 2>/dev/null || true
4646
}
4747
trap cleanup EXIT
4848
49-
sudo ip tuntap add dev tap0 mode tap
50-
sudo ip addr add 192.168.12.1/24 dev tap0
51-
sudo ip link set tap0 up
49+
ip tuntap add dev tap0 mode tap
50+
ip addr add 192.168.12.1/24 dev tap0
51+
ip link set tap0 up
5252
5353
cat > /tmp/dnsmasq.conf <<'EOF'
5454
interface=tap0
@@ -57,9 +57,9 @@ jobs:
5757
dhcp-leasefile=/tmp/dnsmasq.leases
5858
log-dhcp
5959
EOF
60-
sudo dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
60+
dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
6161
62-
sudo m33mu src/port/stm32h563/app.bin \
62+
/usr/local/bin/m33mu src/port/stm32h563/app.bin \
6363
--cpu stm32h563 --tap:tap0 --uart-stdout --timeout 120 \
6464
2>&1 | tee /tmp/m33mu.log &
6565
sleep 1
@@ -68,6 +68,7 @@ jobs:
6868
echo "${m33mu_pid}" > /tmp/m33mu.pid
6969
fi
7070
71+
# Wait for DHCP lease
7172
ip=""
7273
for _ in $(seq 1 60); do
7374
if [ -s /tmp/dnsmasq.leases ]; then
@@ -107,14 +108,14 @@ jobs:
107108
fi
108109
echo "Echo test succeeded."
109110
if [ -f /tmp/m33mu.pid ]; then
110-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
111+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
111112
fi
112113
113114
stm32h563_m33mu_full:
114115
runs-on: ubuntu-latest
115116
timeout-minutes: 30
116117
container:
117-
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:v1.2
118+
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:latest
118119
options: --privileged
119120

120121
steps:
@@ -132,7 +133,7 @@ jobs:
132133
run: |
133134
set -euo pipefail
134135
apt-get update
135-
apt-get install -y sudo dnsmasq iproute2 netcat-openbsd \
136+
apt-get install -y dnsmasq iproute2 netcat-openbsd \
136137
curl mosquitto-clients openssh-client
137138
138139
- name: Build STM32H563 full firmware
@@ -152,19 +153,19 @@ jobs:
152153
cleanup() {
153154
set +e
154155
if [ -f /tmp/m33mu.pid ]; then
155-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
156+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
156157
fi
157-
sudo pkill -x m33mu 2>/dev/null || true
158+
pkill -x m33mu 2>/dev/null || true
158159
if [ -f /tmp/dnsmasq.pid ]; then
159-
sudo kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
160+
kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
160161
fi
161-
sudo ip link del tap0 2>/dev/null || true
162+
ip link del tap0 2>/dev/null || true
162163
}
163164
trap cleanup EXIT
164165
165-
sudo ip tuntap add dev tap0 mode tap
166-
sudo ip addr add 192.168.12.1/24 dev tap0
167-
sudo ip link set tap0 up
166+
ip tuntap add dev tap0 mode tap
167+
ip addr add 192.168.12.1/24 dev tap0
168+
ip link set tap0 up
168169
169170
cat > /tmp/dnsmasq.conf <<'EOF'
170171
interface=tap0
@@ -173,9 +174,9 @@ jobs:
173174
dhcp-leasefile=/tmp/dnsmasq.leases
174175
log-dhcp
175176
EOF
176-
sudo dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
177+
dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
177178
178-
sudo m33mu src/port/stm32h563/app.bin \
179+
/usr/local/bin/m33mu src/port/stm32h563/app.bin \
179180
--cpu stm32h563 --tap:tap0 --uart-stdout --timeout 240 \
180181
2>&1 | tee /tmp/m33mu.log &
181182
sleep 1
@@ -316,14 +317,14 @@ jobs:
316317
echo ""
317318
echo "=== All tests passed ==="
318319
if [ -f /tmp/m33mu.pid ]; then
319-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
320+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
320321
fi
321322
322323
stm32h563_m33mu_https_tls13:
323324
runs-on: ubuntu-latest
324325
timeout-minutes: 25
325326
container:
326-
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:v1.2
327+
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:latest
327328
options: --privileged
328329

329330
steps:
@@ -333,7 +334,7 @@ jobs:
333334
run: |
334335
set -euo pipefail
335336
apt-get update
336-
apt-get install -y sudo dnsmasq iproute2 curl git tcpdump
337+
apt-get install -y dnsmasq iproute2 curl git tcpdump
337338
338339
- name: Fetch wolfSSL
339340
run: |
@@ -361,22 +362,22 @@ jobs:
361362
cleanup() {
362363
set +e
363364
if [ -f /tmp/m33mu.pid ]; then
364-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
365+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
365366
fi
366367
if [ -f /tmp/tcpdump.pid ]; then
367-
sudo kill "$(cat /tmp/tcpdump.pid)" 2>/dev/null || true
368+
kill "$(cat /tmp/tcpdump.pid)" 2>/dev/null || true
368369
fi
369-
sudo pkill -x m33mu 2>/dev/null || true
370+
pkill -x m33mu 2>/dev/null || true
370371
if [ -f /tmp/dnsmasq.pid ]; then
371-
sudo kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
372+
kill "$(cat /tmp/dnsmasq.pid)" 2>/dev/null || true
372373
fi
373-
sudo ip link del tap0 2>/dev/null || true
374+
ip link del tap0 2>/dev/null || true
374375
}
375376
trap cleanup EXIT
376377
377-
sudo ip tuntap add dev tap0 mode tap
378-
sudo ip addr add 192.168.12.1/24 dev tap0
379-
sudo ip link set tap0 up
378+
ip tuntap add dev tap0 mode tap
379+
ip addr add 192.168.12.1/24 dev tap0
380+
ip link set tap0 up
380381
381382
cat > /tmp/dnsmasq.conf <<'CONF'
382383
interface=tap0
@@ -385,12 +386,12 @@ jobs:
385386
dhcp-leasefile=/tmp/dnsmasq.leases
386387
log-dhcp
387388
CONF
388-
sudo dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
389+
dnsmasq --conf-file=/tmp/dnsmasq.conf --pid-file=/tmp/dnsmasq.pid
389390
390-
sudo tcpdump -i tap0 -nn -U -w /tmp/https-test.pcap > /tmp/tcpdump.log 2>&1 &
391+
tcpdump -i tap0 -nn -U -w /tmp/https-test.pcap > /tmp/tcpdump.log 2>&1 &
391392
echo $! > /tmp/tcpdump.pid
392393
393-
sudo m33mu src/port/stm32h563/app.bin \
394+
/usr/local/bin/m33mu src/port/stm32h563/app.bin \
394395
--cpu stm32h563 --tap:tap0 --uart-stdout --timeout 180 --quit-on-faults \
395396
2>&1 | tee /tmp/m33mu.log &
396397
sleep 1
@@ -444,17 +445,17 @@ jobs:
444445
fi
445446
echo "HTTPS test succeeded."
446447
if [ -f /tmp/m33mu.pid ]; then
447-
sudo kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
448+
kill "$(cat /tmp/m33mu.pid)" 2>/dev/null || true
448449
fi
449450
if [ -f /tmp/tcpdump.pid ]; then
450-
sudo kill "$(cat /tmp/tcpdump.pid)" 2>/dev/null || true
451+
kill "$(cat /tmp/tcpdump.pid)" 2>/dev/null || true
451452
fi
452453
453454
stm32h563_m33mu_vlan:
454455
runs-on: ubuntu-latest
455456
timeout-minutes: 20
456457
container:
457-
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:v1.2
458+
image: ghcr.io/wolfssl/wolfboot-ci-m33mu:latest
458459
options: --privileged
459460

460461
steps:
@@ -464,11 +465,7 @@ jobs:
464465
run: |
465466
set -euo pipefail
466467
apt-get update
467-
# iproute2: 'ip' command (tap, vlan link-add)
468-
# tcpdump: packet capture on tap0
469-
# tshark: filter/parse the pcap for VID + direction assertions
470-
# sudo: the integration script wraps privileged ops with sudo
471-
apt-get install -y sudo iproute2 tcpdump tshark
468+
apt-get install -y iproute2 tcpdump tshark
472469
473470
- name: Run VLAN integration test (TCP echo over 802.1Q)
474471
timeout-minutes: 15
@@ -478,10 +475,6 @@ jobs:
478475
M33MU_TIMEOUT: "60"
479476
run: |
480477
set -euo pipefail
481-
# The script builds the firmware with ENABLE_VLAN=1, sets up tap0
482-
# + tap0.${VLAN_VID}, boots m33mu, probes the TCP echo service on
483-
# port 7 over the VLAN, and asserts via tshark that 802.1Q frames
484-
# flowed in both directions on VID=${VLAN_VID}.
485478
bash tools/scripts/debug-m33mu-vlan-local.sh
486479
487480
- name: Upload VLAN artifacts on failure

0 commit comments

Comments
 (0)