Skip to content

Commit

Permalink
Use different port for broker
Browse files Browse the repository at this point in the history
  • Loading branch information
embhorn committed Oct 20, 2023
1 parent b469920 commit 59b972c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 36 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/ubuntu-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/broker_test/mosquitto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# =================================================================

# Port to use for the default listener.
listener 1883
listener 11883
allow_anonymous true

# -----------------------------------------------------------------
Expand All @@ -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
Expand Down
18 changes: 10 additions & 8 deletions scripts/client.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion scripts/firmware.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions scripts/multithread.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 8 additions & 6 deletions scripts/nbclient.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 59b972c

Please sign in to comment.