blob: 824955fb168e7db58a846f95d1685e62a4247b3c [file] [log] [blame]
Vasil Velichkovbc2a23e2018-03-27 02:37:49 +03001#!/bin/bash
2
Vasil Velichkovfc046c42019-09-12 02:09:40 +03003TEST_DIR=$(dirname "$0")
Vasil Velichkovbc2a23e2018-03-27 02:37:49 +03004
5# 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 Velichkovbc2a23e2018-03-27 02:37:49 +030011export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
12
13export AP_DECODE="grgsm_decode"
14export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile"
15export SHORTENED_CAPFILE="tmp.cfile"
16export RESULT_EXPECTED="../fixtures/grgsm_decode_decrypt1_expected"
17export RESULT_OBTAINED="grgsm_decode_test1_result"
18export 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"
19echo "Testing with:"
20echo " $RUNLINE"
Vasil Velichkovfc046c42019-09-12 02:09:40 +030021gnuradio-config-info --version
Vasil Velichkovbc2a23e2018-03-27 02:37:49 +030022
Vasil Velichkovfc046c42019-09-12 02:09:40 +030023cd "$TEST_DIR" || exit 1
24head -c -37000000 $CAPFILE | head -c 35800000 > $SHORTENED_CAPFILE
Vasil Velichkovbc2a23e2018-03-27 02:37:49 +030025
26$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
27diff -u $RESULT_EXPECTED $RESULT_OBTAINED
28TEST_RESULT=$?
29
30rm $RESULT_OBTAINED
31rm $SHORTENED_CAPFILE
32
33if [ $TEST_RESULT == 0 ]
34then
35 echo " Result: PASSED"
36 exit 0
37else
38 echo " Result: FAILED"
39 exit 1
40fi
41