From 919c0768fb7d3022bb35c70d80825312d3083557 Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Tue, 17 Oct 2023 12:00:07 -0500 Subject: [PATCH] Change to use env var instead of config option --- .github/workflows/fsanitize-check.yml | 8 ++++---- .github/workflows/macos-check.yml | 8 ++++---- .github/workflows/ubuntu-check.yml | 14 ++++++++------ Makefile.am | 1 + configure.ac | 8 -------- scripts/awsiot.test | 22 +++++++++++++--------- scripts/azureiothub.test | 22 +++++++++++++--------- scripts/include.am | 8 ++++---- 8 files changed, 47 insertions(+), 44 deletions(-) diff --git a/.github/workflows/fsanitize-check.yml b/.github/workflows/fsanitize-check.yml index 655e41a05..7ec5483bf 100644 --- a/.github/workflows/fsanitize-check.yml +++ b/.github/workflows/fsanitize-check.yml @@ -33,25 +33,25 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure --enable-noextbrokers CC="gcc -fsanitize=address" + run: ./configure CC="gcc -fsanitize=address" - name: make run: make - name: make check run: make check - name: configure with SN Enabled - run: ./configure --enable-sn --enable-noextbrokers CC="gcc -fsanitize=address" + run: ./configure --enable-sn CC="gcc -fsanitize=address" - name: make run: make - name: make check run: make check - name: configure with Non-Block - run: ./configure --enable-nonblock --enable-noextbrokers CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" CC="gcc -fsanitize=address" + run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" CC="gcc -fsanitize=address" - name: make run: make - name: make check run: make check - name: configure with Non-Block and Multi-threading - run: ./configure --enable-mt --enable-nonblock --enable-noextbrokers CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" CC="gcc -fsanitize=address" + run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" CC="gcc -fsanitize=address" - name: make run: make - name: make check diff --git a/.github/workflows/macos-check.yml b/.github/workflows/macos-check.yml index ee0d4750c..eea2f48a8 100644 --- a/.github/workflows/macos-check.yml +++ b/.github/workflows/macos-check.yml @@ -34,25 +34,25 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure --enable-noextbrokers + run: ./configure - name: make run: make - name: make check run: make check - name: configure with SN Enabled - run: ./configure --enable-sn --enable-noextbrokers + run: ./configure --enable-sn - name: make run: make - name: make check run: make check - name: configure with Non-Block - run: ./configure --enable-nonblock --enable-noextbrokers CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" + run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" - name: make run: make - name: make check run: make check - name: configure with Non-Block and Multi-threading - run: ./configure --enable-mt --enable-nonblock --enable-noextbrokers CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" + run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" - name: make run: make - name: make check diff --git a/.github/workflows/ubuntu-check.yml b/.github/workflows/ubuntu-check.yml index ab8cede9d..17dccdc7f 100644 --- a/.github/workflows/ubuntu-check.yml +++ b/.github/workflows/ubuntu-check.yml @@ -18,10 +18,10 @@ jobs: repository: wolfssl/wolfssl path: wolfssl - name: wolfssl autogen - working-directory: ./wolfssl + working-directory: ./wolfssl run: ./autogen.sh - name: wolfssl configure - working-directory: ./wolfssl + working-directory: ./wolfssl run: ./configure --enable-enckeys - name: wolfssl make working-directory: ./wolfssl @@ -33,7 +33,7 @@ jobs: - name: autogen run: ./autogen.sh - name: configure - run: ./configure --enable-noextbrokers + run: ./configure - name: make run: make - name: make check @@ -43,8 +43,10 @@ jobs: if: ${{ failure() && steps.make-check.outcome == 'failure' }} run: | more test-suite.log + - name: Set WOLFMQTT_NO_EXTERNAL_BROKER_TESTS to exclude external broker tests + env: WOLFMQTT_NO_EXTERNAL_BROKER_TESTS:1 - name: configure with SN Enabled - run: ./configure --enable-sn --enable-noextbrokers + run: ./configure --enable-sn - name: make run: make - name: make check @@ -55,7 +57,7 @@ jobs: run: | more test-suite.log - name: configure with Non-Block - run: ./configure --enable-nonblock --enable-noextbrokers CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" + run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" - name: make run: make - name: make check @@ -66,7 +68,7 @@ jobs: run: | more test-suite.log - name: configure with Non-Block and Multi-threading - run: ./configure --enable-mt --enable-nonblock --enable-noextbrokers CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" + run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" - name: make run: make - name: make check diff --git a/Makefile.am b/Makefile.am index f9f249582..3cc35a432 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,7 @@ check_SCRIPTS = dist_noinst_SCRIPTS = dist_doc_DATA = + #includes additional rules from aminclude.am @INC_AMINCLUDE@ DISTCLEANFILES+= aminclude.am diff --git a/configure.ac b/configure.ac index f4e2525bf..b12c952fb 100644 --- a/configure.ac +++ b/configure.ac @@ -307,13 +307,6 @@ then AM_CFLAGS="$AM_CFLAGS -DWOLFMQTT_MULTITHREAD" fi -# No external brokers, used to disable examples that use external brokers -AC_ARG_ENABLE([noextbrokers], - [AS_HELP_STRING([--enable-noextbrokers],[Enable noextbrokers (default: disabled)])], - [ ENABLED_NOEXTBROKERS=$enableval ], - [ ENABLED_NOEXTBROKERS=no ] - ) - AM_CONDITIONAL([HAVE_LIBWOLFSSL], [test "x$ENABLED_TLS" = "xyes"]) AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$ENABLED_EXAMPLES" = "xyes"]) @@ -322,7 +315,6 @@ AM_CONDITIONAL([BUILD_SN], [test "x$ENABLED_SN" = "xyes"]) AM_CONDITIONAL([BUILD_MQTT5], [test "x$ENABLED_MQTTV50" = "xyes"]) AM_CONDITIONAL([BUILD_NONBLOCK], [test "x$ENABLED_NONBLOCK" = "xyes"]) AM_CONDITIONAL([BUILD_MULTITHREAD], [test "x$ENABLED_MULTITHREAD" = "xyes"]) -AM_CONDITIONAL([BUILD_NOEXTBROKERS], [test "x$ENABLED_NOEXTBROKERS" = "xyes"]) diff --git a/scripts/awsiot.test b/scripts/awsiot.test index 9bff5f945..a153dcf41 100755 --- a/scripts/awsiot.test +++ b/scripts/awsiot.test @@ -5,18 +5,22 @@ # Check for application [ ! -x ./examples/aws/awsiot ] && echo -e "\n\nAWS IoT MQTT Client doesn't exist" && exit 1 -def_args="-T -C 2000" +if test -n "$WOLFMQTT_NO_EXTERNAL_BROKER_TESTS"; then + echo "WOLFMQTT_NO_EXTERNAL_BROKER_TESTS set, won't run" +else + def_args="-T -C 2000" -# Run with TLS and QoS 0-1 + # Run with TLS and QoS 0-1 -./examples/aws/awsiot $def_args -t -q 0 $1 -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nAWS IoT MQTT Client failed! TLS=On, QoS=0" && exit 1 + ./examples/aws/awsiot $def_args -t -q 0 $1 + RESULT=$? + [ $RESULT -ne 0 ] && echo -e "\n\nAWS IoT MQTT Client failed! TLS=On, QoS=0" && exit 1 -./examples/aws/awsiot $def_args -t -q 1 $1 -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nAWS IoT MQTT Client failed! TLS=On, QoS=1" && exit 1 + ./examples/aws/awsiot $def_args -t -q 1 $1 + RESULT=$? + [ $RESULT -ne 0 ] && echo -e "\n\nAWS IoT MQTT Client failed! TLS=On, QoS=1" && exit 1 -echo -e "\n\nAWS IoT MQTT Client Tests Passed" + echo -e "\n\nAWS IoT MQTT Client Tests Passed" +fi exit 0 diff --git a/scripts/azureiothub.test b/scripts/azureiothub.test index e180e45fe..37c94d193 100755 --- a/scripts/azureiothub.test +++ b/scripts/azureiothub.test @@ -5,18 +5,22 @@ # Check for application [ ! -x ./examples/azure/azureiothub ] && echo -e "\n\nAzureIotHub MQTT Client doesn't exist" && exit 1 -def_args="-T -C 2000" +if test -n "$WOLFMQTT_NO_EXTERNAL_BROKER_TESTS"; then + echo "WOLFMQTT_NO_EXTERNAL_BROKER_TESTS set, won't run" +else + def_args="-T -C 2000" -# Run with TLS and QoS 0-1 + # Run with TLS and QoS 0-1 -./examples/azure/azureiothub $def_args -t -q 0 $1 -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nAzureIotHub MQTT Client failed! TLS=On, QoS=0" && exit 1 + ./examples/azure/azureiothub $def_args -t -q 0 $1 + RESULT=$? + [ $RESULT -ne 0 ] && echo -e "\n\nAzureIotHub MQTT Client failed! TLS=On, QoS=0" && exit 1 -./examples/azure/azureiothub $def_args -t -q 1 $1 -RESULT=$? -[ $RESULT -ne 0 ] && echo -e "\n\nAzureIotHub MQTT Client failed! TLS=On, QoS=1" && exit 1 + ./examples/azure/azureiothub $def_args -t -q 1 $1 + RESULT=$? + [ $RESULT -ne 0 ] && echo -e "\n\nAzureIotHub MQTT Client failed! TLS=On, QoS=1" && exit 1 -echo -e "\n\nAzureIotHub MQTT Client Tests Passed" + echo -e "\n\nAzureIotHub MQTT Client Tests Passed" +fi exit 0 diff --git a/scripts/include.am b/scripts/include.am index 963bf1dea..585c047d8 100644 --- a/scripts/include.am +++ b/scripts/include.am @@ -7,13 +7,13 @@ include scripts/broker_test/include.am if BUILD_EXAMPLES dist_noinst_SCRIPTS += scripts/client.test \ scripts/firmware.test \ + scripts/azureiothub.test \ + scripts/awsiot.test \ scripts/nbclient.test +# WIOT test broker disabled 31MAY2021 +# scripts/wiot.test if BUILD_MULTITHREAD dist_noinst_SCRIPTS += scripts/multithread.test endif -if !BUILD_NOEXTBROKERS -dist_noinst_SCRIPTS += scripts/azureiothub.test \ - scripts/awsiot.test -endif endif