summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmar Farooq <umar.farooq@neclab.eu>2017-05-29 16:57:16 +0000
committerUmar Farooq <umar.farooq@neclab.eu>2017-06-06 15:15:10 +0000
commit6442090131eb020d3caba0ac26fedcf13fee9c9a (patch)
treed9fa1001f9130e1ca80d10d91e0898e364b72e7a
parentf77107087079caa9b1602be6308d98107c9639b8 (diff)
Fix run.sh bug for dynamic interfaces
The run.sh extracts the name of interface using awk with 7th value in "ip a" command but in case of DHCP enabled interface this value is "dynamic". So the fix takes the last value of the output which is the correct interface name. EDIT: Removed the redundant line to get 5th element. JIRA: DOCTOR-109 Change-Id: I0775d90ef219387e5b68abd4fd98d38d2104f128 Signed-off-by: Umar Farooq <umar.farooq@neclab.eu>
-rwxr-xr-xtests/run.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/run.sh b/tests/run.sh
index c21c3fd7..34a52878 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -293,8 +293,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")