tests: add test script for pySim-trace
pySim-trace has no test coverage yet. Let's use a script to run a GSAMTAP pcacp through it and check that no exceptions are raised. Related: OS#6094 Change-Id: Icfabfa7c59968021eef0399991bd05b92467d8d2
This commit is contained in:
@@ -22,6 +22,7 @@ case "$JOB_TYPE" in
|
||||
. venv/bin/activate
|
||||
|
||||
pip install -r requirements.txt
|
||||
pip install pyshark
|
||||
|
||||
# Execute automatically discovered unit tests first
|
||||
python -m unittest discover -v -s tests/
|
||||
@@ -29,6 +30,7 @@ case "$JOB_TYPE" in
|
||||
# Run the test with physical cards
|
||||
cd pysim-testdata
|
||||
../tests/pysim-test.sh
|
||||
../tests/pySim-trace_test.sh
|
||||
;;
|
||||
"pylint")
|
||||
# Print pylint version
|
||||
|
||||
BIN
pysim-testdata/pySim-trace_test_gsmtap.pcapng
Normal file
BIN
pysim-testdata/pySim-trace_test_gsmtap.pcapng
Normal file
Binary file not shown.
20
tests/pySim-trace_test.sh
Executable file
20
tests/pySim-trace_test.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#/bin/bash
|
||||
|
||||
PYSIM_TRACE=../pySim-trace.py
|
||||
GSMTAP_TRACE=pySim-trace_test_gsmtap.pcapng
|
||||
|
||||
echo "pySim-trace_test - a test program to test pySim-trace.py"
|
||||
echo "========================================================"
|
||||
|
||||
$PYSIM_TRACE gsmtap-pyshark-pcap -f $GSMTAP_TRACE
|
||||
if [ $? -ne 0 ]; then
|
||||
echo ""
|
||||
echo "========================================================"
|
||||
echo "Testrun with $GSMTAP_TRACE failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "========================================================"
|
||||
echo "trace parsed without problems -- everything ok!"
|
||||
|
||||
Reference in New Issue
Block a user