add C89 and bigendian tests for L2, be for MIP

This commit is contained in:
Sergio R. Caprile committed 2026-06-30 14:37:58 -03:00
1 parent 8e7f5ab00e
commit 5bf953cb4a
4 files changed
+118 -9

No files matched your search

+41 -4
View File
@@ -51,6 +51,7 @@ jobs:
cat log
test/health.awk < log > json
scp -o "StrictHostKeyChecking=no" json "root@176.9.217.245:/data/downloads/health/linux_${{ matrix.target }}_${{ matrix.cc }}_${{ matrix.ssl }}_${{ matrix.select }}_$(date +"%Y%m%d").json"
mip:
runs-on: ubuntu-latest
strategy:
@@ -85,14 +86,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1 # no parallel runs, to minimize MQTT errors
matrix:
target: [mip_vc98]
name: mip89 ${{ matrix.target }}
ipv6: [0, 1]
name: MIP C89 ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }} IPV6=1
- run: make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
mipbe:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [mip_s390]
ipv6: [0, 1]
name: MIP be ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
l2:
runs-on: ubuntu-latest
@@ -102,7 +115,7 @@ jobs:
cc: [gcc, clang, g++, clang++]
target: [eth_test, ppp_test]
ipv6: [0, 1]
name: ${{ matrix.target }} CC=${{ matrix.cc }} IPV6=${{ matrix.ipv6 }}
name: L2 ${{ matrix.target }} CC=${{ matrix.cc }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
@@ -115,6 +128,30 @@ jobs:
cat log
test/health.awk < log > json
scp -o "StrictHostKeyChecking=no" json "root@176.9.217.245:/data/downloads/health/${{ matrix.target }}_${{ matrix.cc }}_${{ matrix.ipv6 }}_$(date +"%Y%m%d").json"
l289:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [eth_vc98, ppp_vc98]
ipv6: [0, 1]
name: L2 C89 ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
l2be:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [eth_s390, ppp_s390]
ipv6: [0, 1]
name: L2 be ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
s390:
runs-on: ubuntu-latest
+55 -1
View File
@@ -4,6 +4,31 @@ on:
env:
IPV6: 0
jobs:
mip89:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [mip_vc98]
ipv6: [0, 1]
name: MIP C89 ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
mipbe:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [mip_s390]
ipv6: [0, 1]
name: MIP be ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
l2:
runs-on: ubuntu-latest
strategy:
@@ -12,7 +37,7 @@ jobs:
cc: [gcc, clang, g++, clang++]
target: [eth_test, ppp_test]
ipv6: [0, 1]
name: ${{ matrix.target }} CC=${{ matrix.cc }} IPV6=${{ matrix.ipv6 }}
name: L2 ${{ matrix.target }} CC=${{ matrix.cc }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
@@ -20,6 +45,35 @@ jobs:
with:
ssh-private-key: ${{ secrets.HEALTH_TESTS_SSH_KEY }}
- run: make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }} CC=${{ matrix.cc }} > log
- if: success() || failure()
run: |
cat log
test/health.awk < log > json
scp -o "StrictHostKeyChecking=no" json "root@176.9.217.245:/data/downloads/health/${{ matrix.target }}_${{ matrix.cc }}_${{ matrix.ipv6 }}_$(date +"%Y%m%d").json"
l289:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [eth_vc98, ppp_vc98]
ipv6: [0, 1]
name: L2 C89 ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
l2be:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [eth_s390, ppp_s390]
ipv6: [0, 1]
name: L2 be ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 2 }
- run: sudo apt -y update ; sudo apt -y install binfmt-support qemu-user-static && docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && make -C test ${{ matrix.target }} IPV6=${{ matrix.ipv6 }}
# macos:
+20 -2
View File
@@ -29,7 +29,7 @@ COMMON_CFLAGS ?= $(C_WARN) $(WARN) $(INCS) $(DEFS) -DMG_ENABLE_IPV6=$(IPV6) $(TF
CFLAGS ?= $(OPTS) $(ASAN) $(COMMON_CFLAGS)
VALGRIND_CFLAGS ?= $(OPTS) $(COMMON_CFLAGS)
VALGRIND_RUN ?= valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --show-leak-kinds=all --leak-resolution=high --track-origins=yes --error-exitcode=1 --exit-on-first-error=yes --fair-sched=yes
.PHONY: clean_tutorials tutorials mip_test eth_test ppp_test test valgrind
.PHONY: tutorials mip_test eth_test ppp_test eth_vc98 ppp_vc98 eth_s390 ppp_s390 test valgrind
ifeq "$(findstring ++,$(CC))" ""
# $(CC) does not end with ++, i.e. we're using C. Apply C flags
@@ -81,7 +81,7 @@ endif
all:
$(MAKE) -C ../tutorials/http/http-server
tall: mg_prefix unamalgamated test valgrind fuzz fuzz_tls vc98 vc17 vc22 mingw mingw++ arm armhf riscv s390 tutorials tutorials_win tutorials_embedded mip_test eth_test ppp_test mip_vc98
tall: mg_prefix unamalgamated test valgrind fuzz fuzz_tls vc98 vc17 vc22 mingw mingw++ arm armhf riscv s390 tutorials tutorials_win tutorials_embedded mip_test eth_test ppp_test mip_vc98 eth_vc98 ppp_vc98 eth_s390 ppp_s390
mip_test: mip_test.c mongoose.c mongoose.h packed_fs.c Makefile
$(CC) mip_test.c packed_fs.c $(CFLAGS) $(LDFLAGS) -o $@
@@ -112,6 +112,14 @@ mip_vc98: mip_test.c mongoose.c mongoose.h packed_fs.c Makefile
$(DOCKER) mdashnet/vc98 wine cl mip_test.c packed_fs.c $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe
$(DOCKER) -e WINEPREFIX=/tmp/wineprefix mdashnet/vc98 wine $@.exe
eth_vc98: eth_test.c mongoose.c mongoose.h Makefile
$(DOCKER) mdashnet/vc98 wine cl eth_test.c $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe
$(DOCKER) -e WINEPREFIX=/tmp/wineprefix mdashnet/vc98 wine $@.exe
ppp_vc98: ppp_test.c driver_mock.c mongoose.c mongoose.h Makefile
$(DOCKER) mdashnet/vc98 wine cl ppp_test.c $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe
$(DOCKER) -e WINEPREFIX=/tmp/wineprefix mdashnet/vc98 wine $@.exe
packed_fs.c: Makefile data/ssi.h fuzz.c data/a.txt data/ca.pem certs/ca.crt certs/server.crt certs/server.key
$(CC) $(CFLAGS) pack.c -o pack
$(RUN) ./pack Makefile data/ssi.h fuzz.c data/a.txt data/range.txt data/ca.pem certs/ca.crt certs/server.crt certs/server.key certs/client.key certs/client.crt > $@
@@ -205,6 +213,16 @@ mip_s390: CC = $(DOCKER) mdashnet/s390 cc
mip_s390: RUN = $(DOCKER) --init mdashnet/s390
mip_s390: mip_test
eth_s390: ASAN=
eth_s390: CC = $(DOCKER) mdashnet/s390 cc
eth_s390: RUN = $(DOCKER) --init mdashnet/s390
eth_s390: eth_test
ppp_s390: ASAN=
ppp_s390: CC = $(DOCKER) mdashnet/s390 cc
ppp_s390: RUN = $(DOCKER) --init mdashnet/s390
ppp_s390: ppp_test
mip_port_s390: ASAN=
mip_port_s390: IPV6=0
# This test requires curl, not present in this image
+2 -2
View File
@@ -158,7 +158,7 @@ static void frag_send_fn(struct mg_connection *c, int ev, void *ev_data) {
}
} else if (ev == MG_EV_WRITE) {
// Checking TCP segment sizes (ev_data points to the TCP payload length)
ASSERT(*(int *) ev_data == s_seg_sizes[s_seg_sent++]);
ASSERT(*(long *) ev_data == s_seg_sizes[s_seg_sent++]);
}
(void) c, (void) ev_data;
}
@@ -298,7 +298,7 @@ static void init_tests(struct mg_mgr *mgr, struct eth *e, struct ipp *ipp,
mif->ip = mg_htonl(0x1000000);
mif->gw = mg_htonl(0x1000000);
mif->gw_ready = true;
mif->mask = 255; // use router, to avoid firing an ARP request
mif->mask = mg_htonl(0xff000000); // use router, avoid firing ARP request
mif->state = MG_TCPIP_STATE_READY; // so mg_send() works and DHCP stops
}
mg_tcpip_init(mgr, mif);