summaryrefslogtreecommitdiffstats
path: root/scripts/run_regression
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-04-14 23:46:39 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-04-14 23:46:39 +0300
commitb577ba683afb5d31858b95bd0a9a9c479752c498 (patch)
treebce0389d22eda9c117bb96e0aa22cc2c8413ee6b /scripts/run_regression
parent94ce0dcd7f93fe82e667f38d805f56d6d828f824 (diff)
regression: add --python2 and --python3 to run_regression, if nothing provided, use python2.
hltapi: fix bug of not reducing 4 bytes from produced packets because of fcs. doc: add trex_client package stl/stf example of running examples :)
Diffstat (limited to 'scripts/run_regression')
-rwxr-xr-xscripts/run_regression37
1 files changed, 34 insertions, 3 deletions
diff --git a/scripts/run_regression b/scripts/run_regression
index 02746bab..bdc2f185 100755
--- a/scripts/run_regression
+++ b/scripts/run_regression
@@ -1,6 +1,37 @@
#!/bin/bash
-source find_python.sh --python2
-cd automation/regression
-$PYTHON trex_unit_test.py --exclude functional $@
+INPUT_ARGS=${@//--python[23]/}
+
+if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then
+ source find_python.sh --python2
+ cd automation/regression
+
+ # Python 2
+ echo Python2 test
+ $PYTHON trex_unit_test.py $INPUT_ARGS
+ if [ $? -eq 0 ]; then
+ printf "\n$PYTHON test succeeded\n\n"
+ else
+ printf "\n*** $PYTHON test failed\n\n"
+ exit -1
+ fi
+ cd -
+fi
+
+if [[ $@ =~ '--python3' ]]; then
+ source find_python.sh --python3
+ cd automation/regression
+
+ # Python 3
+ echo Python3 test
+ $PYTHON trex_unit_test.py $INPUT_ARGS
+ if [ $? -eq 0 ]; then
+ printf "\n$PYTHON test succeeded\n\n"
+ else
+ printf "\n*** $PYTHON test failed\n\n"
+ exit -1
+ fi
+ cd -
+fi
+