Browse files

initial xfstests-style test suite

Run using "./check" in the test directory, individual tests can be run
using "./check 003", various other options are also supported.

Test 002 is disable for now due to the lack of golden output, cluster drivers
other than local aren't tested at the moment but will be supported soon.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
  • Loading branch information...
1 parent fd403d5 commit 9a8549df7a6d800a2a1c64f5f1230568722b3664 Christoph Hellwig committed with kazum Aug 10, 2012
View
23 tests/cluster/001.sh → tests/001
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1; do
$SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
@@ -40,7 +41,7 @@ for i in 0 1 2; do
done
echo check whether Sheepdog is running with only one node
-$COLLIE cluster info -p 7002
+$COLLIE cluster info -p 7002 | _filter_cluster_info
# add the other nodes
for i in 0 1; do
@@ -50,5 +51,5 @@ done
echo check whether all nodes have the same cluster info
for i in 0 1 2; do
- $COLLIE cluster info -p 700$i
+ $COLLIE cluster info -p 700$i | _filter_cluster_info
done
View
46 tests/001.out
@@ -0,0 +1,46 @@
+QA output created by 001
+using backend farm store
+check whether Sheepdog is running with only one node
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 []
+DATE 1 []
+check whether all nodes have the same cluster info
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 6 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+DATE 5 [127.0.0.1:7000, 127.0.0.1:7002]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 6 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+DATE 5 [127.0.0.1:7000, 127.0.0.1:7002]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 6 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+DATE 5 [127.0.0.1:7000, 127.0.0.1:7002]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
View
23 tests/cluster/002.sh → tests/002
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1 2; do
$SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
@@ -33,7 +34,7 @@ for i in 1 0 2; do
done
echo check whether Sheepdog is running with only one node
-$COLLIE cluster info -p 7002
+$COLLIE cluster info -p 7002 | _filter_cluster_info
# add the other nodes
for i in 0 1; do
@@ -43,5 +44,5 @@ done
echo check whether all nodes have the same cluster info
for i in 0 1 2; do
- $COLLIE cluster info -p 700$i
+ $COLLIE cluster info -p 700$i | _filter_cluster_info
done
View
23 tests/cluster/003.sh → tests/003
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1 2; do
$SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
@@ -33,7 +34,7 @@ for i in 0 1 2; do
done
echo check whether Sheepdog is running with only one node
-$COLLIE cluster info -p 7002
+$COLLIE cluster info -p 7002 | _filter_cluster_info
# add the other nodes
for i in 0 1; do
@@ -43,5 +44,5 @@ done
echo check whether all nodes have the same cluster info
for i in 0 1 2; do
- $COLLIE cluster info -p 700$i
+ $COLLIE cluster info -p 700$i | _filter_cluster_info
done
View
42 tests/003.out
@@ -0,0 +1,42 @@
+QA output created by 003
+using backend farm store
+check whether Sheepdog is running with only one node
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 3 [127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+check whether all nodes have the same cluster info
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 5 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+DATE 4 [127.0.0.1:7000, 127.0.0.1:7002]
+DATE 3 [127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 5 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+DATE 4 [127.0.0.1:7000, 127.0.0.1:7002]
+DATE 3 [127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 5 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
+DATE 4 [127.0.0.1:7000, 127.0.0.1:7002]
+DATE 3 [127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002]
View
23 tests/cluster/004.sh → tests/004
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1; do
$SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
@@ -41,7 +42,7 @@ for i in 0 1 2 3 4; do
done
echo check whether Sheepdog is running with only one node
-$COLLIE cluster info -p 7004
+$COLLIE cluster info -p 7004 | _filter_cluster_info
# add the other nodes
for i in 0 1 2 3; do
@@ -51,5 +52,5 @@ 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
+ $COLLIE cluster info -p 700$i | _filter_cluster_info
done
View
102 tests/004.out
@@ -0,0 +1,102 @@
+QA output created by 004
+using backend farm store
+check whether Sheepdog is running with only one node
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 8 [127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 []
+DATE 5 []
+DATE 4 []
+DATE 3 []
+DATE 2 []
+DATE 1 []
+check whether all nodes have the same cluster info
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 12 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 11 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 12 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 11 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 12 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 11 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 12 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 11 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 12 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 11 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7004]
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
View
23 tests/cluster/005.sh → tests/005
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1; do
$SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
@@ -38,7 +39,7 @@ done
echo check whether Sheepdog is working with two nodes
for i in 3 4; do
- $COLLIE cluster info -p 700$i
+ $COLLIE cluster info -p 700$i | _filter_cluster_info
done
# add the other nodes
@@ -49,5 +50,5 @@ 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
+ $COLLIE cluster info -p 700$i | _filter_cluster_info
done
View
103 tests/005.out
@@ -0,0 +1,103 @@
+QA output created by 005
+using backend farm store
+check whether Sheepdog is working with two nodes
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 []
+DATE 3 []
+DATE 2 []
+DATE 1 []
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 []
+DATE 3 []
+DATE 2 []
+DATE 1 []
+check whether all nodes have the same cluster info
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7000, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7000, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7000, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7000, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
+Cluster status: running
+
+Cluster created at DATE
+
+Epoch Time Version
+DATE 10 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7002, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 9 [127.0.0.1:7000, 127.0.0.1:7001, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 8 [127.0.0.1:7000, 127.0.0.1:7003, 127.0.0.1:7004]
+DATE 7 [127.0.0.1:7003, 127.0.0.1:7004]
+DATE 6 [127.0.0.1:7003]
+DATE 5 [127.0.0.1:7002, 127.0.0.1:7003]
+DATE 4 [127.0.0.1:7002]
+DATE 3 [127.0.0.1:7001, 127.0.0.1:7002]
+DATE 2 [127.0.0.1:7001]
+DATE 1 [127.0.0.1:7000, 127.0.0.1:7001]
View
36 tests/006
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+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
+
+$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 | _filter_cluster_info > /tmp/cinfo.$i
+done
+for i in `seq 1 9`; do
+ diff -u /tmp/cinfo.0 /tmp/cinfo.$i
+done
View
3 tests/006.out
@@ -0,0 +1,3 @@
+QA output created by 006
+using backend farm store
+check whether all nodes have the same cluster info
View
24 tests/cluster/007.sh → tests/007
@@ -1,16 +1,18 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
-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
@@ -31,8 +33,8 @@ for i in `seq 0 5`; do
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
+ $COLLIE cluster info -p 7000 | _filter_cluster_info
+ $COLLIE cluster info -p 7002 | _filter_cluster_info
exit 1
fi
View
4 tests/007.out
@@ -0,0 +1,4 @@
+QA output created by 007
+using backend farm store
+using backend farm store
+success
View
66 tests/008
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+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 `seq 0 7`; do
+ $SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
+done
+
+while true; do
+ sleep 2
+ if [ $($COLLIE node list | wc -l) -eq 9 ]; then
+ 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 4`; do
+ for port in `seq 0 7`; do
+ $COLLIE vdi read test$i -p 700$port | md5sum > /tmp/csum.$port
+ done
+ for port in `seq 1 7`; do
+ diff -u /tmp/csum.0 /tmp/csum.$port
+ done
+done
View
4 tests/008.out
@@ -0,0 +1,4 @@
+QA output created by 008
+using backend farm store
+begin kill
+wait for object recovery to finish
View
24 tests/store/002.sh → tests/009
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
# start three sheep daemons
for i in 0 1 2; do
@@ -37,5 +38,8 @@ 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
+ $COLLIE vdi read test -p 700$i | md5sum > /tmp/csum.$i
done
+
+diff -u /tmp/csum.0 /tmp/csum.1
+diff -u /tmp/csum.0 /tmp/csum.2
View
2 tests/009.out
@@ -0,0 +1,2 @@
+QA output created by 009
+using backend farm store
View
22 tests/store/003.sh → tests/010
@@ -1,19 +1,23 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
$SHEEP $STORE/0 -z 0 -p 7000 -c $DRIVER
$SHEEP $STORE/1 -z 1 -p 7001 -c $DRIVER
+
+sleep 2
+
$COLLIE cluster format -c 2
$COLLIE cluster recover disable
View
5 tests/010.out
@@ -0,0 +1,5 @@
+QA output created by 010
+using backend farm store
+*Note*: Only disable the recovery caused by JOIN envets
+Cluster recovery: disable
+Formatting 'sheepdog:test', fmt=raw size=4294967296
View
46 tests/011
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+trap "_cleanup_devices; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup_devices()
+{
+ killall -9 sheep collie >/dev/null 2>&1 || true
+ sleep 2
+ for i in 0 1 2; do
+ umount $STORE/$i.img
+ rm -f $STORE/$i.img
+ done
+}
+
+_cleanup
+
+dd if=/dev/zero of=$STORE/0.img seek=$((2 * 1024 ** 3 - 1)) bs=1 count=1 > $seq.full 2>&1
+dd if=/dev/zero of=$STORE/1.img seek=$((4 * 1024 ** 3 - 1)) bs=1 count=1 > $seq.full 2>&1
+dd if=/dev/zero of=$STORE/2.img seek=$((8 * 1024 ** 3 - 1)) bs=1 count=1 > $seq.full 2>&1
+
+for i in 0 1 2; do
+ mkfs.xfs -f $STORE/$i.img > $seq.full
+ 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
+
+status=0
View
14 tests/011.out
@@ -0,0 +1,14 @@
+QA output created by 011
+check the number of vnodes
+M Id Host:Port V-Nodes Zone
+- 0 127.0.0.1:7000 27 0
+- 1 127.0.0.1:7001 54 1
+- 2 127.0.0.1:7002 110 2
+M Id Host:Port V-Nodes Zone
+- 0 127.0.0.1:7000 27 0
+- 1 127.0.0.1:7001 54 1
+- 2 127.0.0.1:7002 110 2
+M Id Host:Port V-Nodes Zone
+- 0 127.0.0.1:7000 27 0
+- 1 127.0.0.1:7001 54 1
+- 2 127.0.0.1:7002 110 2
View
19 tests/store/005.sh → tests/012
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1 2; do
$SHEEP $STORE/$i/ -z $i -p 700$i -c $DRIVER
View
7 tests/012.out
@@ -0,0 +1,7 @@
+QA output created by 012
+check the number of vnodes
+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:7004 0 4
View
33 tests/013
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+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
+ $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 | _filter_qemu_io
+ qemu-img snapshot -c tag$i sheepdog:test
+done
+
+qemu-io -c "read 0 512 -P 9" sheepdog:test | _filter_qemu_io
+for i in `seq 1 9`; do
+ qemu-io -c "read 0 512 -P $i" sheepdog:test:tag$i | _filter_qemu_io
+done
View
41 tests/013.out
@@ -0,0 +1,41 @@
+QA output created by 013
+using backend farm store
+Formatting 'sheepdog:test', fmt=raw size=4294967296
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
View
27 tests/vdi/002.sh → tests/014
@@ -1,35 +1,38 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
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 cluster format -c 2 >> $0.full
$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 getattr test key
$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
+$COLLIE vdi getattr test key
+
+status=0
View
5 tests/014.out
@@ -0,0 +1,5 @@
+QA output created by 014
+key shouldn't be found
+Attribute 'key' not found
+key shouldn't be found
+Attribute 'key' not found
View
19 tests/vdi/003.sh → tests/015
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 2; do
$SHEEP $STORE/$i -z $i -p 700$i -c $DRIVER
View
28 tests/015.out
@@ -0,0 +1,28 @@
+QA output created by 015
+using backend farm store
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+there should be 3 setattr errors
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+there should be 8 setattr errors
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+there should be 6 setattr errors
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+The attribute 'lock' already exists
+there should be 5 setattr errors
View
19 tests/vdi/004.sh → tests/016
@@ -1,16 +1,17 @@
#!/bin/bash
-set -ex
+seq=`basename $0`
+echo "QA output created by $seq"
-DRIVER=${DRIVER:-local}
-STORE=${STORE:-/tmp/sheepdog}
-SHEEP=${SHEEP:-./sheep/sheep}
-COLLIE=${COLLIE:-./collie/collie}
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
-killall -9 sheep collie || true
-sleep 1
-rm -r $STORE/* || true
-mkdir -p $STORE
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_cleanup
for i in 0 1 2; do
$SHEEP $STORE/$i -p 700$i -z $i -c $DRIVER
View
12 tests/016.out
@@ -0,0 +1,12 @@
+QA output created by 016
+using backend farm store
+there should be no vdi
+ Name Id Size Used Shared Creation time VDI id Tag
+there should be no object
+Id Size Used Use%
+ 0 4.0 GB 12 MB 0%
+ 1 4.0 GB 12 MB 0%
+ 2 4.0 GB 12 MB 0%
+Total 12 GB 36 MB 0%
+
+Total virtual image size 0.0 MB
View
35 tests/017
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+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
+ $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 | _filter_qemu_io
+qemu-img snapshot -c tag3 sheepdog:test2
+
+$COLLIE vdi tree | _filter_short_date
View
9 tests/017.out
@@ -0,0 +1,9 @@
+QA output created by 017
+using backend farm store
+Formatting 'sheepdog:test', fmt=raw size=4294967296
+Formatting 'sheepdog:test2', fmt=raw size=4294967296
+wrote 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+test---[DATE]---[DATE]---[DATE]---(you are here)
+test2---[DATE]-+-[DATE]---[DATE]
+ `-[DATE]---(you are here)
View
492 tests/check
@@ -0,0 +1,492 @@
+#!/bin/bash
+#
+# Copyright (C) 2009 Red Hat, Inc.
+# Copyright (c) 2000-2002,2005-2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+# Control script for QA
+#
+
+tmp=/tmp/$$
+status=0
+needwrap=true
+try=0
+n_bad=0
+bad=""
+notrun=""
+interrupt=true
+
+# by default don't output timestamps
+timestamp=${TIMESTAMP:=false}
+
+# generic initialization
+iam=check
+
+# we need common.config
+if ! . ./common.config
+then
+ echo "$iam: failed to source common.config"
+ exit 1
+fi
+
+_setenvironment()
+{
+ MSGVERB="text:action"
+ export MSGVERB
+}
+
+here=`pwd`
+rm -f $here/$iam.out
+_setenvironment
+
+check=${check-true}
+
+diff="diff -u"
+verbose=false
+group=false
+xgroup=false
+showme=false
+sortme=false
+expunge=true
+have_test_arg=false
+randomize=false
+rm -f $tmp.list $tmp.tmp $tmp.sed
+
+for r
+do
+
+ if $group
+ then
+ # arg after -g
+ group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
+s/ .*//p
+}'`
+ if [ -z "$group_list" ]
+ then
+ echo "Group \"$r\" is empty or not defined?"
+ exit 1
+ fi
+ [ ! -s $tmp.list ] && touch $tmp.list
+ for t in $group_list
+ do
+ if grep -s "^$t\$" $tmp.list >/dev/null
+ then
+ :
+ else
+ echo "$t" >>$tmp.list
+ fi
+ done
+ group=false
+ continue
+
+ elif $xgroup
+ then
+ # arg after -x
+ [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
+ group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
+s/ .*//p
+}'`
+ if [ -z "$group_list" ]
+ then
+ echo "Group \"$r\" is empty or not defined?"
+ exit 1
+ fi
+ numsed=0
+ rm -f $tmp.sed
+ for t in $group_list
+ do
+ if [ $numsed -gt 100 ]
+ then
+ sed -f $tmp.sed <$tmp.list >$tmp.tmp
+ mv $tmp.tmp $tmp.list
+ numsed=0
+ rm -f $tmp.sed
+ fi
+ echo "/^$t\$/d" >>$tmp.sed
+ numsed=`expr $numsed + 1`
+ done
+ sed -f $tmp.sed <$tmp.list >$tmp.tmp
+ mv $tmp.tmp $tmp.list
+ xgroup=false
+ continue
+ fi
+
+ xpand=true
+ case "$r"
+ in
+
+ -\? | -h | --help) # usage
+ echo "Usage: $0 [options] [testlist]"'
+
+common options
+ -v verbose
+
+check options
+ -sheepdog test sheepdog
+ -xdiff graphical mode diff
+ -n show me, do not run tests
+ -T output timestamps
+ -r randomize test order
+
+testlist options
+ -g group[,group...] include tests from these groups
+ -x group[,group...] exclude tests from these groups
+ NNN include test NNN
+ NNN-NNN include test range (eg. 012-021)
+'
+ exit 0
+ ;;
+
+ -g) # -g group ... pick from group file
+ group=true
+ xpand=false
+ ;;
+
+ -xdiff) # graphical diff mode
+ xpand=false
+
+ if [ ! -z "$DISPLAY" ]
+ then
+ which xdiff >/dev/null 2>&1 && diff=xdiff
+ which gdiff >/dev/null 2>&1 && diff=gdiff
+ which tkdiff >/dev/null 2>&1 && diff=tkdiff
+ which xxdiff >/dev/null 2>&1 && diff=xxdiff
+ fi
+ ;;
+
+ -n) # show me, don't do it
+ showme=true
+ xpand=false
+ ;;
+ -r) # randomize test order
+ randomize=true
+ xpand=false
+ ;;
+
+ -T) # turn on timestamp output
+ timestamp=true
+ xpand=false
+ ;;
+
+ -v)
+ verbose=true
+ xpand=false
+ ;;
+ -x) # -x group ... exclude from group file
+ xgroup=true
+ xpand=false
+ ;;
+ '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
+ echo "No tests?"
+ status=1
+ exit $status
+ ;;
+
+ [0-9]*-[0-9]*)
+ eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
+ ;;
+
+ [0-9]*-)
+ eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
+ end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //'`
+ if [ -z "$end" ]
+ then
+ echo "No tests in range \"$r\"?"
+ status=1
+ exit $status
+ fi
+ ;;
+
+ *)
+ start=$r
+ end=$r
+ ;;
+
+ esac
+
+ # get rid of leading 0s as can be interpreted as octal
+ start=`echo $start | sed 's/^0*//'`
+ end=`echo $end | sed 's/^0*//'`
+
+ if $xpand
+ then
+ have_test_arg=true
+ $AWK_PROG </dev/null '
+BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
+ | while read id
+ do
+ if grep -s "^$id " group >/dev/null
+ then
+ # in group file ... OK
+ echo $id >>$tmp.list
+ else
+ if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
+ then
+ # expunged ... will be reported, but not run, later
+ echo $id >>$tmp.list
+ else
+ # oops
+ echo "$id - unknown test, ignored"
+ fi
+ fi
+ done
+ fi
+
+done
+
+if [ -s $tmp.list ]
+then
+ # found some valid test numbers ... this is good
+ :
+else
+ if $have_test_arg
+ then
+ # had test numbers, but none in group file ... do nothing
+ touch $tmp.list
+ else
+ # no test numbers, do everything from group file
+ sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list
+ fi
+fi
+
+# should be sort -n, but this did not work for Linux when this
+# was ported from IRIX
+#
+list=`sort $tmp.list`
+rm -f $tmp.list $tmp.tmp $tmp.sed
+
+if $randomize
+then
+ list=`echo $list | awk -f randomize.awk`
+fi
+
+# we need common.rc
+if ! . ./common.rc
+then
+ echo "check: failed to source common.rc"
+ exit 1
+fi
+
+_wallclock()
+{
+ date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
+}
+
+_timestamp()
+{
+ now=`date "+%T"`
+ echo -n " [$now]"
+}
+
+_wrapup()
+{
+ # for hangcheck ...
+ # remove files that were used by hangcheck
+ #
+ [ -f /tmp/check.pid ] && rm -rf /tmp/check.pid
+ [ -f /tmp/check.sts ] && rm -rf /tmp/check.sts
+
+ if $showme
+ then
+ :
+ elif $needwrap
+ then
+ if [ -f check.time -a -f $tmp.time ]
+ then
+ cat check.time $tmp.time \
+ | $AWK_PROG '
+ { t[$1] = $2 }
+END { if (NR > 0) {
+ for (i in t) print i " " t[i]
+ }
+ }' \
+ | sort -n >$tmp.out
+ mv $tmp.out check.time
+ fi
+
+ if [ -f $tmp.expunged ]
+ then
+ notrun=`wc -l <$tmp.expunged | sed -e 's/ *//g'`
+ try=`expr $try - $notrun`
+ list=`echo "$list" | sed -f $tmp.expunged`
+ fi
+
+ echo "" >>check.log
+ date >>check.log
+ echo $list | fmt | sed -e 's/^/ /' >>check.log
+ $interrupt && echo "Interrupted!" >>check.log
+
+ if [ ! -z "$notrun" ]
+ then
+ echo "Not run:$notrun"
+ echo "Not run:$notrun" >>check.log
+ fi
+ if [ ! -z "$n_bad" -a $n_bad != 0 ]
+ then
+ echo "Failures:$bad"
+ echo "Failed $n_bad of $try tests"
+ echo "Failures:$bad" | fmt >>check.log
+ echo "Failed $n_bad of $try tests" >>check.log
+ else
+ echo "Passed all $try tests"
+ echo "Passed all $try tests" >>check.log
+ fi
+ needwrap=false
+ fi
+
+ rm -f /tmp/*.out /tmp/*.err /tmp/*.time
+ rm -f /tmp/check.pid /tmp/check.sts
+ rm -f $tmp.*
+}
+
+trap "_wrapup; exit \$status" 0 1 2 3 15
+
+# for hangcheck ...
+# Save pid of check in a well known place, so that hangcheck can be sure it
+# has the right pid (getting the pid from ps output is not reliable enough).
+#
+rm -rf /tmp/check.pid
+echo $$ >/tmp/check.pid
+
+# for hangcheck ...
+# Save the status of check in a well known place, so that hangcheck can be
+# sure to know where check is up to (getting test number from ps output is
+# not reliable enough since the trace stuff has been introduced).
+#
+rm -rf /tmp/check.sts
+echo "preamble" >/tmp/check.sts
+
+# don't leave old full output behind on a clean run
+rm -f check.full
+
+[ -f check.time ] || touch check.time
+
+FULL_HOST_DETAILS=`_full_platform_details`
+
+cat <<EOF
+PLATFORM -- $FULL_HOST_DETAILS
+
+EOF
+
+seq="check"
+
+[ -n "$TESTS_REMAINING_LOG" ] && echo $list > $TESTS_REMAINING_LOG
+
+for seq in $list
+do
+ err=false
+ echo -n "$seq"
+ if [ -n "$TESTS_REMAINING_LOG" ] ; then
+ sed -e "s/$seq//" -e 's/ / /' -e 's/^ *//' $TESTS_REMAINING_LOG > $TESTS_REMAINING_LOG.tmp
+ mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG
+ sync
+ fi
+
+ if $showme
+ then
+ echo
+ continue
+ elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null
+ then
+ echo " - expunged"
+ rm -f $seq.out.bad
+ echo "/^$seq\$/d" >>$tmp.expunged
+ elif [ ! -f $seq ]
+ then
+ echo " - no such test?"
+ echo "/^$seq\$/d" >>$tmp.expunged
+ else
+ # really going to try and run this one
+ #
+ rm -f $seq.out.bad
+ lasttime=`sed -n -e "/^$seq /s/.* //p" <check.time`
+ if [ "X$lasttime" != X ]; then
+ echo -n " ${lasttime}s ..."
+ else
+ echo -n " " # prettier output with timestamps.
+ fi
+ rm -f core $seq.notrun
+
+ # for hangcheck ...
+ echo "$seq" >/tmp/check.sts
+
+ start=`_wallclock`
+ $timestamp && echo -n " ["`date "+%T"`"]"
+ [ ! -x $seq ] && chmod u+x $seq # ensure we can run it
+ ./$seq >$tmp.out 2>&1
+ sts=$?
+ $timestamp && _timestamp
+ stop=`_wallclock`
+
+ if [ -f core ]
+ then
+ echo -n " [dumped core]"
+ mv core $seq.core
+ err=true
+ fi
+
+ if [ -f $seq.notrun ]
+ then
+ $timestamp || echo -n " [not run] "
+ $timestamp && echo " [not run]" && echo -n " $seq -- "
+ cat $seq.notrun
+ notrun="$notrun $seq"
+ else
+ if [ $sts -ne 0 ]
+ then
+ echo -n " [failed, exit status $sts]"
+ err=true
+ fi
+ if [ ! -f $seq.out ]
+ then
+ echo " - no qualified output"
+ err=true
+ else
+ if diff $seq.out $tmp.out >/dev/null 2>&1
+ then
+ echo ""
+ if $err
+ then
+ :
+ else
+ echo "$seq `expr $stop - $start`" >>$tmp.time
+ fi
+ else
+ echo " - output mismatch (see $seq.out.bad)"
+ mv $tmp.out $seq.out.bad
+ $diff $seq.out $seq.out.bad
+ err=true
+ fi
+ fi
+ fi
+
+ fi
+
+ # come here for each test, except when $showme is true
+ #
+ if $err
+ then
+ bad="$bad $seq"
+ n_bad=`expr $n_bad + 1`
+ quick=false
+ fi
+ [ -f $seq.notrun ] || try=`expr $try + 1`
+
+ seq="after_$seq"
+done
+
+interrupt=false
+status=`expr $n_bad`
+exit
View
32 tests/cluster/006.sh
@@ -1,32 +0,0 @@
-#!/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
View
81 tests/common.config
@@ -0,0 +1,81 @@
+#!/bin/bash
+#
+# Copyright (C) 2009 Red Hat, Inc.
+# Copyright (c) 2000-2003,2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+# setup and check for config parameters
+#
+
+# all tests should use a common language setting to prevent golden
+# output mismatches.
+export LANG=C
+
+PATH=".:$PATH"
+
+HOST=`hostname -s`
+HOSTOS=`uname -s`
+
+export CHECK_OPTIONS=${CHECK_OPTIONS:="-g auto"}
+export PWD=`pwd`
+
+# $1 = prog to look for, $2* = default pathnames if not found in $PATH
+set_prog_path()
+{
+ p=`which $1 2> /dev/null`
+ if [ -n "$p" -a -x "$p" ]; then
+ echo $p
+ return 0
+ fi
+ p=$1
+
+ shift
+ for f; do
+ if [ -x $f ]; then
+ echo $f
+ return 0
+ fi
+ done
+
+ echo ""
+ return 1
+}
+
+_fatal()
+{
+ echo "$*"
+ status=1
+ exit 1
+}
+
+export PERL_PROG="`set_prog_path perl`"
+[ "$PERL_PROG" = "" ] && _fatal "perl not found"
+
+export AWK_PROG="`set_prog_path awk`"
+[ "$AWK_PROG" = "" ] && _fatal "awk not found"
+
+export SED_PROG="`set_prog_path sed`"
+[ "$SED_PROG" = "" ] && _fatal "sed not found"
+
+export BC_PROG="`set_prog_path bc`"
+[ "$BC_PROG" = "" ] && _fatal "bc not found"
+
+export DRIVER=${DRIVER:-local}
+export STORE=${STORE:-/tmp/sheepdog}
+export SHEEP=${SHEEP:-../sheep/sheep}
+export COLLIE=${COLLIE:-../collie/collie}
+
+# make sure this script returns success
+/bin/true
View
161 tests/common.filter
@@ -0,0 +1,161 @@
+#!/bin/bash
+#
+# Copyright (C) 2009 Red Hat, Inc.
+# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+# standard filters
+#
+
+# Checks that given_value is in range of correct_value +/- tolerance.
+# Tolerance can be an absolute value or a percentage of the correct value
+# (see examples with tolerances below).
+# Outputs suitable message to stdout if it's not in range.
+#
+# A verbose option, -v, may be used as the LAST argument
+#
+# e.g.
+# foo: 0.0298 = 0.03 +/- 5%
+# _within_tolerance "foo" 0.0298 0.03 5%
+#
+# foo: 0.0298 = 0.03 +/- 0.01
+# _within_tolerance "foo" 0.0298 0.03 0.01
+#
+# foo: 0.0298 = 0.03 -0.01 +0.002
+# _within_tolerance "foo" 0.0298 0.03 0.01 0.002
+#
+# foo: verbose output of 0.0298 = 0.03 +/- 5%
+# _within_tolerance "foo" 0.0298 0.03 5% -v
+_within_tolerance()
+{
+ _name=$1
+ _given_val=$2
+ _correct_val=$3
+ _mintol=$4
+ _maxtol=$_mintol
+ _verbose=0
+ _debug=false
+
+ # maxtol arg is optional
+ # verbose arg is optional
+ if [ $# -ge 5 ]
+ then
+ if [ "$5" = "-v" ]
+ then
+ _verbose=1
+ else
+ _maxtol=$5
+ fi
+ fi
+ if [ $# -ge 6 ]
+ then
+ [ "$6" = "-v" ] && _verbose=1
+ fi
+
+ # find min with or without %
+ _mintolerance=`echo $_mintol | sed -e 's/%//'`
+ if [ $_mintol = $_mintolerance ]
+ then
+ _min=`echo "scale=5; $_correct_val-$_mintolerance" | bc`
+ else
+ _min=`echo "scale=5; $_correct_val-$_mintolerance*0.01*$_correct_val" | bc`
+ fi
+
+ # find max with or without %
+ _maxtolerance=`echo $_maxtol | sed -e 's/%//'`
+ if [ $_maxtol = $_maxtolerance ]
+ then
+ _max=`echo "scale=5; $_correct_val+$_maxtolerance" | bc`
+ else
+ _max=`echo "scale=5; $_correct_val+$_maxtolerance*0.01*$_correct_val" | bc`
+ fi
+
+ $_debug && echo "min = $_min"
+ $_debug && echo "max = $_max"
+
+ cat <<EOF >$tmp.bc.1
+scale=5;
+if ($_min <= $_given_val) 1;
+if ($_min > $_given_val) 0;
+EOF
+
+ cat <<EOF >$tmp.bc.2
+scale=5;
+if ($_given_val <= $_max) 1;
+if ($_given_val > $_max) 0;
+EOF
+
+ _above_min=`bc <$tmp.bc.1`
+ _below_max=`bc <$tmp.bc.2`
+
+ rm -f $tmp.bc.[12]
+
+ _in_range=`expr $_above_min \& $_below_max`
+
+ # fix up min, max precision for output
+ # can vary for 5.3, 6.2
+ _min=`echo $_min | sed -e 's/0*$//'` # get rid of trailling zeroes
+ _max=`echo $_max | sed -e 's/0*$//'` # get rid of trailling zeroes
+
+ if [ $_in_range -eq 1 ]
+ then
+ [ $_verbose -eq 1 ] && echo $_name is in range
+ return 0
+ else
+ [ $_verbose -eq 1 ] && echo $_name has value of $_given_val
+ [ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max
+ return 1
+ fi
+}
+
+# ctime(3) dates
+#
+_filter_date()
+{
+ sed \
+ -e 's/[A-Z][a-z][a-z] [A-z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/'
+}
+
+# ISO dates
+_filter_iso_date()
+{
+ sed -e 's/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/g'
+}
+
+_filter_short_date()
+{
+ sed -e 's/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]/DATE/g'
+}
+
+# remove trailing whitespace, some versions of sg3_utils do that
+_filter_spaces()
+{
+ sed -e 's/ *$//'
+}
+
+# normalize collie cluster info output
+_filter_cluster_info()
+{
+ _filter_date | _filter_iso_date
+}
+
+# sanitize qemu-io output
+_filter_qemu_io()
+{
+ sed -e "s/[0-9]* ops\; [0-9/:. sec]* ([0-9/.inf]* [EPTGMKiBbytes]*\/sec and [0-9/.inf]* ops\/sec)/X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+}
+
+# make sure this script returns success
+/bin/true
View
135 tests/common.rc
@@ -0,0 +1,135 @@
+#!/bin/bash
+#
+# Copyright (C) 2009 Red Hat, Inc.
+# Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# we need common.config
+if [ "$iam" != "check" ]
+then
+ if ! . ./common.config
+ then
+ echo "$iam: failed to source common.config"
+ exit 1
+ fi
+fi
+
+# make sure we have a standard umask
+umask 022
+
+# Do a command, log it to $seq.full, optionally test return status
+# and die if command fails. If called with one argument _do executes the
+# command, logs it, and returns its exit status. With two arguments _do
+# first prints the message passed in the first argument, and then "done"
+# or "fail" depending on the return status of the command passed in the
+# second argument. If the command fails and the variable _do_die_on_error
+# is set to "always" or the two argument form is used and _do_die_on_error
+# is set to "message_only" _do will print an error message to
+# $seq.out and exit.
+
+_do()
+{
+ if [ $# -eq 1 ]; then
+ _cmd=$1
+ elif [ $# -eq 2 ]; then
+ _note=$1
+ _cmd=$2
+ echo -n "$_note... "
+ else
+ echo "Usage: _do [note] cmd" 1>&2
+ status=1; exit
+ fi
+
+ (eval "echo '---' \"$_cmd\"") >>$here/$seq.full
+ (eval "$_cmd") >$tmp._out 2>&1; ret=$?
+ cat $tmp._out >>$here/$seq.full
+ if [ $# -eq 2 ]; then
+ if [ $ret -eq 0 ]; then
+ echo "done"
+ else
+ echo "fail"
+ fi
+ fi
+ if [ $ret -ne 0 ] \
+ && [ "$_do_die_on_error" = "always" \
+ -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
+ then
+ [ $# -ne 2 ] && echo
+ eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
+ status=1; exit
+ fi
+
+ return $ret
+}
+
+# bail out, setting up .notrun file
+#
+_notrun()
+{
+ echo "$*" >$seq.notrun
+ echo "$seq not run: $*"
+ status=0
+ exit
+}
+
+# just plain bail out
+#
+_fail()
+{
+ echo "$*" | tee -a $here/$seq.full
+ echo "(see $seq.full for details)"
+ status=1
+ exit 1
+}
+
+# this test requires that a specified command (executable) exists
+#
+_require_command()
+{
+ [ -n "`which $1`" ] || _notrun "$1 utility required, skipped this test"
+ [ -x "`which $1`" ] || _notrun "$1 utility required, skipped this test"
+}
+
+_full_platform_details()
+{
+ os=`uname -s`
+ host=`hostname -s`
+ kernel=`uname -r`
+ platform=`uname -m`
+ echo "$os/$platform $host $kernel"
+}
+
+_die()
+{
+ echo $@
+ exit 1
+}
+
+_cleanup()
+{
+ killall -9 sheep collie >/dev/null 2>&1 || true
+ sleep 1
+ mkdir -p $STORE
+ for i in $STORE/?; do
+ rm -rf $i
+ done
+ for i in $STORE/??; do
+ rm -rf $i
+ done
+}
+
+# make sure this script returns success
+/bin/true
View
0 tests/foo
No changes.
View
31 tests/group
@@ -0,0 +1,31 @@
+#
+# QA groups control file
+#
+# Defines test groups
+# - do not start group names with a digit
+# - test-group association are one line per test
+# - each test can be part of multiple groups
+#
+# auto: tests that are run by defaul
+# quick: test that take less than 30 seconds (normally)
+# cluster: cluster drivers tests: join/leave/etc
+# store: basic data integrity
+# vdi: qemu I/O, snapshots, volume creation and deletion
+#
+001 auto quick cluster
+002 auto quick cluster
+003 auto quick cluster
+004 auto quick cluster
+005 auto quick cluster
+006 auto quick cluster
+007 auto quick cluster
+008 auto store
+009 auto quick store
+010 auto quick store
+011 auto quick store
+012 auto quick store
+013 auto quick vdi
+014 auto quick vdi
+015 auto quick vdi
+016 auto quick vdi
+017 auto quick vdi
View
62 tests/store/001.sh
@@ -1,62 +0,0 @@
-#!/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
View
31 tests/store/004.sh
@@ -1,31 +0,0 @@
-#!/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
View
32 tests/vdi/001.sh
@@ -1,32 +0,0 @@
-#!/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
View
40 tests/vdi/005.sh
@@ -1,40 +0,0 @@
-#!/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)

0 comments on commit 9a8549d

Please sign in to comment.