[sheepdog] [PATCH 3/3] tests: add 058 to test discard/trim

Liu Yuan namei.unix at gmail.com
Sat Apr 13 13:27:21 CEST 2013


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/058     |   30 ++++++++++++++++++++++++++++++
 tests/058.out |   44 ++++++++++++++++++++++++++++++++++++++++++++
 tests/group   |    1 +
 3 files changed, 75 insertions(+)
 create mode 100755 tests/058
 create mode 100644 tests/058.out

diff --git a/tests/058 b/tests/058
new file mode 100755
index 0000000..0eddc81
--- /dev/null
+++ b/tests/058
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Test discard/trim
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
+
+for i in 0 1 2; do
+	_start_sheep $i "-s 1000"
+done
+_wait_for_sheep 3
+$COLLIE cluster format
+sleep 1
+$COLLIE vdi create test 100M -P
+$COLLIE node info
+qemu-io -c "discard 0 100m" sheepdog:test | _filter_qemu_io
+$COLLIE vdi check test
+for i in `seq 0 24`; do
+	$COLLIE vdi object test -i $i;
+done
+$COLLIE node info
diff --git a/tests/058.out b/tests/058.out
new file mode 100644
index 0000000..140e5c0
--- /dev/null
+++ b/tests/058.out
@@ -0,0 +1,44 @@
+QA output created by 058
+using backend farm store
+Id	Size	Used	Use%
+ 0	1000 MB	104 MB	 10%
+ 1	1000 MB	104 MB	 10%
+ 2	1000 MB	104 MB	 10%
+Total	2.9 GB	312 MB	 10%
+
+Total virtual image size	100 MB
+discard 104857600/104857600 bytes at offset 0
+100 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+finish check&repair test
+The inode object 0x7c2b25 idx 0 is not allocated
+The inode object 0x7c2b25 idx 1 is not allocated
+The inode object 0x7c2b25 idx 2 is not allocated
+The inode object 0x7c2b25 idx 3 is not allocated
+The inode object 0x7c2b25 idx 4 is not allocated
+The inode object 0x7c2b25 idx 5 is not allocated
+The inode object 0x7c2b25 idx 6 is not allocated
+The inode object 0x7c2b25 idx 7 is not allocated
+The inode object 0x7c2b25 idx 8 is not allocated
+The inode object 0x7c2b25 idx 9 is not allocated
+The inode object 0x7c2b25 idx 10 is not allocated
+The inode object 0x7c2b25 idx 11 is not allocated
+The inode object 0x7c2b25 idx 12 is not allocated
+The inode object 0x7c2b25 idx 13 is not allocated
+The inode object 0x7c2b25 idx 14 is not allocated
+The inode object 0x7c2b25 idx 15 is not allocated
+The inode object 0x7c2b25 idx 16 is not allocated
+The inode object 0x7c2b25 idx 17 is not allocated
+The inode object 0x7c2b25 idx 18 is not allocated
+The inode object 0x7c2b25 idx 19 is not allocated
+The inode object 0x7c2b25 idx 20 is not allocated
+The inode object 0x7c2b25 idx 21 is not allocated
+The inode object 0x7c2b25 idx 22 is not allocated
+The inode object 0x7c2b25 idx 23 is not allocated
+The inode object 0x7c2b25 idx 24 is not allocated
+Id	Size	Used	Use%
+ 0	1000 MB	4.0 MB	  0%
+ 1	1000 MB	4.0 MB	  0%
+ 2	1000 MB	4.0 MB	  0%
+Total	2.9 GB	12 MB	  0%
+
+Total virtual image size	100 MB
diff --git a/tests/group b/tests/group
index c82ddf9..09f2857 100644
--- a/tests/group
+++ b/tests/group
@@ -71,3 +71,4 @@
 055 auto cluster md
 056 auto quick cluster md
 057 auto quick cluster md
+058 auto quick cluster md
-- 
1.7.9.5




More information about the sheepdog mailing list