blob: 98aa16574f4395c79ca465f176278067ca841465 [file] [log] [blame]
Ash Wilson6791f4d2016-02-25 23:07:50 -06001#!/bin/bash
2
Vasil Velichkovfc046c42019-09-12 02:09:40 +03003TEST_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 Velichkovfc046c42019-09-12 02:09:40 +030021gnuradio-config-info --version
Ash Wilson4613c1d2016-04-10 23:48:35 -070022
Vasil Velichkovfc046c42019-09-12 02:09:40 +030023cd "$TEST_DIR" || exit 1
24head -c 6000000 $CAPFILE > $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070025
Piotr Krysik89f36242016-07-15 14:58:09 +020026$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 -060027diff $RESULT_EXPECTED $RESULT_OBTAINED
28TEST_RESULT=$?
Ash Wilson4613c1d2016-04-10 23:48:35 -070029
Ash Wilson6791f4d2016-02-25 23:07:50 -060030rm $RESULT_OBTAINED
31rm $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070032
Ash Wilson6791f4d2016-02-25 23:07:50 -060033if [ $TEST_RESULT == 0 ]
34then
35 echo " Result: PASSED"
36 exit 0
37else
38 echo " Result: FAILED"
39 exit 1
40fi
Piotr Krysik6ed59d02016-07-17 11:18:41 +020041