Vasil Velichkov | bc2a23e | 2018-03-27 02:37:49 +0300 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Vasil Velichkov | fc046c4 | 2019-09-12 02:09:40 +0300 | [diff] [blame] | 3 | TEST_DIR=$(dirname "$0") |
Vasil Velichkov | bc2a23e | 2018-03-27 02:37:49 +0300 | [diff] [blame] | 4 | |
| 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 | bc2a23e | 2018-03-27 02:37:49 +0300 | [diff] [blame] | 11 | export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH |
| 12 | |
| 13 | export AP_DECODE="grgsm_decode" |
| 14 | export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile" |
| 15 | export SHORTENED_CAPFILE="tmp.cfile" |
| 16 | export RESULT_EXPECTED="../fixtures/grgsm_decode_decrypt1_expected" |
| 17 | export RESULT_OBTAINED="grgsm_decode_test1_result" |
| 18 | export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m SDCCH8 -t 1 -k 0x1E,0xF0,0x0B,0xAB,0x3B,0xAC,0x70,0x02 -v --ppm -10" |
| 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 |
Vasil Velichkov | bc2a23e | 2018-03-27 02:37:49 +0300 | [diff] [blame] | 24 | |
Vasil Velichkov | fc046c4 | 2019-09-12 02:09:40 +0300 | [diff] [blame] | 25 | cd "$TEST_DIR" || exit 1 |
| 26 | head -c -37000000 $CAPFILE | head -c 35800000 > $SHORTENED_CAPFILE |
Vasil Velichkov | bc2a23e | 2018-03-27 02:37:49 +0300 | [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 | |
Vasil Velichkov | bc2a23e | 2018-03-27 02:37:49 +0300 | [diff] [blame] | 33 | $RUNLINE | grep -A 999999 "862210 1331352: 03 03 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b" | tee $RESULT_OBTAINED |
| 34 | diff -u $RESULT_EXPECTED $RESULT_OBTAINED |
| 35 | TEST_RESULT=$? |
| 36 | |
| 37 | rm $RESULT_OBTAINED |
| 38 | rm $SHORTENED_CAPFILE |
| 39 | |
| 40 | if [ $TEST_RESULT == 0 ] |
| 41 | then |
| 42 | echo " Result: PASSED" |
| 43 | exit 0 |
| 44 | else |
| 45 | echo " Result: FAILED" |
| 46 | exit 1 |
| 47 | fi |
| 48 | |