diff options
author | imarom <imarom@cisco.com> | 2016-01-04 06:57:45 -0500 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-01-04 10:02:59 -0500 |
commit | e134270a3bcf3c9498a2926ffea1d7bb0d4960eb (patch) | |
tree | 5cbff2f3ae4c6b9a28de58c0c7d9b592ebfd9676 /scripts/stl-sim | |
parent | 82e65a02d2f9bdab552521a4859795937821f1be (diff) |
a script to inject simulation stateless files
Diffstat (limited to 'scripts/stl-sim')
-rw-r--r-- | scripts/stl-sim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/stl-sim b/scripts/stl-sim new file mode 100644 index 00000000..1ca0322e --- /dev/null +++ b/scripts/stl-sim @@ -0,0 +1,31 @@ +#!/bin/bash + +# if no variable of $PYTHON is define - we try to find it +function find_python { + # two candidates - machine python and cisco linux python + MACHINE_PYTHON=python + CEL_PYTHON=/router/bin/python + + # try the machine python + PYTHON=$MACHINE_PYTHON + + PCHECK=`$PYTHON -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver < 27)"` + if [ $? -ne 0 ]; then + PYTHON=$CEL_PYTHON + PCHECK=`$PYTHON -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver < 27)"` + + if [ $? -ne 0 ]; then + echo "*** $PYTHON - python version is too old, 2.7 at least is required" + exit -1 + fi + + fi + +} + +if [ -z "$PYTHON" ]; then + find_python +fi + +$PYTHON automation/trex_control_plane/client/trex_stateless_sim.py $@ + |