Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | TEST_DIR=`dirname "$0"` |
Ash Wilson | 1c51498 | 2016-04-10 23:24:03 -0700 | [diff] [blame] | 4 | |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 5 | export AP_DECODE="grgsm_decode" |
Piotr Krysik | 533f58a | 2016-04-11 22:20:35 +0200 | [diff] [blame] | 6 | export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile" |
Ash Wilson | 1c51498 | 2016-04-10 23:24:03 -0700 | [diff] [blame] | 7 | export SHORTENED_CAPFILE="tmp.cfile" |
Piotr Krysik | 533f58a | 2016-04-11 22:20:35 +0200 | [diff] [blame] | 8 | export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected" |
Ash Wilson | 1c51498 | 2016-04-10 23:24:03 -0700 | [diff] [blame] | 9 | export RESULT_OBTAINED="grgsm_decode_test1_result" |
Piotr Krysik | 259080b | 2016-07-17 11:05:36 +0200 | [diff] [blame] | 10 | export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m BCCH -t 0 -v --ppm -10" |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 11 | echo "Testing with:" |
| 12 | echo " $RUNLINE" |
| 13 | gnuradio-companion --version |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 14 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 15 | cd $TEST_DIR |
| 16 | cat $CAPFILE | head -c 6000000 > $SHORTENED_CAPFILE |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 17 | |
Piotr Krysik | 89f3624 | 2016-07-15 14:58:09 +0200 | [diff] [blame] | 18 | $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 |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 19 | diff $RESULT_EXPECTED $RESULT_OBTAINED |
| 20 | TEST_RESULT=$? |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 21 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 22 | rm $RESULT_OBTAINED |
| 23 | rm $SHORTENED_CAPFILE |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 24 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 25 | if [ $TEST_RESULT == 0 ] |
| 26 | then |
| 27 | echo " Result: PASSED" |
| 28 | exit 0 |
| 29 | else |
| 30 | echo " Result: FAILED" |
| 31 | exit 1 |
| 32 | fi |
Piotr Krysik | 6ed59d0 | 2016-07-17 11:18:41 +0200 | [diff] [blame] | 33 | |