From e134270a3bcf3c9498a2926ffea1d7bb0d4960eb Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 4 Jan 2016 06:57:45 -0500 Subject: a script to inject simulation stateless files --- scripts/stl-sim | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/stl-sim (limited to 'scripts/stl-sim') 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 $@ + -- cgit 1.2.3-korg