blob: c71b26e35ddf92623df4751c3befe7690fc8de88 [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
6export PYTHONPATH=/usr/local/lib64/python2.7/site-packages/:/usr/local/lib64/python2.7/site-packages/grgsm/:$PYTHONPATH
7export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
8
Ash Wilson4613c1d2016-04-10 23:48:35 -07009export AP_DECODE="grgsm_decode"
Piotr Krysik533f58a2016-04-11 22:20:35 +020010export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile"
Ash Wilson1c514982016-04-10 23:24:03 -070011export SHORTENED_CAPFILE="tmp.cfile"
Piotr Krysik533f58a2016-04-11 22:20:35 +020012export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected"
Ash Wilson1c514982016-04-10 23:24:03 -070013export RESULT_OBTAINED="grgsm_decode_test1_result"
Piotr Krysik259080b2016-07-17 11:05:36 +020014export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m BCCH -t 0 -v --ppm -10"
Ash Wilson6791f4d2016-02-25 23:07:50 -060015echo "Testing with:"
16echo " $RUNLINE"
17gnuradio-companion --version
Ash Wilson4613c1d2016-04-10 23:48:35 -070018
Ash Wilson6791f4d2016-02-25 23:07:50 -060019cd $TEST_DIR
20cat $CAPFILE | head -c 6000000 > $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070021
Piotr Krysik89f36242016-07-15 14:58:09 +020022$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 -060023diff $RESULT_EXPECTED $RESULT_OBTAINED
24TEST_RESULT=$?
Ash Wilson4613c1d2016-04-10 23:48:35 -070025
Ash Wilson6791f4d2016-02-25 23:07:50 -060026rm $RESULT_OBTAINED
27rm $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070028
Ash Wilson6791f4d2016-02-25 23:07:50 -060029if [ $TEST_RESULT == 0 ]
30then
31 echo " Result: PASSED"
32 exit 0
33else
34 echo " Result: FAILED"
35 exit 1
36fi
Piotr Krysik6ed59d02016-07-17 11:18:41 +020037