summaryrefslogtreecommitdiffstats
path: root/tests/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.sh')
-rwxr-xr-xtests/run.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/run.sh b/tests/run.sh
index c21c3fd7..fda1e753 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -30,6 +30,7 @@ DOCTOR_PW=doctor
DOCTOR_PROJECT=doctor
DOCTOR_ROLE=_member_
PROFILER_TYPE=${PROFILER_TYPE:-none}
+PYTHON_ENABLE=${PYTHON_ENABLE:-false}
TOP_DIR=$(cd $(dirname "$0") && pwd)
@@ -293,8 +294,7 @@ inject_failure() {
echo "disabling network of compute host [$COMPUTE_HOST] for 3 mins..."
cat > disable_network.sh << 'END_TXT'
#!/bin/bash -x
-dev=$(sudo ip a | awk '/ @COMPUTE_IP@\//{print $7}')
-[[ -n "$dev" ]] || dev=$(sudo ip a | awk '/ @COMPUTE_IP@\//{print $5}')
+dev=$(sudo ip a | awk '/ @COMPUTE_IP@\//{print $NF}')
sleep 1
sudo ip link set $dev down
echo "doctor set link down at" $(date "+%s.%N")
@@ -480,6 +480,13 @@ cleanup() {
# Main process
+if $PYTHON_ENABLE; then
+ cd $TOP_DIR
+ echo "executing tox..."
+ tox
+ exit $?
+fi
+
echo "Note: doctor/tests/run.sh has been executed."
git log --oneline -1 || true # ignore even you don't have git installed