From 446b400667972229ee44a63fa2810edc51260331 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Tue, 28 Jan 2025 15:27:13 -0300 Subject: [PATCH] misc fixes --- .github/workflows/nightly.yml | 4 ++-- test/mip_tap_test.c | 6 +++--- test/unit_test.c | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 27b689fb..f1a983af 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -170,7 +170,7 @@ jobs: strategy: fail-fast: false matrix: - ssl: ["", -DMG_TLS=MG_TLS_BUILTIN] + ssl: [-DMG_TLS=MG_TLS_NONE, -DMG_TLS=MG_TLS_BUILTIN] name: examples ${{ matrix.ssl }} steps: - uses: actions/checkout@v4 @@ -517,7 +517,7 @@ jobs: - uses: actions/checkout@v4 with: { fetch-depth: 2 } - run: sudo apt -y update && sudo apt -y install gcc-arm-none-eabi - - run: make -C examples/zephyr init REPO=zephyrprojectrtos/ci:v.0.26.14 # "no space left on device" with newers + - run: make -C examples/zephyr init REPO=zephyrprojectrtos/ci:v0.26.14 # "no space left on device" with newers - name: minify manifest uses: mikefarah/yq@master with: diff --git a/test/mip_tap_test.c b/test/mip_tap_test.c index b30c5885..75f24e81 100644 --- a/test/mip_tap_test.c +++ b/test/mip_tap_test.c @@ -346,10 +346,10 @@ static void test_tls(struct mg_mgr *mgr) { char buf[FETCH_BUF_SIZE]; // make sure it can hold Makefile struct mg_str data = mg_unpacked("/Makefile"); if (host_ip == NULL) { - MG_INFO(("No HOST_IP provided, skipping tests")); + printf("\nNo HOST_IP provided, skipping TLS tests\n"); return; } - MG_DEBUG(("HOST_IP: %s", host_ip)); + printf("HOST_IP: %s\n", host_ip); // - POST a large file, make sure we drain TLS buffers and read all: done at // server test, using curl as POSTing client // - Fire patched server, test multiple TLS records per TCP segment handling @@ -358,7 +358,7 @@ static void test_tls(struct mg_mgr *mgr) { sleep(1); ASSERT(fetch(mgr, buf, url, "GET /thefile HTTP/1.0\n\n") == 200); ASSERT(cmpbody(buf, data.buf) == 0); // "thefile" links to Makefile - ASSERT(system("killall tls_multirec/server")); + ASSERT(system("killall tls_multirec/server") == 0); free(url); #else (void) cmpbody("", ""); diff --git a/test/unit_test.c b/test/unit_test.c index e6d1bb15..67ea5bb7 100644 --- a/test/unit_test.c +++ b/test/unit_test.c @@ -1327,7 +1327,9 @@ static void test_tls(void) { "Content-Length: %lu\n\n" "%s", data.len, data.buf) == 200); +#if MG_TLS == MG_TLS_BUILTIN // fire patched server, test multiple TLS records per TCP segment handling + // skip other TLS stacks to avoid "bad client hello", we are 1.3 only { ASSERT(system("tls_multirec/server -d tls_multirec &") == 0); sleep(1); @@ -1338,6 +1340,12 @@ static void test_tls(void) { ASSERT(cmpbody(buf, data.buf) == 0); // "thefile" links to Makefile ASSERT(system("killall tls_multirec/server") == 0); } +#else + printf( + "\n Skipping multiple TLS records per TCP segment handling test, server " + "is 1.3 only; re-enable when other stacks can be easily configured for " + "1.3\n"); +#endif mg_mgr_free(&mgr); ASSERT(mgr.conns == NULL); #endif