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 | |
Vasil Velichkov | 753afeb | 2018-02-22 02:17:27 +0200 | [diff] [blame] | 5 | # PYTHONPATH and LD_LIBRARY_PATH are needed on Fedora 26 |
Vasil Velichkov | 5e0ea65 | 2019-09-02 19:32:19 +0300 | [diff] [blame] | 6 | # |
| 7 | # /usr/local/lib/python3/dist-packages/ is currently needed on Debian Testing and Kali Rolling |
| 8 | # https://salsa.debian.org/bottoms/pkg-gnuradio/blob/unstable/debian/patches/debian-python-install#L8 |
| 9 | # |
| 10 | export PYTHONPATH=/usr/local/lib/python3/dist-packages/:/usr/local/lib64/python2.7/site-packages/:/usr/local/lib64/python2.7/site-packages/grgsm/:$PYTHONPATH |
Vasil Velichkov | 753afeb | 2018-02-22 02:17:27 +0200 | [diff] [blame] | 11 | export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH |
| 12 | |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 13 | export AP_DECODE="grgsm_decode" |
Piotr Krysik | 533f58a | 2016-04-11 22:20:35 +0200 | [diff] [blame] | 14 | export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile" |
Ash Wilson | 1c51498 | 2016-04-10 23:24:03 -0700 | [diff] [blame] | 15 | export SHORTENED_CAPFILE="tmp.cfile" |
Piotr Krysik | 533f58a | 2016-04-11 22:20:35 +0200 | [diff] [blame] | 16 | export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected" |
Ash Wilson | 1c51498 | 2016-04-10 23:24:03 -0700 | [diff] [blame] | 17 | export RESULT_OBTAINED="grgsm_decode_test1_result" |
Piotr Krysik | 259080b | 2016-07-17 11:05:36 +0200 | [diff] [blame] | 18 | 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] | 19 | echo "Testing with:" |
| 20 | echo " $RUNLINE" |
Vasil Velichkov | 5e0ea65 | 2019-09-02 19:32:19 +0300 | [diff] [blame] | 21 | #gnuradio 3.8 does not have --version parameter |
| 22 | #gnuradio-companion --version |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 23 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 24 | cd $TEST_DIR |
| 25 | cat $CAPFILE | head -c 6000000 > $SHORTENED_CAPFILE |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 26 | |
Piotr Krysik | 89f3624 | 2016-07-15 14:58:09 +0200 | [diff] [blame] | 27 | $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] | 28 | diff $RESULT_EXPECTED $RESULT_OBTAINED |
| 29 | TEST_RESULT=$? |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 30 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 31 | rm $RESULT_OBTAINED |
| 32 | rm $SHORTENED_CAPFILE |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 33 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 34 | if [ $TEST_RESULT == 0 ] |
| 35 | then |
| 36 | echo " Result: PASSED" |
| 37 | exit 0 |
| 38 | else |
| 39 | echo " Result: FAILED" |
| 40 | exit 1 |
| 41 | fi |
Piotr Krysik | 6ed59d0 | 2016-07-17 11:18:41 +0200 | [diff] [blame] | 42 | |