2019-02-23 17:30:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PROG="$1"
|
|
|
|
|
|
|
|
mkdir -p testoutput
|
|
|
|
|
|
|
|
TEST=testoutput
|
|
|
|
|
|
|
|
cat simulations/simulation_t1.txt | grep '^{' > $TEST/test_expected.txt
|
2019-02-26 21:19:16 +00:00
|
|
|
$PROG --format=json simulations/simulation_t1.txt \
|
2019-02-23 17:30:16 +00:00
|
|
|
MyWarmWater supercom587 12345678 "" \
|
|
|
|
MyColdWater supercom587 11111111 "" \
|
|
|
|
MoreWater iperl 12345699 "" \
|
2019-03-11 16:31:34 +00:00
|
|
|
WaterWater iperl 33225544 "" \
|
2019-03-20 21:16:45 +00:00
|
|
|
Wasser apator162 20202020 "" \
|
2019-08-12 09:47:39 +00:00
|
|
|
MyTapWatera apator162 21202020 "" \
|
2019-09-07 09:19:45 +00:00
|
|
|
MyTapWaterb apator162 22202020 "" \
|
2019-04-02 16:57:37 +00:00
|
|
|
MyElectricity1 amiplus 10101010 "" \
|
2019-04-27 11:31:13 +00:00
|
|
|
Duschen mkradio3 34333231 "" \
|
2019-05-04 06:52:25 +00:00
|
|
|
HeatMeter vario451 58234965 "" \
|
2019-05-21 13:18:06 +00:00
|
|
|
HeatMeter eurisii 88018801 "" \
|
2019-10-14 14:53:02 +00:00
|
|
|
Tempoo lansenth 00010203 "" \
|
2019-10-14 18:26:31 +00:00
|
|
|
Rummet rfmamb 11772288 "" \
|
2019-02-23 17:30:16 +00:00
|
|
|
> $TEST/test_output.txt
|
|
|
|
if [ "$?" == "0" ]
|
|
|
|
then
|
2019-02-24 15:51:18 +00:00
|
|
|
cat $TEST/test_output.txt | sed 's/"timestamp":"....-..-..T..:..:..Z"/"timestamp":"1111-11-11T11:11:11Z"/' > $TEST/test_responses.txt
|
2019-02-23 17:30:16 +00:00
|
|
|
diff $TEST/test_expected.txt $TEST/test_responses.txt
|
|
|
|
if [ "$?" == "0" ]
|
|
|
|
then
|
|
|
|
echo T1 OK
|
|
|
|
fi
|
|
|
|
else
|
2019-03-05 20:19:05 +00:00
|
|
|
echo Failure.
|
|
|
|
exit 1
|
2019-02-23 17:30:16 +00:00
|
|
|
fi
|