blob: 402e818197fd682e0fbb099a87893b4c720fa42c [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
Vasil Velichkov71fb85c2019-09-12 19:32:13 +030022cat /proc/cpuinfo
23ulimit -a
Ash Wilson4613c1d2016-04-10 23:48:35 -070024
Vasil Velichkovfc046c42019-09-12 02:09:40 +030025cd "$TEST_DIR" || exit 1
26head -c 6000000 $CAPFILE > $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070027
Vasil Velichkovcc8d8632019-09-14 04:11:42 +030028# 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
31export VOLK_GENERIC=1
32
Piotr Krysik89f36242016-07-15 14:58:09 +020033$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 Velichkovcc8d8632019-09-14 04:11:42 +030034
Ash Wilson6791f4d2016-02-25 23:07:50 -060035diff $RESULT_EXPECTED $RESULT_OBTAINED
36TEST_RESULT=$?
Ash Wilson4613c1d2016-04-10 23:48:35 -070037
Ash Wilson6791f4d2016-02-25 23:07:50 -060038rm $RESULT_OBTAINED
39rm $SHORTENED_CAPFILE
Ash Wilson4613c1d2016-04-10 23:48:35 -070040
Ash Wilson6791f4d2016-02-25 23:07:50 -060041if [ $TEST_RESULT == 0 ]
42then
43 echo " Result: PASSED"
44 exit 0
45else
46 echo " Result: FAILED"
47 exit 1
48fi
Piotr Krysik6ed59d02016-07-17 11:18:41 +020049