fix doctor test 37/17537/1
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Tue, 26 Jul 2016 05:49:18 +0000 (14:49 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Tue, 26 Jul 2016 05:50:32 +0000 (14:50 +0900)
- revert to use nova command to get IP address of compute host

- disable interface which has the IP address of target compute host

JIRA: DOCTOR-63

Change-Id: Ic5dc7706476a542f13a942fdae5b347ce28d3f72
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
tests/run.sh

index e2ae595..767a726 100755 (executable)
@@ -55,7 +55,7 @@ get_compute_host_info() {
         fi
         COMPUTE_IP=$(sudo ssh $ssh_opts $INSTALLER_IP \
              "source stackrc; \
-             openstack server show $COMPUTE_HOST \
+             nova show $COMPUTE_HOST \
              | awk '/ ctlplane network /{print \$5}'")
     elif [[ "$INSTALLER_TYPE" == "local" ]] ; then
         COMPUTE_USER=${COMPUTE_USER:-$(whoami)}
@@ -215,13 +215,14 @@ 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 route | awk '/^default/{print $5}')
+dev=$(sudo ip a | awk '/ @COMPUTE_IP@\//{print $7}')
 sleep 1
 sudo ip link set $dev down
 sleep 180
 sudo ip link set $dev up
 sleep 1
 END_TXT
+    sed -i -e "s/@COMPUTE_IP@/$COMPUTE_IP/" disable_network.sh
     chmod +x disable_network.sh
     scp $ssh_opts_cpu disable_network.sh "$COMPUTE_USER@$COMPUTE_IP:"
     ssh $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP" 'nohup ./disable_network.sh > disable_network.log 2>&1 &'