2019-02-23 17:30:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PROG="$1"
|
|
|
|
|
|
|
|
mkdir -p testoutput
|
|
|
|
TEST=testoutput
|
|
|
|
|
2019-11-03 21:00:18 +00:00
|
|
|
TESTNAME="Test T1 meters"
|
|
|
|
TESTRESULT="ERROR"
|
|
|
|
|
2019-02-23 17:30:16 +00:00
|
|
|
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-12-28 09:33:18 +00:00
|
|
|
MyTapWaterc apator162 23202020 "" \
|
2020-02-04 06:44:49 +00:00
|
|
|
MyTapWaterd apator162 24202020 "" \
|
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-10-29 20:26:01 +00:00
|
|
|
IzarWater izar 21242472 "" \
|
2020-02-02 20:31:46 +00:00
|
|
|
IzarWater2 izar 66290778 "" \
|
2019-11-26 13:24:17 +00:00
|
|
|
HydrusWater hydrus 64646464 "" \
|
2019-12-07 13:46:28 +00:00
|
|
|
HydrodigitWater hydrodigit 86868686 "" \
|
2020-02-06 12:14:46 +00:00
|
|
|
Q400Water q400 72727272 AAA896100FED12DD614DD5D46369ACDD \
|
|
|
|
Elen1 ebzwmbe 22992299 "" \
|
2020-02-06 14:41:48 +00:00
|
|
|
Elen2 esyswm 77997799 "" \
|
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
|
2019-11-03 21:00:18 +00:00
|
|
|
echo OK: $TESTNAME
|
|
|
|
TESTRESULT="OK"
|
2019-02-23 17:30:16 +00:00
|
|
|
fi
|
2019-11-03 21:00:18 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$TESTRESULT" = "ERROR" ]
|
|
|
|
then
|
|
|
|
echo ERROR: $TESTNAME
|
2019-03-05 20:19:05 +00:00
|
|
|
exit 1
|
2019-02-23 17:30:16 +00:00
|
|
|
fi
|