[sheepdog] [PATCH 0/4] variable vnodes specified by free space

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Aug 7 11:34:22 CEST 2012


At Tue, 07 Aug 2012 15:38:04 +0900,
MORITA Kazutaka wrote:
> 
> At Mon, 6 Aug 2012 08:26:57 -0400,
> Christoph Hellwig wrote:
> > 
> > On Fri, Aug 03, 2012 at 02:59:37PM +0900, MORITA Kazutaka wrote:
> > > This patchset doesn't pass the following test:
> > 
> > Any chance you could share your test scripts?  I'd be happy to volunteer
> > to turn them into a slighly more fancy test suite ala xfstests if I get
> > my hands at them.
> 
> Great, I'll send my test scripts after cleanup.

Here are my scripts.  Please note that those scripts are not
considered to be used by other people.  We need to read the script
outputs carefully to check whether the tests are passed or not.


diff --git a/sdog-tests/cluster/001.sh b/sdog-tests/cluster/001.sh
new file mode 100755
index 0000000..9df1b90
--- /dev/null
+++ b/sdog-tests/cluster/001.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+# start Sheepdog with two nodes
+$COLLIE cluster format
+
+# kill the master node
+pkill -f "sheep $STORE/0"
+sleep 1
+
+# start another sheep
+$SHEEP $STORE/2 -z 2 -p 7002 -c $DRIVER
+sleep 1
+
+# kill all sheeps
+for i in 1 2; do
+    pkill -f "sheep $STORE/$i"
+    sleep 1
+done
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether Sheepdog is running with only one node
+$COLLIE cluster info -p 7002
+
+# add the other nodes
+for i in 0 1; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether all nodes have the same cluster info
+for i in 0 1 2; do
+    $COLLIE cluster info -p 700$i
+done
diff --git a/sdog-tests/cluster/002.sh b/sdog-tests/cluster/002.sh
new file mode 100755
index 0000000..4b827a0
--- /dev/null
+++ b/sdog-tests/cluster/002.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+# start Sheepdog with three nodes
+$COLLIE cluster format
+
+# kill all sheeps
+for i in 0 1 2; do
+    pkill -f "sheep $STORE/$i"
+    sleep 1
+done
+
+# master transfer will happen once
+for i in 1 0 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether Sheepdog is running with only one node
+$COLLIE cluster info -p 7002
+
+# add the other nodes
+for i in 0 1; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether all nodes have the same cluster info
+for i in 0 1 2; do
+    $COLLIE cluster info -p 700$i
+done
diff --git a/sdog-tests/cluster/003.sh b/sdog-tests/cluster/003.sh
new file mode 100755
index 0000000..e0ea8c9
--- /dev/null
+++ b/sdog-tests/cluster/003.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+# start Sheepdog with three nodes
+$COLLIE cluster format
+
+# kill all sheeps
+for i in 0 1 2; do
+    pkill -f "sheep $STORE/$i"
+    sleep 1
+done
+
+# master transfer will happen twice
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether Sheepdog is running with only one node
+$COLLIE cluster info -p 7002
+
+# add the other nodes
+for i in 0 1; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether all nodes have the same cluster info
+for i in 0 1 2; do
+    $COLLIE cluster info -p 700$i
+done
diff --git a/sdog-tests/cluster/004.sh b/sdog-tests/cluster/004.sh
new file mode 100755
index 0000000..5f7f57a
--- /dev/null
+++ b/sdog-tests/cluster/004.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+# start Sheepdog with two nodes
+$COLLIE cluster format -c 2
+
+for i in 2 3 4; do
+    # add one node after killing existing one node
+    pkill -f "sheep $STORE/$((i - 2))"
+    sleep 1
+
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+# kill all existing nodes
+for i in 3 4; do
+    pkill -f "sheep $STORE/$i"
+    sleep 1
+done
+
+for i in 0 1 2 3 4; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether Sheepdog is running with only one node
+$COLLIE cluster info -p 7004
+
+# add the other nodes
+for i in 0 1 2 3; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether all nodes have the same cluster info
+for i in 0 1 2 3 4; do
+    $COLLIE cluster info -p 700$i
+done
diff --git a/sdog-tests/cluster/005.sh b/sdog-tests/cluster/005.sh
new file mode 100755
index 0000000..380763a
--- /dev/null
+++ b/sdog-tests/cluster/005.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+# start Sheepdog with two nodes
+$COLLIE cluster format -c 1
+sleep 1
+
+for i in 2 3 4; do
+    pkill -f "sheep $STORE/$((i - 2))"
+    sleep 1
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+$COLLIE cluster shutdown -p 7004
+sleep 1
+
+for i in 0 1 2 3 4; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether Sheepdog is working with two nodes
+for i in 3 4; do
+    $COLLIE cluster info -p 700$i
+done
+
+# add the other nodes
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+    sleep 1
+done
+
+echo check whether all nodes have the same cluster info
+for i in 0 1 2 3 4; do
+    $COLLIE cluster info -p 700$i
+done
diff --git a/sdog-tests/cluster/006.sh b/sdog-tests/cluster/006.sh
new file mode 100755
index 0000000..bca477d
--- /dev/null
+++ b/sdog-tests/cluster/006.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+$SHEEP $STORE/0 -z 0 -p 7000 -c $DRIVER
+sleep 1
+
+# start Sheepdog with one node
+$COLLIE cluster format
+sleep 1
+
+# launch sheeps simultaneously
+for i in `seq 1 9`; do
+       $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+
+sleep 1
+
+echo check whether all nodes have the same cluster info
+for i in `seq 0 9`; do
+    $COLLIE cluster info -p 700$i
+done
diff --git a/sdog-tests/cluster/007.sh b/sdog-tests/cluster/007.sh
new file mode 100755
index 0000000..4f4657a
--- /dev/null
+++ b/sdog-tests/cluster/007.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+# create a node who has wrong epoch
+$SHEEP $STORE/1 -p 7001 -z 1 -c $DRIVER
+sleep 1
+$COLLIE cluster format -p 7001 -c 1
+$COLLIE cluster shutdown -p 7001
+sleep 1
+
+# start Sheepdog with one node
+$SHEEP $STORE/0 -p 7000 -z 0 -c $DRIVER
+sleep 1
+$COLLIE cluster format -p 7000 -c 1
+
+for i in `seq 0 5`; do
+    $SHEEP $STORE/1 -p 7001 -z 1 -c $DRIVER  # should fail
+    $SHEEP $STORE/2 -p 7002 -z 2 -c $DRIVER  # should succeed
+    sleep 1
+
+    if [ "`$COLLIE node list -p 7002 -r | wc -l`" -ne 2 ]; then
+	echo "test failed"
+	$COLLIE cluster info -p 7000
+	$COLLIE cluster info -p 7002
+	exit 1
+    fi
+
+    pkill -f "$SHEEP $STORE/2"
+    sleep 1
+done
+
+echo "success"
diff --git a/sdog-tests/store/001.sh b/sdog-tests/store/001.sh
new file mode 100755
index 0000000..a6c14cb
--- /dev/null
+++ b/sdog-tests/store/001.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in `seq 0 7`; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+while true; do
+        if [ $($COLLIE node list | wc -l) -ne 9 ]; then
+		sleep 1
+        else
+		break
+        fi
+done
+
+$COLLIE cluster format -c 3
+sleep 1
+
+for i in `seq 0 4`; do
+    $COLLIE vdi create test$i 100M
+done
+
+for i in `seq 0 4`; do
+    dd if=/dev/urandom | $COLLIE vdi write test$i -p 7000 &
+done
+
+sleep 3
+
+echo begin kill
+for i in `seq 1 5`; do
+    pkill -f "$SHEEP $STORE/$i -z $i -p 700$i"
+    sleep 3
+done
+
+for i in `seq 1 5`; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+
+echo wait for object recovery to finish
+while true; do
+        if [ "$(pgrep collie)" ]; then
+                sleep 1
+        else
+                break
+        fi
+done
+
+for i in `seq 0 7`; do
+        for j in `seq 0 4`; do
+                $COLLIE vdi read test$j -p 700$i | md5sum
+        done
+done
diff --git a/sdog-tests/store/002.sh b/sdog-tests/store/002.sh
new file mode 100755
index 0000000..ffb1024
--- /dev/null
+++ b/sdog-tests/store/002.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+# start three sheep daemons
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+
+sleep 1
+$COLLIE cluster format -c 2
+
+# create a pre-allocated vdi
+$COLLIE vdi create test 80M -P
+
+# stop the 3rd node
+pkill -f "$SHEEP $STORE/2"
+
+# write data to the vdi
+cat /dev/urandom | $COLLIE vdi write test
+
+# restart the 3rd node
+$SHEEP $STORE/2 -z 2 -p 7002 -c $DRIVER
+
+# wait for object recovery to finish
+sleep 10
+
+# show md5sum of the vdi on each node
+for i in 0 1 2; do
+    $COLLIE vdi read test -p 700$i | md5sum
+done
diff --git a/sdog-tests/store/003.sh b/sdog-tests/store/003.sh
new file mode 100755
index 0000000..1808a6f
--- /dev/null
+++ b/sdog-tests/store/003.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+$SHEEP $STORE/0 -z 0 -p 7000 -c $DRIVER
+$SHEEP $STORE/1 -z 1 -p 7001 -c $DRIVER
+$COLLIE cluster format -c 2
+$COLLIE cluster recover disable
+
+qemu-img create sheepdog:test 4G
+
+# create 20 objects
+for i in `seq 0 19`; do
+    $COLLIE vdi write test $((i * 4 * 1024 * 1024)) 512 < /dev/zero
+done
+
+$SHEEP $STORE/2 -z 2 -p 7002 -c $DRIVER
+
+# overwrite the objects
+for i in `seq 0 19`; do
+    $COLLIE vdi write test $((i * 4 * 1024 * 1024)) 512 < /dev/zero
+done
diff --git a/sdog-tests/store/004.sh b/sdog-tests/store/004.sh
new file mode 100755
index 0000000..d978a4e
--- /dev/null
+++ b/sdog-tests/store/004.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+dd if=/dev/zero of=$STORE/0.img seek=$((2 * 1024 ** 3 - 1)) bs=1 count=1
+dd if=/dev/zero of=$STORE/1.img seek=$((4 * 1024 ** 3 - 1)) bs=1 count=1
+dd if=/dev/zero of=$STORE/2.img seek=$((8 * 1024 ** 3 - 1)) bs=1 count=1
+
+for i in 0 1 2; do
+    mkfs.xfs $STORE/$i.img
+    mkdir $STORE/$i
+    mount -o loop $STORE/$i.img $STORE/$i
+    $SHEEP $STORE/$i/ -z $i -p 700$i -c $DRIVER
+done
+
+sleep 1
+
+echo check the number of vnodes
+for i in 0 1 2; do
+    $COLLIE node list -p 700$i
+done
diff --git a/sdog-tests/store/005.sh b/sdog-tests/store/005.sh
new file mode 100755
index 0000000..21208fa
--- /dev/null
+++ b/sdog-tests/store/005.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i/ -z $i -p 700$i -c $DRIVER
+done
+
+# add gateway node
+$SHEEP $STORE/4/ -z 4 -p 7004 -c $DRIVER -g
+
+sleep 1
+
+echo check the number of vnodes
+$COLLIE node list
diff --git a/sdog-tests/vdi/001.sh b/sdog-tests/vdi/001.sh
new file mode 100755
index 0000000..26a39c1
--- /dev/null
+++ b/sdog-tests/vdi/001.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -p 700$i -z $i -c $DRIVER
+done
+
+sleep 1
+
+$COLLIE cluster format -c 1
+
+qemu-img create sheepdog:test 4G
+for i in `seq 1 9`; do
+    qemu-io -c "write 0 512 -P $i" sheepdog:test
+    qemu-img snapshot -c tag$i sheepdog:test
+done
+
+qemu-io -c "read 0 512 -P 9" sheepdog:test
+for i in `seq 1 9`; do
+    qemu-io -c "read 0 512 -P $i" sheepdog:test:tag$i
+done
diff --git a/sdog-tests/vdi/002.sh b/sdog-tests/vdi/002.sh
new file mode 100755
index 0000000..2f7cf3d
--- /dev/null
+++ b/sdog-tests/vdi/002.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+
+sleep 1
+
+$COLLIE cluster format -c 2
+$COLLIE vdi create test 4G
+
+echo -n value > $STORE/tmp.dat
+
+echo "key shouldn't be found"
+$COLLIE vdi getattr test key || true
+
+$COLLIE vdi setattr test key value
+$COLLIE vdi getattr test key | diff - $STORE/tmp.dat
+
+$COLLIE vdi setattr test key value -d
+
+echo "key shouldn't be found"
+$COLLIE vdi getattr test key || true
diff --git a/sdog-tests/vdi/003.sh b/sdog-tests/vdi/003.sh
new file mode 100755
index 0000000..c39c9bd
--- /dev/null
+++ b/sdog-tests/vdi/003.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 2; do
+    $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+
+sleep 1
+
+$COLLIE cluster format -c 2
+$COLLIE vdi create test 539545600
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi write test 512 512 < /dev/zero
+echo "there should be 3 setattr errors"
+
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi write test 512 512 < /dev/zero
+echo "there should be 8 setattr errors"
+
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi write test 512 512 < /dev/zero
+echo "there should be 6 setattr errors"
+
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi setattr test lock 1 -x &
+$COLLIE vdi write test 512 512 < /dev/zero
+echo "there should be 5 setattr errors"
diff --git a/sdog-tests/vdi/004.sh b/sdog-tests/vdi/004.sh
new file mode 100755
index 0000000..91fe654
--- /dev/null
+++ b/sdog-tests/vdi/004.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -p 700$i -z $i -c $DRIVER
+done
+
+sleep 1;
+
+$COLLIE cluster format -c 3
+$COLLIE vdi create base 100M -P
+
+qemu-img snapshot -c tag sheepdog:base
+
+sleep 1
+
+$COLLIE vdi clone -s 1 base test
+
+sleep 1
+
+$COLLIE vdi delete test
+
+sleep 1
+$COLLIE vdi delete base
+
+sleep 1
+$COLLIE vdi delete -s 1 base
+
+sleep 3
+echo there should be no vdi
+$COLLIE vdi list
+
+echo there should be no object
+$COLLIE node info
diff --git a/sdog-tests/vdi/005.sh b/sdog-tests/vdi/005.sh
new file mode 100755
index 0000000..b80a6f4
--- /dev/null
+++ b/sdog-tests/vdi/005.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+set -ex
+
+DRIVER=${DRIVER:-local}
+STORE=${STORE:-/tmp/sheepdog}
+SHEEP=${SHEEP:-./sheep/sheep}
+COLLIE=${COLLIE:-./collie/collie}
+
+killall -9 sheep collie || true
+sleep 1
+rm -r $STORE/* || true
+mkdir -p $STORE
+
+for i in 0 1 2; do
+    $SHEEP $STORE/$i -p 700$i -z $i -c $DRIVER
+done
+
+sleep 1
+
+$COLLIE cluster format -c 1
+
+qemu-img create sheepdog:test 4G
+qemu-img snapshot -c tag1 sheepdog:test
+qemu-img snapshot -c tag2 sheepdog:test
+qemu-img snapshot -c tag3 sheepdog:test
+
+qemu-img create sheepdog:test2 4G
+qemu-img snapshot -c tag1 sheepdog:test2
+qemu-img snapshot -c tag2 sheepdog:test2
+qemu-io -c "write 0 512" sheepdog:test2:1
+qemu-img snapshot -c tag3 sheepdog:test2
+
+$COLLIE vdi tree
+
+# expected results:
+#
+# test---[2012-08-07 18:04]---[2012-08-07 18:04]---[2012-08-07 18:04]---(you are here)
+# test2---[2012-08-07 18:04]-+-[2012-08-07 18:04]---[2012-08-07 18:04]
+#                            `-[2012-08-07 18:04]---(you are here)



More information about the sheepdog mailing list