wmbusmeters/tests/test_oneshot.sh

25 wiersze
528 B
Bash
Czysty Zwykły widok Historia

#!/bin/bash
PROG="$1"
mkdir -p testoutput
TEST=testoutput
SIM=simulations/simulation_c1.txt
cat $SIM | grep '^{' > $TEST/test_expected.txt
$PROG --oneshot $SIM MyHeater multical302 '*' '' MyTapWater multical21 76348799 '' > $TEST/test_output.txt
RES=$(cat $TEST/test_output.txt | grep -o "all meters have received at least one update, stopping.")
cat $TEST/test_output.txt
if [ "$RES" = "all meters have received at least one update, stopping." ]
then
echo Oneshot OK
else
echo Fail oneshot check!
exit 1
fi