#!/bin/sh PROG="$1" TEST=testoutput mkdir -p $TEST performCheck() { if [ "$?" = "0" ] then cat $TEST/test_output.txt | sed 's/"timestamp":"....-..-..T..:..:..Z"/"timestamp":"1111-11-11T11:11:11Z"/' > $TEST/test_response.txt diff $TEST/test_expected.txt $TEST/test_response.txt if [ "$?" = "0" ] then echo "OK: $TESTNAME" TESTRESULT="OK" else if [ "$USE_MELD" = "true" ] then meld $TEST/test_expected.txt $TEST/test_response.txt fi fi else echo "ERROR: $TESTNAME $0" echo "wmbusmeters returned error code: $?" cat $TEST/test_output.txt fi } ######################################################################################################################## ######################################################################################################################## ######################################################################################################################## TESTNAME="Test analyze encrypted (no-key) ctr full telegram" TESTRESULT="ERROR" cat > $TEST/test_expected.txt < $TEST/test_output.txt 2>&1 performCheck ######################################################################################################################## ######################################################################################################################## ######################################################################################################################## TESTNAME="Test analyze encrypted (no-key) ctr compact telegram" TESTRESULT="ERROR" cat > $TEST/test_expected.txt < $TEST/test_output.txt 2>&1 performCheck ######################################################################################################################## ######################################################################################################################## ######################################################################################################################## TESTNAME="Test analyze encrypted (with-key) ctr full telegram" TESTRESULT="ERROR" cat > $TEST/test_expected.txt < $TEST/test_output.txt 2>&1 performCheck ######################################################################################################################## ######################################################################################################################## ######################################################################################################################## TESTNAME="Test analyze encrypted (no-key) ctr compact telegram" TESTRESULT="ERROR" cat > $TEST/test_expected.txt < $TEST/test_output.txt 2>&1 performCheck