From 59b972cff7e02ed55f2dafbc1e6dd5d99cec1d4e Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Fri, 20 Oct 2023 18:05:19 -0500 Subject: [PATCH] Use different port for broker --- .github/workflows/ubuntu-check.yml | 27 ++++++++++++++------------- scripts/broker_test/mosquitto.conf | 4 ++-- scripts/client.test | 18 ++++++++++-------- scripts/firmware.test | 2 +- scripts/multithread.test | 14 ++++++++------ scripts/nbclient.test | 14 ++++++++------ 6 files changed, 43 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ubuntu-check.yml b/.github/workflows/ubuntu-check.yml index 2a1a1b755..c42891427 100644 --- a/.github/workflows/ubuntu-check.yml +++ b/.github/workflows/ubuntu-check.yml @@ -50,14 +50,15 @@ jobs: - name: wolfssl make install working-directory: ./wolfssl run: sudo make install + - uses: actions/checkout@master - - name: autogen + - name: wolfmqtt autogen run: ./autogen.sh - - name: configure + - name: wolfmqtt configure run: ./configure - - name: make + - name: wolfmqtt make run: make - - name: make check + - name: wolfmqtt make check id: make-check run: make check - name: Show logs on failure @@ -66,33 +67,33 @@ jobs: more test-suite.log env: WOLFMQTT_NO_EXTERNAL_BROKER_TESTS: 1 - - name: configure with SN Enabled + - name: wolfmqtt configure with SN Enabled run: ./configure --enable-sn - - name: make + - name: wolfmqtt make run: make - - name: make check + - name: wolfmqtt make check id: make-check-sn run: make check - name: Show logs on failure if: ${{ failure() && steps.make-check-sn.outcome == 'failure' }} run: | more test-suite.log - - name: configure with Non-Block + - name: wolfmqtt configure with Non-Block run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" - - name: make + - name: wolfmqtt make run: make - - name: make check + - name: wolfmqtt make check id: make-check-nonblock run: make check - name: Show logs on failure if: ${{ failure() && steps.make-check-nonblock.outcome == 'failure' }} run: | more test-suite.log - - name: configure with Non-Block and Multi-threading + - name: wolfmqtt configure with Non-Block and Multi-threading run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" - - name: make + - name: wolfmqtt make run: make - - name: make check + - name: wolfmqtt make check id: make-check-nonblock-mt run: make check - name: Show logs on failure diff --git a/scripts/broker_test/mosquitto.conf b/scripts/broker_test/mosquitto.conf index 23e3be18e..7e27dc735 100644 --- a/scripts/broker_test/mosquitto.conf +++ b/scripts/broker_test/mosquitto.conf @@ -7,7 +7,7 @@ # ================================================================= # Port to use for the default listener. -listener 1883 +listener 11883 allow_anonymous true # ----------------------------------------------------------------- @@ -19,7 +19,7 @@ allow_anonymous true # # See also the mosquitto-tls man page. -listener 8883 +listener 18883 allow_anonymous true # At least one of cafile or capath must be defined. They both diff --git a/scripts/client.test b/scripts/client.test index fc241e1e2..367a460bc 100755 --- a/scripts/client.test +++ b/scripts/client.test @@ -37,41 +37,43 @@ then mosquitto -c scripts/broker_test/mosquitto.conf & broker_pid=$! def_args="${def_args} -h localhost" + tls_port_args="-p 18883" + port_args="-p 11883" mutual_auth_args="${mutual_auth_args} -c certs/client-cert.pem -K certs/client-key.pem" ecc_mutual_auth_args="${mutual_auth_args} -c certs/client-ecc-cert.pem -K certs/ecc-client-key.pem" fi # Run with and without TLS and QoS 0-2 -./examples/mqttclient/mqttclient $def_args -q 0 $1 +./examples/mqttclient/mqttclient $def_args $port_args -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=Off, QoS=0" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args -q 1 $1 +./examples/mqttclient/mqttclient $def_args $port_args -q 1 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=Off, QoS=1" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args -q 2 $1 +./examples/mqttclient/mqttclient $def_args $port_args -q 2 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=Off, QoS=2" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args -t -q 0 $1 +./examples/mqttclient/mqttclient $def_args $tls_port_args -t -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=On, QoS=0" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args -t -q 1 $1 +./examples/mqttclient/mqttclient $def_args $tls_port_args -t -q 1 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=On, QoS=1" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args -t -q 2 $1 +./examples/mqttclient/mqttclient $def_args $tls_port_args -t -q 2 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=On, QoS=2" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args $mutual_auth_args -t -q 0 $1 +./examples/mqttclient/mqttclient $def_args $mutual_auth_args $tls_port_args -t -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=On, QoS=0, RSA mutual auth" && do_cleanup "-1" -./examples/mqttclient/mqttclient $def_args $ecc_mutual_auth_args -t -q 0 $1 +./examples/mqttclient/mqttclient $def_args $ecc_mutual_auth_args $tls_port_args -t -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT Client failed! TLS=On, QoS=0, ECC mutual auth" && do_cleanup "-1" diff --git a/scripts/firmware.test b/scripts/firmware.test index a8c3cfb1e..7028865f9 100755 --- a/scripts/firmware.test +++ b/scripts/firmware.test @@ -39,7 +39,7 @@ then # Run mosquitto broker mosquitto -c scripts/broker_test/mosquitto.conf & broker_pid=$! - def_args="${def_args} -h localhost" + def_args="${def_args} -h localhost -p 18883" fi # Start firmware push diff --git a/scripts/multithread.test b/scripts/multithread.test index 0cf80148d..caa2a4130 100755 --- a/scripts/multithread.test +++ b/scripts/multithread.test @@ -37,31 +37,33 @@ then mosquitto -c scripts/broker_test/mosquitto.conf & broker_pid=$! def_args="${def_args} -h localhost" + tls_port_args="-p 18883" + port_args="-p 11883" fi # Run with and without TLS and QoS 0-2 -./examples/multithread/multithread $def_args -q 0 $1 +./examples/multithread/multithread $def_args $port_args -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMultithread Client failed! TLS=Off, QoS=0" && do_cleanup "-1" -./examples/multithread/multithread $def_args -q 1 $1 +./examples/multithread/multithread $def_args $port_args -q 1 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMultithread Client failed! TLS=Off, QoS=1" && do_cleanup "-1" -./examples/multithread/multithread $def_args -q 2 $1 +./examples/multithread/multithread $def_args $port_args -q 2 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMultithread Client failed! TLS=Off, QoS=2" && do_cleanup "-1" -./examples/multithread/multithread $def_args -t -q 0 $1 +./examples/multithread/multithread $def_args $tls_port_args -t -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMultithread Client failed! TLS=On, QoS=0" && do_cleanup "-1" -./examples/multithread/multithread $def_args -t -q 1 $1 +./examples/multithread/multithread $def_args $tls_port_args -t -q 1 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMultithread Client failed! TLS=On, QoS=1" && do_cleanup "-1" -./examples/multithread/multithread $def_args -t -q 2 $1 +./examples/multithread/multithread $def_args $tls_port_args -t -q 2 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMultithread Client failed! TLS=On, QoS=2" && do_cleanup "-1" diff --git a/scripts/nbclient.test b/scripts/nbclient.test index 940dab8a9..70d853a4a 100755 --- a/scripts/nbclient.test +++ b/scripts/nbclient.test @@ -39,31 +39,33 @@ then mosquitto -c scripts/broker_test/mosquitto.conf & broker_pid=$! def_args="${def_args} -h localhost" + tls_port_args="-p 18883" + port_args="-p 11883" fi # Run with and without TLS and QoS 0-2 -./examples/nbclient/nbclient $def_args -q 0 $1 +./examples/nbclient/nbclient $def_args $port_args -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nNon-blocking Client failed! TLS=Off, QoS=0" && do_cleanup "-1" -./examples/nbclient/nbclient $def_args -q 1 $1 +./examples/nbclient/nbclient $def_args $port_args -q 1 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nNon-blocking Client failed! TLS=Off, QoS=1" && do_cleanup "-1" -./examples/nbclient/nbclient $def_args -q 2 $1 +./examples/nbclient/nbclient $def_args $port_args -q 2 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nNon-blocking Client failed! TLS=Off, QoS=2" && do_cleanup "-1" -./examples/nbclient/nbclient $def_args -t -q 0 $1 +./examples/nbclient/nbclient $def_args $tls_port_args -t -q 0 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nNon-blocking Client failed! TLS=On, QoS=0" && do_cleanup "-1" -./examples/nbclient/nbclient $def_args -t -q 1 $1 +./examples/nbclient/nbclient $def_args $tls_port_args -t -q 1 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nNon-blocking Client failed! TLS=On, QoS=1" && do_cleanup "-1" -./examples/nbclient/nbclient $def_args -t -q 2 $1 +./examples/nbclient/nbclient $def_args $tls_port_args -t -q 2 $1 RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nNon-blocking Client failed! TLS=On, QoS=2" && do_cleanup "-1"