kopia lustrzana https://github.com/weetmuts/wmbusmeters
Added test for multiple elements.
rodzic
85c3015e8c
commit
ebe9a30583
1
test.sh
1
test.sh
|
@ -14,6 +14,7 @@ tests/test_shell.sh $PROG
|
|||
tests/test_meterfiles.sh $PROG
|
||||
tests/test_config1.sh $PROG
|
||||
tests/test_logfile.sh $PROG
|
||||
tests/test_elements.sh $PROG
|
||||
tests/test_listen_to_all.sh $PROG
|
||||
tests/test_multiple_ids.sh $PROG
|
||||
#tests/test_oneshot.sh $PROG broken test
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
loglevel=normal
|
||||
device=simulations/simulation_multiple_qcalorics.txt
|
||||
logtelegrams=false
|
||||
format=json
|
||||
meterfiles=testoutput/meter_readings3
|
||||
meterfilesaction=append
|
||||
logfile=testoutput/thelog3.txt
|
|
@ -0,0 +1,4 @@
|
|||
name=Element
|
||||
type=qcaloric
|
||||
id=*
|
||||
key=
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
PROG="$1"
|
||||
TEST=testoutput
|
||||
mkdir -p $TEST/meter_readings3
|
||||
|
||||
rm -f $TEST/meter_readings3/Element
|
||||
cat simulations/simulation_multiple_qcalorics.txt | grep '^{' > $TEST/test_expected.txt
|
||||
|
||||
$PROG --useconfig=tests/config3 > $TEST/test_output.txt
|
||||
|
||||
if [ "$?" == "0" ]
|
||||
then
|
||||
cat $TEST/meter_readings3/Element | sed 's/"timestamp":"....-..-..T..:..:..Z"/"timestamp":"1111-11-11T11:11:11Z"/' > $TEST/test_responses.txt
|
||||
diff $TEST/test_expected.txt $TEST/test_responses.txt
|
||||
if [ "$?" == "0" ]
|
||||
then
|
||||
echo Elements OK
|
||||
fi
|
||||
else
|
||||
echo Failure.
|
||||
exit 1
|
||||
fi
|
Ładowanie…
Reference in New Issue