gr-gsm/tests/scripts/decode.sh

33 lines
881 B
Bash
Raw Normal View History

2016-02-21 18:32:12 +00:00
#!/bin/bash
2016-03-13 18:17:53 +00:00
TEST_DIR=`dirname "$0"`
2016-04-11 06:24:03 +00:00
2016-04-11 06:48:35 +00:00
export AP_DECODE="grgsm_decode"
export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile"
2016-04-11 06:24:03 +00:00
export SHORTENED_CAPFILE="tmp.cfile"
export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected"
2016-04-11 06:24:03 +00:00
export RESULT_OBTAINED="grgsm_decode_test1_result"
2016-07-17 09:05:36 +00:00
export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m BCCH -t 0 -v --ppm -10"
2016-02-21 18:32:12 +00:00
echo "Testing with:"
echo " $RUNLINE"
gnuradio-companion --version
2016-04-11 06:48:35 +00:00
2016-03-13 18:17:53 +00:00
cd $TEST_DIR
cat $CAPFILE | head -c 6000000 > $SHORTENED_CAPFILE
2016-04-11 06:48:35 +00:00
2016-07-15 12:58:09 +00:00
$RUNLINE | grep -A 999999 "860933 1329237: 59 06 1a 8f 6d 18 10 80 00 00 00 00 00 00 00 00 00 00 00 78 b9 00 00" | tee $RESULT_OBTAINED
diff $RESULT_EXPECTED $RESULT_OBTAINED
2016-02-21 18:32:12 +00:00
TEST_RESULT=$?
2016-04-11 06:48:35 +00:00
rm $RESULT_OBTAINED
rm $SHORTENED_CAPFILE
2016-04-11 06:48:35 +00:00
2016-02-21 18:32:12 +00:00
if [ $TEST_RESULT == 0 ]
then
echo " Result: PASSED"
exit 0
else
echo " Result: FAILED"
exit 1
fi