kopia lustrzana https://github.com/weetmuts/wmbusmeters
Fix nc test to run on computers without dns hostname.
rodzic
f377ade8c7
commit
17791e5fb2
|
@ -1,7 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if ! command -v nc > /dev/null 2> /dev/null
|
||||||
|
then
|
||||||
|
echo "Skipping nc test, not installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
IS_NC_OPENBSD=$(nc -help 2>&1 | grep -o OpenBSD)
|
||||||
|
# These tests only work with netcat-openbsd.
|
||||||
|
if [ "$IS_NC_OPENBSD" != "OpenBSD" ]
|
||||||
|
then
|
||||||
|
echo "Skipping nc test, wrong version of nc installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if nc 2>&1 | grep -q apple
|
if nc 2>&1 | grep -q apple
|
||||||
then
|
then
|
||||||
|
echo "Skipping nc test, incorrect version of nc installed."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,7 +33,7 @@ TESTRESULT="ERROR"
|
||||||
PORT=$(( $RANDOM % 10000 + 30000 ))
|
PORT=$(( $RANDOM % 10000 + 30000 ))
|
||||||
|
|
||||||
rm -f $TEST/response
|
rm -f $TEST/response
|
||||||
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "rtlwmbus:CMD(nc -lkv $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "rtlwmbus:CMD(nc -lkn $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
if ! command -v nc > /dev/null 2> /dev/null
|
||||||
|
then
|
||||||
|
echo "Skipping nc test, not installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
IS_NC_OPENBSD=$(nc -help 2>&1 | grep -o OpenBSD)
|
||||||
|
# These tests only work with netcat-openbsd.
|
||||||
|
if [ "$IS_NC_OPENBSD" != "OpenBSD" ]
|
||||||
|
then
|
||||||
|
echo "Skipping nc test, wrong version of nc installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if nc 2>&1 | grep -q apple
|
if nc 2>&1 | grep -q apple
|
||||||
then
|
then
|
||||||
|
echo "Skipping nc test, incorrect version of nc installed."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,7 +32,7 @@ TESTRESULT="ERROR"
|
||||||
PORT=$(( $RANDOM % 10000 + 30000 ))
|
PORT=$(( $RANDOM % 10000 + 30000 ))
|
||||||
|
|
||||||
rm -f $TEST/response
|
rm -f $TEST/response
|
||||||
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "hex:CMD(nc -lk $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "hex:CMD(nc -lkn $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if ! command -v nc > /dev/null 2> /dev/null
|
||||||
|
then
|
||||||
|
echo "Skipping nc test, not installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
IS_NC_OPENBSD=$(nc -help 2>&1 | grep -o OpenBSD)
|
||||||
|
# These tests only work with netcat-openbsd.
|
||||||
|
if [ "$IS_NC_OPENBSD" != "OpenBSD" ]
|
||||||
|
then
|
||||||
|
echo "Skipping nc test, wrong version of nc installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if nc 2>&1 | grep -q apple
|
if nc 2>&1 | grep -q apple
|
||||||
then
|
then
|
||||||
|
echo "Skipping nc test, incorrect version of nc installed."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,7 +33,7 @@ TESTRESULT="ERROR"
|
||||||
PORT=$(( $RANDOM % 10000 + 30000 ))
|
PORT=$(( $RANDOM % 10000 + 30000 ))
|
||||||
|
|
||||||
rm -f $TEST/response
|
rm -f $TEST/response
|
||||||
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "rawtty:CMD(nc -lk $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "rawtty:CMD(nc -lkn $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue