[sheepdog] [PATCH 2/2] tests/functional: add test for qemu reconnection

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jul 23 10:57:10 CEST 2013


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/functional/071       |  94 +++++++++++++++++++++++++++++++
 tests/functional/071.out   | 136 +++++++++++++++++++++++++++++++++++++++++++++
 tests/functional/common.rc |   1 +
 tests/functional/group     |   1 +
 4 files changed, 232 insertions(+)
 create mode 100755 tests/functional/071
 create mode 100644 tests/functional/071.out

diff --git a/tests/functional/071 b/tests/functional/071
new file mode 100755
index 0000000..39fcede
--- /dev/null
+++ b/tests/functional/071
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+# Test qemu reconnection
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+
+trap "_uninit; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_need_to_be_root
+
+_uninit()
+{
+    _cleanup_machine_simulation 0 2> /dev/null
+}
+
+_cleanup
+
+for i in `seq 0 3`; do
+    _start_sheep $i
+done
+
+_wait_for_sheep 4
+
+_cluster_format -c 3
+
+$COLLIE vdi create test 128M
+
+_reboot_sheep()
+{
+    sleep 1
+
+    # emulate network failure (machine is not reachable)
+    _simulate_machine_down $1
+    sleep 1
+
+    # emulate process failure (machine is reachable)
+    _cleanup_machine_simulation $1
+    sleep 1
+
+    _start_sheep $1
+    _wait_for_sheep 4
+}
+
+obj_size=$((4 * 1024 ** 2))
+
+echo reconnection while qemu-io write
+for i in `seq 0 3`; do # doing qemu-io with 4 concurrencies
+    cmd=()
+    for j in `seq 0 7`; do
+	idx=$(($i * 8 + $j))
+	offset=$(($idx * $obj_size))
+	cmd=("${cmd[@]}" -c "write -P $idx $offset $obj_size")
+    done
+    qemu-io "${cmd[@]}" sheepdog:test 2> /dev/null | _filter_qemu_io &
+done | sort &
+_reboot_sheep 0
+wait
+
+echo reconnection while qemu-io read
+for i in `seq 0 3`; do # doing qemu-io with 4 concurrencies
+    cmd=()
+    for j in `seq 0 7`; do
+	idx=$(($i * 8 + $j))
+	offset=$(($idx * $obj_size))
+	cmd=("${cmd[@]}" -c "read -P $idx $offset $obj_size")
+    done
+    qemu-io "${cmd[@]}" sheepdog:test 2> /dev/null | _filter_qemu_io &
+done | sort &
+_reboot_sheep 0
+wait
+
+$COLLIE vdi read test | md5sum
+
+echo reconnection while qemu-img read
+qemu-img convert sheepdog:test $STORE/tmp.img 2> /dev/null &
+_reboot_sheep 0
+wait
+
+echo reconnection while qemu-img write
+qemu-img convert $STORE/tmp.img sheepdog:test2 2> /dev/null &
+_reboot_sheep 0
+wait
+
+$COLLIE vdi read test2 | md5sum
+status=0
diff --git a/tests/functional/071.out b/tests/functional/071.out
new file mode 100644
index 0000000..a1f0edd
--- /dev/null
+++ b/tests/functional/071.out
@@ -0,0 +1,136 @@
+QA output created by 071
+using backend plain store
+reconnection while qemu-io write
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 4194304/4194304 bytes at offset 0
+wrote 4194304/4194304 bytes at offset 100663296
+wrote 4194304/4194304 bytes at offset 104857600
+wrote 4194304/4194304 bytes at offset 109051904
+wrote 4194304/4194304 bytes at offset 113246208
+wrote 4194304/4194304 bytes at offset 117440512
+wrote 4194304/4194304 bytes at offset 121634816
+wrote 4194304/4194304 bytes at offset 12582912
+wrote 4194304/4194304 bytes at offset 125829120
+wrote 4194304/4194304 bytes at offset 130023424
+wrote 4194304/4194304 bytes at offset 16777216
+wrote 4194304/4194304 bytes at offset 20971520
+wrote 4194304/4194304 bytes at offset 25165824
+wrote 4194304/4194304 bytes at offset 29360128
+wrote 4194304/4194304 bytes at offset 33554432
+wrote 4194304/4194304 bytes at offset 37748736
+wrote 4194304/4194304 bytes at offset 4194304
+wrote 4194304/4194304 bytes at offset 41943040
+wrote 4194304/4194304 bytes at offset 46137344
+wrote 4194304/4194304 bytes at offset 50331648
+wrote 4194304/4194304 bytes at offset 54525952
+wrote 4194304/4194304 bytes at offset 58720256
+wrote 4194304/4194304 bytes at offset 62914560
+wrote 4194304/4194304 bytes at offset 67108864
+wrote 4194304/4194304 bytes at offset 71303168
+wrote 4194304/4194304 bytes at offset 75497472
+wrote 4194304/4194304 bytes at offset 79691776
+wrote 4194304/4194304 bytes at offset 8388608
+wrote 4194304/4194304 bytes at offset 83886080
+wrote 4194304/4194304 bytes at offset 88080384
+wrote 4194304/4194304 bytes at offset 92274688
+wrote 4194304/4194304 bytes at offset 96468992
+reconnection while qemu-io read
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 4194304/4194304 bytes at offset 0
+read 4194304/4194304 bytes at offset 100663296
+read 4194304/4194304 bytes at offset 104857600
+read 4194304/4194304 bytes at offset 109051904
+read 4194304/4194304 bytes at offset 113246208
+read 4194304/4194304 bytes at offset 117440512
+read 4194304/4194304 bytes at offset 121634816
+read 4194304/4194304 bytes at offset 12582912
+read 4194304/4194304 bytes at offset 125829120
+read 4194304/4194304 bytes at offset 130023424
+read 4194304/4194304 bytes at offset 16777216
+read 4194304/4194304 bytes at offset 20971520
+read 4194304/4194304 bytes at offset 25165824
+read 4194304/4194304 bytes at offset 29360128
+read 4194304/4194304 bytes at offset 33554432
+read 4194304/4194304 bytes at offset 37748736
+read 4194304/4194304 bytes at offset 4194304
+read 4194304/4194304 bytes at offset 41943040
+read 4194304/4194304 bytes at offset 46137344
+read 4194304/4194304 bytes at offset 50331648
+read 4194304/4194304 bytes at offset 54525952
+read 4194304/4194304 bytes at offset 58720256
+read 4194304/4194304 bytes at offset 62914560
+read 4194304/4194304 bytes at offset 67108864
+read 4194304/4194304 bytes at offset 71303168
+read 4194304/4194304 bytes at offset 75497472
+read 4194304/4194304 bytes at offset 79691776
+read 4194304/4194304 bytes at offset 8388608
+read 4194304/4194304 bytes at offset 83886080
+read 4194304/4194304 bytes at offset 88080384
+read 4194304/4194304 bytes at offset 92274688
+read 4194304/4194304 bytes at offset 96468992
+965b1c8163a4c846f01a76d0a6b85959  -
+reconnection while qemu-img read
+reconnection while qemu-img write
+965b1c8163a4c846f01a76d0a6b85959  -
diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index 0aced36..00c4bbc 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -141,6 +141,7 @@ _die()
 _cleanup()
 {
     local i
+    killall -9 qemu-io qemu-img 2> /dev/null
     _kill_all_collies
     _kill_all_sheeps
 
diff --git a/tests/functional/group b/tests/functional/group
index c16acc7..489248d 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -84,3 +84,4 @@
 068 auto quick cluster
 069 auto quick cluster md
 070 auto quick cluster md
+071 auto quick store md
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list