[sheepdog] [PATCH 6/9] tests: add test of disk full handling

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Sep 17 00:59:59 CEST 2012


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/042     |   58 +++++++++++++++++++++++
 tests/042.out |  146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/group   |    1 +
 3 files changed, 205 insertions(+), 0 deletions(-)
 create mode 100755 tests/042
 create mode 100644 tests/042.out

diff --git a/tests/042 b/tests/042
new file mode 100755
index 0000000..b6aa54d
--- /dev/null
+++ b/tests/042
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Test disk full handling
+
+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
+
+_make_device 0 $((1024 ** 3))
+_make_device 1 $((1024 ** 3))
+_make_device 2 $((20 * 1024 ** 2))
+_make_device 3 $((20 * 1024 ** 2))
+
+# create log files of sheep 2 and 3 on other places
+touch $STORE/0/sheep2.log $STORE/0/sheep3.log
+ln -s $STORE/0/sheep2.log $STORE/2/sheep.log
+ln -s $STORE/0/sheep3.log $STORE/3/sheep.log
+
+for i in `seq 0 3`; do
+    _start_sheep $i "-s $((1024 * 1024))"
+done
+
+_wait_for_sheep 4
+
+$COLLIE cluster format
+
+# create two VDIs before there are enough spaces
+$COLLIE vdi create test0 100M
+$COLLIE vdi create test1 100M
+
+# make sheep 0 and 1 disk full
+dd if=/dev/zero of=$STORE/2/zero > /dev/null 2>&1
+dd if=/dev/zero of=$STORE/3/zero > /dev/null 2>&1
+
+# test data write against disk-full cluster
+for i in `seq 0 10`; do
+    echo $i | $COLLIE vdi write test0 $((i * 4 * 1024 * 1024)) 512 -p 7000
+    echo $i | $COLLIE vdi write test1 $((i * 4 * 1024 * 1024)) 512 -p 7002
+done
+
+# test vdi creation against disk-full cluster
+$COLLIE vdi create test2 100M -p 7000
+$COLLIE vdi create test3 100M -p 7002
+
+for i in `seq 0 3`; do
+    $COLLIE node info -p 700$i
+    $COLLIE node list -p 700$i
+done
+ls $STORE/*/obj/* | sort
diff --git a/tests/042.out b/tests/042.out
new file mode 100644
index 0000000..f20ef5c
--- /dev/null
+++ b/tests/042.out
@@ -0,0 +1,146 @@
+QA output created by 042
+using backend farm store
+Failed to write object fd34af00000000: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000000: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000001: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000001: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000002: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000002: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000003: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000003: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000004: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000004: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000005: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000005: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000006: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000006: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000007: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000007: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000008: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000008: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af00000009: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc00000009: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd34af0000000a: Server has no space for new objects
+Failed to write VDI
+Failed to write object fd32fc0000000a: Server has no space for new objects
+Failed to write VDI
+Failed to create VDI test2: Failed to write to requested VDI
+Failed to create VDI test3: Failed to write to requested VDI
+Id	Size	Used	Use%
+ 0	1.0 TB	96 MB	  0%
+ 1	1.0 TB	80 MB	  0%
+ 2	1.0 TB	0.0 MB	  0%
+ 3	1.0 TB	8.0 MB	  0%
+Total	4.0 TB	184 MB	  0%
+
+Total virtual image size	200 MB
+M   Id   Host:Port         V-Nodes       Zone
+-    0   127.0.0.1:7000      	64          0
+-    1   127.0.0.1:7001      	64          1
+-    2   127.0.0.1:7002      	64          2
+-    3   127.0.0.1:7003      	64          3
+Id	Size	Used	Use%
+ 0	1.0 TB	96 MB	  0%
+ 1	1.0 TB	80 MB	  0%
+ 2	1.0 TB	0.0 MB	  0%
+ 3	1.0 TB	8.0 MB	  0%
+Total	4.0 TB	184 MB	  0%
+
+Total virtual image size	200 MB
+M   Id   Host:Port         V-Nodes       Zone
+-    0   127.0.0.1:7000      	64          0
+-    1   127.0.0.1:7001      	64          1
+-    2   127.0.0.1:7002      	64          2
+-    3   127.0.0.1:7003      	64          3
+Id	Size	Used	Use%
+ 0	1.0 TB	96 MB	  0%
+ 1	1.0 TB	80 MB	  0%
+ 2	1.0 TB	0.0 MB	  0%
+ 3	1.0 TB	8.0 MB	  0%
+Total	4.0 TB	184 MB	  0%
+
+Total virtual image size	200 MB
+M   Id   Host:Port         V-Nodes       Zone
+-    0   127.0.0.1:7000      	64          0
+-    1   127.0.0.1:7001      	64          1
+-    2   127.0.0.1:7002      	64          2
+-    3   127.0.0.1:7003      	64          3
+Id	Size	Used	Use%
+ 0	1.0 TB	96 MB	  0%
+ 1	1.0 TB	80 MB	  0%
+ 2	1.0 TB	0.0 MB	  0%
+ 3	1.0 TB	8.0 MB	  0%
+Total	4.0 TB	184 MB	  0%
+
+Total virtual image size	200 MB
+M   Id   Host:Port         V-Nodes       Zone
+-    0   127.0.0.1:7000      	64          0
+-    1   127.0.0.1:7001      	64          1
+-    2   127.0.0.1:7002      	64          2
+-    3   127.0.0.1:7003      	64          3
+/tmp/sheepdog/0/obj/00fd32fc00000000
+/tmp/sheepdog/0/obj/00fd32fc00000001
+/tmp/sheepdog/0/obj/00fd32fc00000002
+/tmp/sheepdog/0/obj/00fd32fc00000003
+/tmp/sheepdog/0/obj/00fd32fc00000004
+/tmp/sheepdog/0/obj/00fd32fc00000005
+/tmp/sheepdog/0/obj/00fd32fc00000006
+/tmp/sheepdog/0/obj/00fd32fc00000007
+/tmp/sheepdog/0/obj/00fd32fc00000008
+/tmp/sheepdog/0/obj/00fd32fc00000009
+/tmp/sheepdog/0/obj/00fd32fc0000000a
+/tmp/sheepdog/0/obj/00fd34af00000000
+/tmp/sheepdog/0/obj/00fd34af00000001
+/tmp/sheepdog/0/obj/00fd34af00000002
+/tmp/sheepdog/0/obj/00fd34af00000003
+/tmp/sheepdog/0/obj/00fd34af00000004
+/tmp/sheepdog/0/obj/00fd34af00000005
+/tmp/sheepdog/0/obj/00fd34af00000006
+/tmp/sheepdog/0/obj/00fd34af00000007
+/tmp/sheepdog/0/obj/00fd34af00000008
+/tmp/sheepdog/0/obj/00fd34af0000000a
+/tmp/sheepdog/0/obj/80fd32fc00000000
+/tmp/sheepdog/0/obj/80fd34af00000000
+/tmp/sheepdog/0/obj/80fd381500000000
+/tmp/sheepdog/1/obj/00fd32fc00000000
+/tmp/sheepdog/1/obj/00fd32fc00000001
+/tmp/sheepdog/1/obj/00fd32fc00000002
+/tmp/sheepdog/1/obj/00fd32fc00000003
+/tmp/sheepdog/1/obj/00fd32fc00000005
+/tmp/sheepdog/1/obj/00fd32fc00000006
+/tmp/sheepdog/1/obj/00fd32fc00000007
+/tmp/sheepdog/1/obj/00fd32fc00000008
+/tmp/sheepdog/1/obj/00fd34af00000000
+/tmp/sheepdog/1/obj/00fd34af00000001
+/tmp/sheepdog/1/obj/00fd34af00000002
+/tmp/sheepdog/1/obj/00fd34af00000003
+/tmp/sheepdog/1/obj/00fd34af00000004
+/tmp/sheepdog/1/obj/00fd34af00000006
+/tmp/sheepdog/1/obj/00fd34af00000009
+/tmp/sheepdog/1/obj/00fd34af0000000a
+/tmp/sheepdog/1/obj/80fd32fc00000000
+/tmp/sheepdog/1/obj/80fd34af00000000
+/tmp/sheepdog/1/obj/80fd366200000000
+/tmp/sheepdog/1/obj/80fd381500000000
+/tmp/sheepdog/3/obj/80fd32fc00000000
+/tmp/sheepdog/3/obj/80fd34af00000000
diff --git a/tests/group b/tests/group
index 8752c08..acdbda3 100644
--- a/tests/group
+++ b/tests/group
@@ -53,3 +53,4 @@
 039 auto quick vdi
 040 auto quick cluster
 041 auto quick vdi
+042 auto quick store
-- 
1.7.2.5




More information about the sheepdog mailing list