Files
vpp/test/scripts/run.sh
Saima Yunus c7f93b321d tests: move "venv" to "build-root" directory from "test" directory
Type: refactor

- refactored VPP test code to remove "ignore_path" variable
  from "discover_tests" function and "run_test" code
- configured VPP test makefile, config file, and 'run.sh' shell script
  to move "venv" directory from "test" dir to "build-root" dir

Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com>
Change-Id: Id2beecbb99f24ce13ed118a1869c5adbef247e50
2022-08-16 20:27:37 +00:00

72 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
ff="0"
items=
for i in "$@"
do
case $i in
--venv-dir=*)
venv_dir="${i#*=}"
if [ -d $venv_dir ]
then
venv_dir=$(cd $venv_dir; pwd)
else
echo "ERROR: '$venv_dir' is not a directory"
exit 1
fi
items="$items --venv-dir=\"$venv_dir\""
;;
--vpp-ws-dir=*)
ws_dir="${i#*=}"
if [ -d $ws_dir ]
then
ws_dir=$(cd $ws_dir; pwd)
else
echo "ERROR: '$ws_dir' is not a directory"
exit 1
fi
items="$items --vpp-ws-dir=\"$ws_dir\""
;;
--force-foreground)
ff="1"
items="$items \"$i\""
;;
--vpp-tag=*)
tag="${i#*=}"
items="$items \"$i\""
;;
--python-opts=*)
python_opts="${i#*=}"
;;
*)
# unknown option - skip
items="$items \"$i\""
;;
esac
done
extra_args=""
if [ -z "$ws_dir" ]
then
ws_dir=$(pwd)
echo "Argument --vpp-ws-dir not specified, defaulting to '$ws_dir'"
extra_args="$extra_args --vpp-ws-dir=$ws_dir"
fi
if [ -z "$venv_dir" ]
then
venv_dir="$ws_dir/build-root/test/venv"
echo "Argument --venv-path not specified, defaulting to '$venv_dir'"
extra_args="$extra_args --venv-dir=$venv_dir"
fi
if [ -z "$tag" ]
then
tag="vpp_debug"
echo "Argument --vpp-tag not specified, defaulting to '$tag'"
extra_args="$extra_args --vpp-tag=$tag"
fi
eval set -- $items
$ws_dir/test/scripts/setsid_wrapper.sh $ws_dir/test/scripts/run_in_venv_with_cleanup.sh $ff $venv_dir/bin/activate python3 $python_opts $ws_dir/test/run_tests.py $extra_args $*