Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Vasil Velichkov | fc046c4 | 2019-09-12 02:09:40 +0300 | [diff] [blame] | 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 | fc046c4 | 2019-09-12 02:09:40 +0300 | [diff] [blame] | 21 | gnuradio-config-info --version |
Vasil Velichkov | 71fb85c | 2019-09-12 19:32:13 +0300 | [diff] [blame] | 22 | cat /proc/cpuinfo |
| 23 | ulimit -a |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 24 | |
Vasil Velichkov | fc046c4 | 2019-09-12 02:09:40 +0300 | [diff] [blame] | 25 | cd "$TEST_DIR" || exit 1 |
| 26 | head -c 6000000 $CAPFILE > $SHORTENED_CAPFILE |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 27 | |
Vasil Velichkov | cc8d863 | 2019-09-14 04:11:42 +0300 | [diff] [blame] | 28 | # VOLK_GENERIC=1 is a temporary workaround for the following VOLK's bug |
| 29 | # https://github.com/gnuradio/volk/pull/278 |
| 30 | # https://github.com/gnuradio/gnuradio/issues/2748 |
| 31 | export VOLK_GENERIC=1 |
| 32 | |
Piotr Krysik | 89f3624 | 2016-07-15 14:58:09 +0200 | [diff] [blame] | 33 | $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 |
Vasil Velichkov | cc8d863 | 2019-09-14 04:11:42 +0300 | [diff] [blame] | 34 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 35 | diff $RESULT_EXPECTED $RESULT_OBTAINED |
| 36 | TEST_RESULT=$? |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 37 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 38 | rm $RESULT_OBTAINED |
| 39 | rm $SHORTENED_CAPFILE |
Ash Wilson | 4613c1d | 2016-04-10 23:48:35 -0700 | [diff] [blame] | 40 | |
Ash Wilson | 6791f4d | 2016-02-25 23:07:50 -0600 | [diff] [blame] | 41 | if [ $TEST_RESULT == 0 ] |
| 42 | then |
| 43 | echo " Result: PASSED" |
| 44 | exit 0 |
| 45 | else |
| 46 | echo " Result: FAILED" |
| 47 | exit 1 |
| 48 | fi |
Piotr Krysik | 6ed59d0 | 2016-07-17 11:18:41 +0200 | [diff] [blame] | 49 | |