2020-04-21 10:40:25 +00:00
|
|
|
#!/bin/sh
|
2019-03-05 20:19:05 +00:00
|
|
|
|
|
|
|
PROG="$1"
|
|
|
|
|
2020-09-08 20:11:32 +00:00
|
|
|
rm -rf testoutput
|
2019-03-05 20:19:05 +00:00
|
|
|
mkdir -p testoutput
|
|
|
|
|
|
|
|
TEST=testoutput
|
|
|
|
SIM=simulations/simulation_c1.txt
|
|
|
|
|
2020-09-13 14:55:22 +00:00
|
|
|
$PROG --oneshot --verbose $SIM MyHeater multical302 67676767 NOKEY MyTapWater multical21 76348799 NOKEY > $TEST/test_output.txt 2> $TEST/test_stderr.txt
|
2019-03-05 20:19:05 +00:00
|
|
|
|
2020-09-13 14:55:22 +00:00
|
|
|
RES=$(cat $TEST/test_stderr.txt | grep -o "(main) all meters have received at least one update, stopping." | tail -n 1)
|
2019-03-05 20:19:05 +00:00
|
|
|
|
2020-09-08 20:11:32 +00:00
|
|
|
if [ "$RES" = "(main) all meters have received at least one update, stopping." ]
|
2019-03-05 20:19:05 +00:00
|
|
|
then
|
2020-09-08 20:11:32 +00:00
|
|
|
echo OK: Test oneshot
|
2019-03-05 20:19:05 +00:00
|
|
|
else
|
2020-09-08 20:11:32 +00:00
|
|
|
echo ERROR Fail oneshot check!
|
2019-03-05 20:19:05 +00:00
|
|
|
exit 1
|
|
|
|
fi
|