From 533f58ad8327f967267e5b23d24dc316218681f1 Mon Sep 17 00:00:00 2001 From: Piotr Krysik Date: Mon, 11 Apr 2016 22:20:35 +0200 Subject: [PATCH] Changed arrangment of directories and names of files for testing --- TESTING.md | 8 +-- dockerfiles/Ubuntu15_pybombs.docker | 16 ----- dockerfiles/Ubuntu16.docker | 66 ------------------- .../dockerfiles}/DebianJessie.docker | 0 .../dockerfiles/Ubuntu_15_04.docker | 5 +- .../fixtures/grgsm_decode_test1_expected | 0 {test/tests => tests/scripts}/decode.sh | 4 +- .../scripts/scanner.sh | 6 +- 8 files changed, 11 insertions(+), 94 deletions(-) delete mode 100644 dockerfiles/Ubuntu15_pybombs.docker delete mode 100644 dockerfiles/Ubuntu16.docker rename {dockerfiles => tests/dockerfiles}/DebianJessie.docker (100%) rename dockerfiles/Ubuntu15.docker => tests/dockerfiles/Ubuntu_15_04.docker (94%) rename {test => tests}/fixtures/grgsm_decode_test1_expected (100%) rename {test/tests => tests/scripts}/decode.sh (80%) rename test/tests/integration.sh => tests/scripts/scanner.sh (82%) mode change 100644 => 100755 diff --git a/TESTING.md b/TESTING.md index a12b5ba..b51e647 100644 --- a/TESTING.md +++ b/TESTING.md @@ -2,14 +2,14 @@ ## CI Testing -CI testing currently consists of attempting to build gr-gsm as described in the .docker files located under gr-gsm/dockerfiles using travis-ci.org. If the build is successful, travis-ci will attempt to decode the test file located under gr-gsm/test_data and compare the results to this file: gr-gsm/test/fixtures/grgsm_decode_test1_expected. See the gr-gsm/test/tests/decode.sh file for details. +CI testing currently consists of attempting to build gr-gsm as described in the .docker files located under gr-gsm/tests/dockerfiles using travis-ci.org. If the build is successful, travis-ci will attempt to decode the test file located under gr-gsm/test_data and compare the results to this file: gr-gsm/tests/fixtures/grgsm_decode_test1_expected. See the gr-gsm/tests/scripts/decode.sh file for details. ## Integration testing -Integration testing: +Integration testing with use of the grgsm_scanner application: * Make sure that your RTL SDR dongle is plugged into the system and if you're running on Mac, you need to have the dongle accessible to the VirtualBox VM that's running Docker. -* cd gr-gsm/test/tests -* . .integration.sh +* cd gr-gsm/tests/scripts +* scanner.sh This will copy the entire contents of the currently checked out branch of gr-gsm to a temp folder, and attempt to build the docker images according to the definitions in the .docker files located under gr-gsm/dockerfiles. Once the images are created, the script instantiates a container for testing the rtlsdr scanner on each band, against each Docker image built. This can take quite a while. If you're running on Mac, consider using the ```caffeinate``` command to keep your machine from sleeping. diff --git a/dockerfiles/Ubuntu15_pybombs.docker b/dockerfiles/Ubuntu15_pybombs.docker deleted file mode 100644 index 9c2a5f0..0000000 --- a/dockerfiles/Ubuntu15_pybombs.docker +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu:15.04 -MAINTAINER Piotr Krysik - -# We know it's going to foul up, so we run this install separately and then ...fix... dpkg status -RUN apt-get update && apt-get install -y uhd-host || \ - sed -i "s/Status: install ok half-configured/Status: install ok installed/g" /var/lib/dpkg/status - - -RUN apt-get update && apt-get install -y git python-pip -RUN pip install PyBOMBS -RUN pybombs prefix init /usr/local -a default_prx -RUN pybombs config default_prefix default_prx -RUN pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git -RUN pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git -RUN pybombs -v install gr-gsm -RUN ldconfig diff --git a/dockerfiles/Ubuntu16.docker b/dockerfiles/Ubuntu16.docker deleted file mode 100644 index bf4eb2c..0000000 --- a/dockerfiles/Ubuntu16.docker +++ /dev/null @@ -1,66 +0,0 @@ -FROM ubuntu:16.04 -MAINTAINER Ash Wilson - -# We know it's going to foul up, so we run this install separately and then ...fix... dpkg status -RUN apt-get update && apt-get install -y uhd-host || \ - sed -i "s/Status: install ok half-configured/Status: install ok installed/g" /var/lib/dpkg/status - -RUN apt-get update && apt-get install -y \ - git \ - python \ - python-scipy \ - cmake \ - make \ - autoconf \ - automake \ - cpp-4.9 \ - gcc \ - g++ \ - libstdc++-4.9-dev \ - libcppunit-dev \ - swig \ - doxygen \ - liblog4cpp5v5 \ - liblog4cpp5-dev \ - build-essential \ - libtool \ - shtool \ - pkg-config \ - libpcsclite-dev \ - gnuradio \ - gnuradio-dev \ - gr-osmosdr \ - libfftw3-dev \ - libusb-1.0-0-dev \ - libvolk1-dev \ - libvolk1.1 \ - libboost-all-dev \ - libgnuradio-osmosdr0.1.4 \ - libmirisdr0 \ - libosmosdr-dev \ - libosmosdr0 \ - librtlsdr-dev \ - librtlsdr0 \ - osmo-sdr \ - rtl-sdr \ - wget \ - python-talloc-dev \ - libtalloc2 \ - libtalloc-dev \ - unzip \ - libosmocore-dev - - -COPY ./ /src/ - -RUN mkdir /root/.gnuradio/ -RUN echo "[grc]\nlocal_blocks_path=/usr/local/share/gnuradio/grc/blocks" > \ - /root/.gnuradio/config.conf - -RUN mkdir /src/build && \ - cd /src/build && \ - cmake .. && \ - make && \ - # make test && \ - make install && \ - ldconfig diff --git a/dockerfiles/DebianJessie.docker b/tests/dockerfiles/DebianJessie.docker similarity index 100% rename from dockerfiles/DebianJessie.docker rename to tests/dockerfiles/DebianJessie.docker diff --git a/dockerfiles/Ubuntu15.docker b/tests/dockerfiles/Ubuntu_15_04.docker similarity index 94% rename from dockerfiles/Ubuntu15.docker rename to tests/dockerfiles/Ubuntu_15_04.docker index f3a49df..74304bd 100644 --- a/dockerfiles/Ubuntu15.docker +++ b/tests/dockerfiles/Ubuntu_15_04.docker @@ -2,15 +2,14 @@ FROM ubuntu:15.04 MAINTAINER Ash Wilson ENV OSMOSDR_GIT="git://git.osmocom.org/libosmocore.git" -#ENV OSMOCORE_TAG=0.6.3 -ENV OSMOCORE_TAG=0.6.6 +ENV OSMOCORE_TAG=0.6.3 # We know it's going to foul up, so we run this install separately and then ...fix... dpkg status RUN apt-get update && apt-get install -y uhd-host || \ sed -i "s/Status: install ok half-configured/Status: install ok installed/g" /var/lib/dpkg/status -RUN apt-get update && apt-get install -y \ +RUN apt-get install -y \ git \ python \ python-scipy \ diff --git a/test/fixtures/grgsm_decode_test1_expected b/tests/fixtures/grgsm_decode_test1_expected similarity index 100% rename from test/fixtures/grgsm_decode_test1_expected rename to tests/fixtures/grgsm_decode_test1_expected diff --git a/test/tests/decode.sh b/tests/scripts/decode.sh similarity index 80% rename from test/tests/decode.sh rename to tests/scripts/decode.sh index 62a3df2..014a5d3 100755 --- a/test/tests/decode.sh +++ b/tests/scripts/decode.sh @@ -3,9 +3,9 @@ TEST_DIR=`dirname "$0"` export AP_DECODE="grgsm_decode" -export CAPFILE="/src/test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile" +export CAPFILE="../../test_data/vf_call6_a725_d174_g5_Kc1EF00BAB3BAC7002.cfile" export SHORTENED_CAPFILE="tmp.cfile" -export RESULT_EXPECTED="/src/test/fixtures/grgsm_decode_test1_expected" +export RESULT_EXPECTED="../fixtures/grgsm_decode_test1_expected" export RESULT_OBTAINED="grgsm_decode_test1_result" export RUNLINE="$AP_DECODE -c $SHORTENED_CAPFILE -s $((100000000/174)) -m BCCH -t 0 -v " echo "Testing with:" diff --git a/test/tests/integration.sh b/tests/scripts/scanner.sh old mode 100644 new mode 100755 similarity index 82% rename from test/tests/integration.sh rename to tests/scripts/scanner.sh index 04513d9..4b1bfdd --- a/test/tests/integration.sh +++ b/tests/scripts/scanner.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This script runs integration tests for gnuradio. +# This script runs integration tests for grgsm_scanner. # Run it fron the enclosing directory. export TEST_IMAGE_NAMES=() export TEST_SCAN_BANDS=(P-GSM DCS1800 PCS1900 E-GSM R-GSM GSM450 GSM480 GSM850) @@ -13,7 +13,7 @@ cp -R $GR_SRC_DIR $TEMP_DIR cd $TEMP_DIR/gr-gsm -export DOCKERFILE_LIST=($TEMP_DIR/gr-gsm/dockerfiles/*.docker) +export DOCKERFILE_LIST=($TEMP_DIR/gr-gsm/tests/dockerfiles/*.docker) for DOCKERFILE in ${DOCKERFILE_LIST[*]} do @@ -29,7 +29,7 @@ done for BAND in ${TEST_SCAN_BANDS[*]} do - export SCAN_COMMAND="/usr/bin/python /usr/local/bin/airprobe_rtlsdr_scanner.py -b `echo $BAND` -v" + export SCAN_COMMAND="/usr/bin/python /usr/local/bin/grgsm_scanner -b `echo $BAND` -v" for IMG in ${TEST_IMAGE_NAMES[*]} do echo "Now we test: $SCAN_COMMAND on $IMG"