[PATCH 1/2] acceptance-tests: enable running webserver with cert

16 views
Skip to first unread message

Bastian Germann

unread,
Jul 28, 2026, 4:00:45 PMJul 28
to swup...@googlegroups.com, Bastian Germann
Enable running the webserver tests with CMS-signed images.
To that end, let the script call the argument list so that it is
flexible enough for other configurations as well.

Call the script with certificate in the arguments when CMS-signed
images are enabled.

Signed-off-by: Bastian Germann <ba...@debian.org>
---
scripts/acceptance-tests/CheckImage.mk | 2 +-
scripts/acceptance-tests/test_webserver.sh | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/acceptance-tests/CheckImage.mk b/scripts/acceptance-tests/CheckImage.mk
index 785946c3..48fe5cc3 100644
--- a/scripts/acceptance-tests/CheckImage.mk
+++ b/scripts/acceptance-tests/CheckImage.mk
@@ -163,7 +163,7 @@ InvOptsCheckWithWeb: FORCE $(if $(CONFIG_SIGALG_CMS), $(obj)/cacert.pem)
# webserver integration test – exercises both mongoose and lws backends
#
quiet_cmd_websrv_test = RUN $@
- cmd_websrv_test = $(srctree)/scripts/acceptance-tests/test_webserver.sh ./swupdate
+ cmd_websrv_test = $(srctree)/scripts/acceptance-tests/test_webserver.sh ./swupdate -l 5 $(if $(CONFIG_SIGALG_CMS),-k $(obj)/cacert.pem --digest-provider opensslCMS)

PHONY += WebserverTest
WebserverTest: FORCE
diff --git a/scripts/acceptance-tests/test_webserver.sh b/scripts/acceptance-tests/test_webserver.sh
index 4f4f5f20..b75925e6 100755
--- a/scripts/acceptance-tests/test_webserver.sh
+++ b/scripts/acceptance-tests/test_webserver.sh
@@ -4,10 +4,10 @@
#
# Integration tests for the SWUpdate webserver.
#
-# Usage: test_webserver.sh [path-to-swupdate] [port]
+# Usage: test_webserver.sh [swupdate call with arguments other than -w]

-SWUPDATE="${1:-./swupdate}"
-PORT="${2:-18080}"
+SWUPDATE=$*
+PORT=18080
BASE_URL="http://127.0.0.1:$PORT"
DOCROOT=
SWUPDATE_PID=
@@ -38,7 +38,7 @@ echo "canary" > "$(dirname "$DOCROOT")/passwd"
FAKE_SWU=$(mktemp --suffix=.swu)
echo "not a real swu" > "$FAKE_SWU"

-"$SWUPDATE" -l 3 -w "-p $PORT -r $DOCROOT" >/dev/null 2>&1 &
+$SWUPDATE -w "-p $PORT -r $DOCROOT" >/dev/null 2>&1 &
SWUPDATE_PID=$!

# Wait up to 10 s for the server to start accepting connections

Stefano Babic

unread,
Aug 10, 2026, 4:30:52 AMAug 10
to Bastian Germann, swup...@googlegroups.com
Applied to -master, thanks !

Best regards,
Stefano

--
_______________________________________________________________________
Nabla Software Engineering GmbH
Hirschstr. 111A | 86156 Augsburg | Tel: +49 821 45592596
Geschäftsführer : Stefano Babic | HRB 40522 Augsburg
E-Mail: sba...@nabladev.com

Reply all
Reply to author
Forward
0 new messages