Skip to content

Commit

Permalink
Fix firmware.test
Browse files Browse the repository at this point in the history
  • Loading branch information
embhorn committed Oct 26, 2023
1 parent a1e0686 commit c684f06
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fsanitize-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ jobs:
- name: Show logs on failure
if: failure() || cancelled()
run: |
cat test-suite.log
more test-suite.log
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ jobs:
- name: Show logs on failure
if: failure() || cancelled()
run: |
cat test-suite.log
more test-suite.log
1 change: 0 additions & 1 deletion scripts/client.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ do_cleanup() {
kill -9 $broker_pid
echo "Killed broker PID $broker_pid"
broker_pid=$no_pid
sleep 10
fi

if [ $1 -ne 0 ]
Expand Down
21 changes: 14 additions & 7 deletions scripts/firmware.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ no_pid=-1
broker_pid=$no_pid

do_cleanup() {
# Delete file
rm $fileout
if [ $ENABLE_MQTT_TLS -ne 1 ]; then
# Delete file
rm $fileout
fi

if [ $broker_pid != $no_pid ]
then
kill -9 $broker_pid
echo "Killed broker PID $broker_pid"
broker_pid=$no_pid
sleep 10
fi

if [ $1 -ne 0 ]
Expand Down Expand Up @@ -50,6 +51,9 @@ then
def_args="${def_args} -h localhost -p 18883"
fi

grep -F -e 'ENABLE_MQTT_TLS' ./wolfmqtt/options.h
ENABLE_MQTT_TLS=$?

# Start firmware push
./examples/firmware/fwpush $def_args -r -f $filein $1
server_result=$?
Expand All @@ -60,10 +64,13 @@ server_result=$?
client_result=$?
[ $client_result -ne 0 ] && echo -e "\n\nMQTT Example fwclient failed!" && do_cleanup "-1"

# Compare files
md5sum -b $filein $fileout
compare_result=$?
[ $compare_result -ne 0 ] && echo -e "\n\nMQTT Example firmware compare failed!" && do_cleanup "-1"
if [ $ENABLE_MQTT_TLS -ne 1 ]; then
# Compare files
echo "Comparing files"
md5sum -b $filein $fileout
compare_result=$?
[ $compare_result -ne 0 ] && echo -e "\n\nMQTT Example firmware compare failed!" && do_cleanup "-1"
fi

# End broker
do_cleanup "0"
Expand Down
1 change: 0 additions & 1 deletion scripts/multithread.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ do_cleanup() {
kill -9 $broker_pid
echo "Killed broker PID $broker_pid"
broker_pid=$no_pid
sleep 10
fi

if [ $1 -ne 0 ]
Expand Down
1 change: 0 additions & 1 deletion scripts/nbclient.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ do_cleanup() {
kill -9 $broker_pid
echo "Killed broker PID $broker_pid"
broker_pid=$no_pid
sleep 10
fi

if [ $1 -ne 0 ]
Expand Down

0 comments on commit c684f06

Please sign in to comment.