summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2016-01-29 13:56:44 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-01-29 13:56:44 +0000
commit67a45e55d8cd3fbef20864034527f0f56a9464b1 (patch)
treefed260d79320e150e59bea3846068b794564c7ba
parentf4f79f2f4a9cc58171c1f852ede43b3ea0667450 (diff)
parentae1cdea548f27874fada081110f853fd1b3cad91 (diff)
Merge "tests: fix inject_failure() for deployment built by apex" into stable/brahmaputra
-rwxr-xr-xtests/run.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/run.sh b/tests/run.sh
index c7956ea2..7bb0da28 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -8,20 +8,21 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-#branch=$(git rev-parse --abbrev-ref HEAD)
-BRANCH=master
-
IMAGE_URL=https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
IMAGE_NAME=cirros
IMAGE_FILE="${IMAGE_NAME}.img"
IMAGE_FORMAT=qcow2
VM_NAME=doctor_vm1
VM_FLAVOR=m1.tiny
-COMPUTE_HOST='s142'
ALARM_NAME=doctor_alarm1
INSPECTOR_PORT=12345
CONSUMER_PORT=12346
+# NOTE: You have to be changed these paramas depends on your machine,
+# installer and configs.
+COMPUTE_HOST='192.0.2.8'
+SSH_TO_COMPUTE_HOST="ssh heat-admin@$COMPUTE_HOST"
+
download_image() {
[ -e "$IMAGE_FILE" ] && return 0
@@ -103,8 +104,19 @@ wait_for_vm_launch() {
}
inject_failure() {
- #FIXME
- echo ssh $COMPUTE_HOST "ip link set eno1 down"
+ echo "disabling network of comupte host [$COMPUTE_HOST] for 3 mins..."
+ $SSH_TO_COMPUTE_HOST "
+cat > disable_network.sh << 'END_TXT'
+#!/bin/bash
+dev=\$(/usr/sbin/ip route | awk '/^default/{print \$5}')
+sleep 1
+echo sudo ip link set \$dev down
+sleep 180
+echo sudo ip link set \$dev up
+sleep 1
+END_TXT
+chmod +x disable_network.sh
+nohup ./disable_network.sh > c 2>&1 &"
}
calculate_notification_time() {