blob: b9827093e23f3cede7011f46c868affeb9473ce0 [file] [log] [blame]
Ash Wilson6791f4d2016-02-25 23:07:50 -06001#!/bin/bash
2
3TEST_DIR=`dirname "$0"`
Ash Wilson1c514982016-04-10 23:24:03 -07004
Vasil Velichkov753afeb2018-02-22 02:17:27 +02005# PYTHONPATH and LD_LIBRARY_PATH are needed on Fedora 26
Vasil Velichkov5e0ea652019-09-02 19:32:19 +03006#
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#
10export PYTHONPATH=/usr/local/lib/python3/dist-packages/:/usr/local/lib64/python2.7/site-packages/:/usr/local/lib64/python2.7/site-packages/grgsm/:$PYTHONPATH
Vasil Velichkov753afeb2018-02-22 02:17:27 +020011export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
12
Ash Wilson4613c1d2016-04-10 23:48:35 -070013export AP_DECODE="grgsm_decode"
Piotr Krysik533f58a2016-04-11 22:20:35 +020014export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile"
Ash Wilson1c514982016-04-10 23:24:03 -070015export SHORTENED_CAPFILE="tmp.cfile"
Piotr Krysik533f58a2016-04-11 22:20:35 +020016export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected"
Ash Wilson1c514982016-04-10 23:24:03 -070017export RESULT_OBTAINED="grgsm_decode_test1_result"
Piotr Krysik259080b2016-07-17 11:05:36 +020018export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m BCCH -t 0 -v --ppm -10"
Ash Wilson6791f4d2016-02-25 23:07:50 -060019echo "Testing with:"
20echo " $RUNLINE"
Vasil Velichkov5e0ea652019-09-02 19:32:19 +030021#gnuradio 3.8 does not have --version parameter
22#gnuradio-companion --version
Ash Wilson4613c1d2016-04-10 23:48:35 -070023
Ash Wilson6791f4d2016-02-25 23:07:50 -060024cd $TEST_DIR
25cat $CAPFILE | head -c 6000000 > $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070026
Piotr Krysik89f36242016-07-15 14:58:09 +020027$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 Wilson6791f4d2016-02-25 23:07:50 -060028diff $RESULT_EXPECTED $RESULT_OBTAINED
29TEST_RESULT=$?
Ash Wilson4613c1d2016-04-10 23:48:35 -070030
Ash Wilson6791f4d2016-02-25 23:07:50 -060031rm $RESULT_OBTAINED
32rm $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070033
Ash Wilson6791f4d2016-02-25 23:07:50 -060034if [ $TEST_RESULT == 0 ]
35then
36 echo " Result: PASSED"
37 exit 0
38else
39 echo " Result: FAILED"
40 exit 1
41fi
Piotr Krysik6ed59d02016-07-17 11:18:41 +020042