[sheepdog] [PATCH v1 2/2] test: add test case for disk fail when sheep has different size of paths

Robin Dong robin.k.dong at gmail.com
Wed Jun 11 11:14:11 CEST 2014


From: Robin Dong <sanbai at taobao.com>

Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 tests/functional/094     | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/functional/094.out |  2 ++
 tests/functional/group   |  1 +
 3 files changed, 53 insertions(+)
 create mode 100755 tests/functional/094
 create mode 100644 tests/functional/094.out

diff --git a/tests/functional/094 b/tests/functional/094
new file mode 100755
index 0000000..5d8510a
--- /dev/null
+++ b/tests/functional/094
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Test disk error handling on different size of disks
+
+. ./common
+
+# make different size of devices
+for i in `seq 0 2`; do
+	dd if=/dev/zero of=$STORE/big$i.img seek=1048576 bs=1M count=1 &> /dev/null
+	dd if=/dev/zero of=$STORE/small$i.img seek=512 bs=1M count=1 &> /dev/null
+
+	mkops="-t ext4 -q -F -O ^has_journal -I 128 -N 100"
+	mntops="-o user_xattr"
+
+	mkfs $mkops $STORE/big$i.img 2>&1
+	mkdir -p $STORE/$i/d0
+	mount -o loop $mntops $STORE/big$i.img $STORE/$i/d0
+
+	mkfs $mkops $STORE/small$i.img 2>&1
+	mkdir -p $STORE/$i/d1
+	mount -o loop $mntops $STORE/small$i.img $STORE/$i/d1
+done
+
+for i in `seq 0 2`; do
+	MD_STORE=",$STORE/$i/d0,$STORE/$i/d1"
+	_start_sheep $i
+done
+
+_wait_for_sheep 3
+
+_cluster_format -c 2:1
+
+_vdi_create test 99M
+
+_random | $DOG vdi write test
+
+$DOG vdi read test | md5sum > $STORE/csum.1
+
+# remove obj directory to occut EIO
+umount $STORE/0/d0
+rm -rf $STORE/0/d0
+
+$DOG vdi read test | md5sum > $STORE/csum.2
+
+diff -u $STORE/csum.1 $STORE/csum.2
+
+for i in `seq 0 2`; do
+	umount $STORE/$i/d0 &> /dev/null
+	umount $STORE/$i/d1 &> /dev/null
+done
diff --git a/tests/functional/094.out b/tests/functional/094.out
new file mode 100644
index 0000000..5bbecaa
--- /dev/null
+++ b/tests/functional/094.out
@@ -0,0 +1,2 @@
+QA output created by 094
+using backend plain store
diff --git a/tests/functional/group b/tests/functional/group
index f3e9d30..340a1cc 100644
--- a/tests/functional/group
+++ b/tests/functional/group
@@ -108,3 +108,4 @@
 091 auto quick cluster md
 092 auto quick vdi
 093 auto quick vdi
+094 auto quick store md
-- 
1.7.12.4




More information about the sheepdog mailing list