[sheepdog] [PATCH 1/3] tests/func: add common header to tests
Liu Yuan
namei.unix at gmail.com
Sun Aug 11 14:32:31 CEST 2013
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
tests/functional/001 | 13 +------------
tests/functional/002 | 13 +------------
tests/functional/003 | 13 +------------
tests/functional/004 | 13 +------------
tests/functional/005 | 13 +------------
tests/functional/006 | 13 +------------
tests/functional/007 | 13 +------------
tests/functional/008 | 17 +----------------
tests/functional/009 | 13 +------------
tests/functional/010 | 13 +------------
tests/functional/011 | 15 +--------------
tests/functional/012 | 13 +------------
tests/functional/013 | 13 +------------
tests/functional/014 | 13 +------------
tests/functional/015 | 13 +------------
tests/functional/016 | 13 +------------
tests/functional/017 | 13 +------------
tests/functional/018 | 13 +------------
tests/functional/019 | 13 +------------
tests/functional/020 | 13 +------------
tests/functional/021 | 13 +------------
tests/functional/022 | 13 +------------
tests/functional/023 | 13 +------------
tests/functional/024 | 13 +------------
tests/functional/025 | 13 +------------
tests/functional/026 | 13 +------------
tests/functional/027 | 13 +------------
tests/functional/028 | 13 +------------
tests/functional/029 | 13 +------------
tests/functional/030 | 14 +-------------
tests/functional/031 | 13 +------------
tests/functional/032 | 13 +------------
tests/functional/033 | 13 +------------
tests/functional/034 | 13 +------------
tests/functional/035 | 20 +-------------------
tests/functional/036 | 13 +------------
tests/functional/037 | 13 +------------
tests/functional/038 | 13 +------------
tests/functional/039 | 13 +------------
tests/functional/040 | 13 +------------
tests/functional/041 | 13 +------------
tests/functional/042 | 15 +--------------
tests/functional/043 | 13 +------------
tests/functional/044 | 17 +----------------
tests/functional/045 | 13 +------------
tests/functional/046 | 13 +------------
tests/functional/047 | 13 +------------
tests/functional/048 | 13 +------------
tests/functional/049 | 13 +------------
tests/functional/050 | 23 +----------------------
tests/functional/051 | 13 +------------
tests/functional/052 | 13 +------------
tests/functional/053 | 13 +------------
tests/functional/054 | 15 +--------------
tests/functional/055 | 15 +--------------
tests/functional/056 | 15 +--------------
tests/functional/057 | 19 +------------------
tests/functional/058 | 13 +------------
tests/functional/059 | 13 +------------
tests/functional/060 | 13 +------------
tests/functional/061 | 13 +------------
tests/functional/062 | 13 +------------
tests/functional/063 | 15 +--------------
tests/functional/064 | 15 +--------------
tests/functional/065 | 13 +------------
tests/functional/066 | 13 +------------
tests/functional/067 | 13 +------------
tests/functional/068 | 13 +------------
tests/functional/069 | 13 +------------
tests/functional/070 | 13 +------------
tests/functional/071 | 13 +------------
tests/functional/072 | 13 +------------
tests/functional/common | 12 ++++++++++++
73 files changed, 84 insertions(+), 910 deletions(-)
create mode 100644 tests/functional/common
diff --git a/tests/functional/001 b/tests/functional/001
index 1dd4ed8..0897bb4 100755
--- a/tests/functional/001
+++ b/tests/functional/001
@@ -2,18 +2,7 @@
# Test master node killing and master transfer
-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
+. ./common
for i in 0 1; do
_start_sheep $i
diff --git a/tests/functional/002 b/tests/functional/002
index 45b89ac..698f545 100755
--- a/tests/functional/002
+++ b/tests/functional/002
@@ -2,18 +2,7 @@
# Test master transfer for crashed cluster
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/003 b/tests/functional/003
index 55c1a81..c799164 100755
--- a/tests/functional/003
+++ b/tests/functional/003
@@ -2,18 +2,7 @@
# Test master transfer for crashed cluster
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/004 b/tests/functional/004
index 363e5e8..83eb955 100755
--- a/tests/functional/004
+++ b/tests/functional/004
@@ -2,18 +2,7 @@
# Test membership, add one node after killing existing one node
-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
+. ./common
for i in 0 1; do
_start_sheep $i
diff --git a/tests/functional/005 b/tests/functional/005
index 85500a8..5523b9e 100755
--- a/tests/functional/005
+++ b/tests/functional/005
@@ -2,18 +2,7 @@
# Test cluster membership by killing and adding nodes
-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
+. ./common
for i in 0 1; do
_start_sheep $i
diff --git a/tests/functional/006 b/tests/functional/006
index b670a44..55ebbf8 100755
--- a/tests/functional/006
+++ b/tests/functional/006
@@ -2,18 +2,7 @@
# Test launching sheeps simultaneously
-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
+. ./common
_start_sheep 0
_wait_for_sheep 1
diff --git a/tests/functional/007 b/tests/functional/007
index af0338d..0fda0eb 100755
--- a/tests/functional/007
+++ b/tests/functional/007
@@ -2,18 +2,7 @@
# Test cluster rejecting node with wrong epoch
-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
+. ./common
# create a node who has wrong epoch
diff --git a/tests/functional/008 b/tests/functional/008
index 36078ce..665cb6b 100755
--- a/tests/functional/008
+++ b/tests/functional/008
@@ -2,22 +2,7 @@
# Test doing heavy IO while confchg change
-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
-
-if [[ "$DRIVER" == zoo* ]];then
- DRIVER=${DRIVER/1000/5000}
-fi
-
-_cleanup
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/009 b/tests/functional/009
index 3d3142e..acf9693 100755
--- a/tests/functional/009
+++ b/tests/functional/009
@@ -2,18 +2,7 @@
# Test data integrity after joining a new node
-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
+. ./common
# start three sheep daemons
for i in 0 1 2; do
diff --git a/tests/functional/010 b/tests/functional/010
index 3dbcd92..de7ddbb 100755
--- a/tests/functional/010
+++ b/tests/functional/010
@@ -2,18 +2,7 @@
# Test manual recovery command
-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
+. ./common
for i in `seq 0 4`; do
_start_sheep $i
diff --git a/tests/functional/011 b/tests/functional/011
index b575cce..fe1037a 100755
--- a/tests/functional/011
+++ b/tests/functional/011
@@ -2,20 +2,7 @@
# Test sheep booting on existing images mounted as loop device
-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
-
-_need_to_be_root
-
-_cleanup
+. ./common
_make_device 0 $((2 * 1024 ** 3))
_make_device 1 $((4 * 1024 ** 3))
diff --git a/tests/functional/012 b/tests/functional/012
index 4642a7f..9b1657e 100755
--- a/tests/functional/012
+++ b/tests/functional/012
@@ -2,18 +2,7 @@
# Test gateway only functionality
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/013 b/tests/functional/013
index 76f62a8..c63a707 100755
--- a/tests/functional/013
+++ b/tests/functional/013
@@ -2,18 +2,7 @@
# Test snapshot functionality
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/014 b/tests/functional/014
index 28167b7..b561ba4 100755
--- a/tests/functional/014
+++ b/tests/functional/014
@@ -2,18 +2,7 @@
# Test vdi setattr/getattr
-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
+. ./common
for i in 0 2; do
_start_sheep $i
diff --git a/tests/functional/015 b/tests/functional/015
index d1de9d2..2492d3b 100755
--- a/tests/functional/015
+++ b/tests/functional/015
@@ -2,18 +2,7 @@
# Test vdi setattr/getattr failure mode
-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
+. ./common
for i in 0 2; do
_start_sheep $i
diff --git a/tests/functional/016 b/tests/functional/016
index 378a82a..72026fd 100755
--- a/tests/functional/016
+++ b/tests/functional/016
@@ -2,18 +2,7 @@
# Test vdi clone functionality
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/017 b/tests/functional/017
index 9093c63..e76fd58 100755
--- a/tests/functional/017
+++ b/tests/functional/017
@@ -2,18 +2,7 @@
# Test vdi tree functionality
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/018 b/tests/functional/018
index 5f3310f..acec3c0 100755
--- a/tests/functional/018
+++ b/tests/functional/018
@@ -2,18 +2,7 @@
# Test object cache writeback mode
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-w size=100"
diff --git a/tests/functional/019 b/tests/functional/019
index 8fbd8de..7fc0921 100755
--- a/tests/functional/019
+++ b/tests/functional/019
@@ -2,18 +2,7 @@
# Test object cache writethrough mode
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-w size=100"
diff --git a/tests/functional/020 b/tests/functional/020
index 3b66b5f..53f1d20 100755
--- a/tests/functional/020
+++ b/tests/functional/020
@@ -2,18 +2,7 @@
# Test object cache reclaim
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-w size=20"
diff --git a/tests/functional/021 b/tests/functional/021
index a23b353..4555165 100755
--- a/tests/functional/021
+++ b/tests/functional/021
@@ -2,18 +2,7 @@
# Test that format still works in a cluster that has only gateways
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-g"
diff --git a/tests/functional/022 b/tests/functional/022
index 0084ac0..6330dba 100755
--- a/tests/functional/022
+++ b/tests/functional/022
@@ -2,18 +2,7 @@
# Test that writing to a cluster that only has gateways fails
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-g"
diff --git a/tests/functional/023 b/tests/functional/023
index d1d1703..52e8281 100755
--- a/tests/functional/023
+++ b/tests/functional/023
@@ -2,18 +2,7 @@
# Reproduce a joinstorm just after format
-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
+. ./common
for i in `seq 0 0`; do
_start_sheep $i
diff --git a/tests/functional/024 b/tests/functional/024
index a8b03bc..d1adf4b 100755
--- a/tests/functional/024
+++ b/tests/functional/024
@@ -2,18 +2,7 @@
# Make sure data written to the cluster can be read from a newly joined node
-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
+. ./common
if [[ "$DRIVER" == zoo* ]];then
DRIVER=${DRIVER/1000/5000}
diff --git a/tests/functional/025 b/tests/functional/025
index b1e9c52..56fa39c 100755
--- a/tests/functional/025
+++ b/tests/functional/025
@@ -2,18 +2,7 @@
# Check for a recovery segfault in older versions
-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
+. ./common
VDI_NAME="test"
VDI_SIZE="20M"
diff --git a/tests/functional/026 b/tests/functional/026
index 3bce862..94af215 100755
--- a/tests/functional/026
+++ b/tests/functional/026
@@ -2,18 +2,7 @@
# Test vdi create operation during node changes
-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
+. ./common
if [[ "$DRIVER" == zoo* ]];then
DRIVER=${DRIVER/1000/5000}
diff --git a/tests/functional/027 b/tests/functional/027
index 55dcda9..455e300 100755
--- a/tests/functional/027
+++ b/tests/functional/027
@@ -2,18 +2,7 @@
# Test sheep recovery logic breadth-first algorithm
-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
+. ./common
for i in `seq 0 3`; do
_start_sheep $i
diff --git a/tests/functional/028 b/tests/functional/028
index c704972..4b34db3 100755
--- a/tests/functional/028
+++ b/tests/functional/028
@@ -2,18 +2,7 @@
# Test sheep recovery logic
-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
+. ./common
for i in `seq 0 1`; do _start_sheep $i; done
diff --git a/tests/functional/029 b/tests/functional/029
index 4d1e6ff..711d1e3 100755
--- a/tests/functional/029
+++ b/tests/functional/029
@@ -2,18 +2,7 @@
# Test sheep VDI redundancy level
-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
+. ./common
for i in `seq 0 6`; do
_start_sheep $i;
diff --git a/tests/functional/030 b/tests/functional/030
index 5a34ba2..a84bab3 100755
--- a/tests/functional/030
+++ b/tests/functional/030
@@ -2,19 +2,7 @@
# Test cluster snapshot
-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
+. ./common
for i in `seq 0 3`; do
_start_sheep $i;
done
diff --git a/tests/functional/031 b/tests/functional/031
index 467f468..3195eef 100755
--- a/tests/functional/031
+++ b/tests/functional/031
@@ -2,18 +2,7 @@
# Test vdi list after cluster restart
-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
+. ./common
_start_sheep 0
_wait_for_sheep 1
diff --git a/tests/functional/032 b/tests/functional/032
index c2915dd..691d360 100755
--- a/tests/functional/032
+++ b/tests/functional/032
@@ -2,18 +2,7 @@
# Test recovery when we have less zones availability
-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
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/033 b/tests/functional/033
index 5a85165..b5aa00e 100755
--- a/tests/functional/033
+++ b/tests/functional/033
@@ -2,18 +2,7 @@
# Test recovery after many nodes failed at the same time
-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
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/034 b/tests/functional/034
index 1f10e69..c0ccab7 100755
--- a/tests/functional/034
+++ b/tests/functional/034
@@ -2,18 +2,7 @@
# Test sheep joining with older objects
-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
+. ./common
if [[ "$DRIVER" == zoo* ]];then
DRIVER=${DRIVER/1000/5000}
diff --git a/tests/functional/035 b/tests/functional/035
index 2f3d236..cc9ab71 100755
--- a/tests/functional/035
+++ b/tests/functional/035
@@ -2,25 +2,7 @@
# Test sockfd connection
-seq=`basename $0`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-
-trap "_uninit; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-_need_to_be_root
-
-_uninit()
-{
- for i in `seq 1 7`; do
- _cleanup_machine_simulation $i
+. ./common
done
}
diff --git a/tests/functional/036 b/tests/functional/036
index 0184abb..36db7c9 100755
--- a/tests/functional/036
+++ b/tests/functional/036
@@ -2,18 +2,7 @@
# Test format cluster just after sheeps start up
-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
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/037 b/tests/functional/037
index 2221434..a4753c8 100755
--- a/tests/functional/037
+++ b/tests/functional/037
@@ -2,18 +2,7 @@
# Test node failure just after format
-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
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/038 b/tests/functional/038
index 62e6736..4b07ee1 100755
--- a/tests/functional/038
+++ b/tests/functional/038
@@ -2,18 +2,7 @@
# Test format cluster during node membership changes
-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
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/039 b/tests/functional/039
index d88ea70..8941951 100755
--- a/tests/functional/039
+++ b/tests/functional/039
@@ -2,18 +2,7 @@
# Test vdi rollback
-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
+. ./common
for i in `seq 0 4`; do
_start_sheep $i
diff --git a/tests/functional/040 b/tests/functional/040
index 9eb9351..24fe2d7 100755
--- a/tests/functional/040
+++ b/tests/functional/040
@@ -2,18 +2,7 @@
# Test vdi object recovery just after vdi creation
-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
+. ./common
_start_sheep 0
_wait_for_sheep 1
diff --git a/tests/functional/041 b/tests/functional/041
index 0ca29f7..ed9c9f7 100755
--- a/tests/functional/041
+++ b/tests/functional/041
@@ -2,18 +2,7 @@
# Test vdi backup and restore
-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
+. ./common
for i in `seq 0 4`; do
_start_sheep $i
diff --git a/tests/functional/042 b/tests/functional/042
index 1fc8e88..c963e04 100755
--- a/tests/functional/042
+++ b/tests/functional/042
@@ -2,20 +2,7 @@
# 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
-
-_need_to_be_root
-
-_cleanup
+. ./common
_make_device 0 $((1024 ** 3))
_make_device 1 $((1024 ** 3))
diff --git a/tests/functional/043 b/tests/functional/043
index 73aec75..093cff0 100755
--- a/tests/functional/043
+++ b/tests/functional/043
@@ -2,18 +2,7 @@
# Test disk error 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
+. ./common
for i in `seq 0 4`; do
_start_sheep $i
diff --git a/tests/functional/044 b/tests/functional/044
index ce949ae..9c8ca76 100755
--- a/tests/functional/044
+++ b/tests/functional/044
@@ -2,22 +2,7 @@
# Test vdi snapshot functionality concurrently with object cache enabled
-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
-
-if [[ "$DRIVER" == zoo* ]];then
- DRIVER=${DRIVER/1000/5000}
-fi
-
-_cleanup
+. ./common
for i in 0 1 2; do
_start_sheep $i "-w size=1000"
diff --git a/tests/functional/045 b/tests/functional/045
index d30e636..d8f6583 100755
--- a/tests/functional/045
+++ b/tests/functional/045
@@ -2,18 +2,7 @@
# Test partial vdi read and write
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/046 b/tests/functional/046
index 33ff0d5..659466b 100755
--- a/tests/functional/046
+++ b/tests/functional/046
@@ -2,18 +2,7 @@
# Test vdi deletion
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/047 b/tests/functional/047
index e7309da..b722e48 100755
--- a/tests/functional/047
+++ b/tests/functional/047
@@ -2,18 +2,7 @@
# Test journal file replay
-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
+. ./common
_start_sheep 0 "-j size=64"
diff --git a/tests/functional/048 b/tests/functional/048
index 82e1235..8662453 100755
--- a/tests/functional/048
+++ b/tests/functional/048
@@ -2,18 +2,7 @@
# Test some collie commands
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/049 b/tests/functional/049
index 95fa6e2..bcc1025 100755
--- a/tests/functional/049
+++ b/tests/functional/049
@@ -2,18 +2,7 @@
# Test object cache reclaim at startup
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-w size=30"
diff --git a/tests/functional/050 b/tests/functional/050
index 9a94649..f5b75f5 100755
--- a/tests/functional/050
+++ b/tests/functional/050
@@ -2,28 +2,7 @@
# Test IO NIC function
-seq=`basename $0`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-
-trap "_uninit; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-_need_to_be_root
-
-_uninit()
-{
- iptables -D INPUT -p tcp --sport 8001 -j DROP
- iptables -D INPUT -p tcp --dport 8001 -j DROP
-}
-
-_cleanup
+. ./common
for i in `seq 0 2`; do
_start_sheep $i "-i host=127.0.0.1,port=$((8000+$i))"
diff --git a/tests/functional/051 b/tests/functional/051
index f9ca569..c2c96c6 100755
--- a/tests/functional/051
+++ b/tests/functional/051
@@ -2,18 +2,7 @@
# Test cluster with too few living nodes
-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
+. ./common
for i in 0 1; do
_start_sheep $i
diff --git a/tests/functional/052 b/tests/functional/052
index 21653fc..d14bf94 100755
--- a/tests/functional/052
+++ b/tests/functional/052
@@ -2,18 +2,7 @@
# Test force cluster recovery with new nodes
-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
+. ./common
for i in 0 1 2 3; do
_start_sheep $i
diff --git a/tests/functional/053 b/tests/functional/053
index 41331da..3874a7e 100755
--- a/tests/functional/053
+++ b/tests/functional/053
@@ -2,18 +2,7 @@
# Test adding nodes to the gateway only cluster
-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
+. ./common
_start_sheep 0 -g
_start_sheep 1 -g
diff --git a/tests/functional/054 b/tests/functional/054
index 54b8df7..0fb5d8c 100755
--- a/tests/functional/054
+++ b/tests/functional/054
@@ -1,20 +1,7 @@
#!/bin/bash
# Test stale objects purging with different disk size.
-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
-
-_need_to_be_root
-
-_cleanup
+. ./common
_make_device 0 $((1024 ** 3))
_make_device 1 $((2 * 1024 ** 3))
diff --git a/tests/functional/055 b/tests/functional/055
index 5a87f27..ccae29f 100755
--- a/tests/functional/055
+++ b/tests/functional/055
@@ -1,20 +1,7 @@
#!/bin/bash
# Test md with single failure, multiple failure and all failure
-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
-
-MD=true
-
-_cleanup
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/056 b/tests/functional/056
index 0881646..96ddbf1 100755
--- a/tests/functional/056
+++ b/tests/functional/056
@@ -1,20 +1,7 @@
#!/bin/bash
# Test md disk failure with node change events
-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
-
-MD=true
-
-_cleanup
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/057 b/tests/functional/057
index 3c23e51..20a5714 100755
--- a/tests/functional/057
+++ b/tests/functional/057
@@ -1,24 +1,7 @@
#!/bin/bash
# Test md hot-plug and hot-unplug
-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
-
-MD=true
-
-if [ "$STORE" != "/tmp/sheepdog/057" ]; then
- _notrun "This test cannot be run when WD is manually set"
-fi
-
-_cleanup
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/058 b/tests/functional/058
index d7d2e9e..8e9ba18 100755
--- a/tests/functional/058
+++ b/tests/functional/058
@@ -1,18 +1,7 @@
#!/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
+. ./common
for i in 0 1 2; do
_start_sheep $i "-w size=200"
diff --git a/tests/functional/059 b/tests/functional/059
index 6b34d39..dfaf288 100755
--- a/tests/functional/059
+++ b/tests/functional/059
@@ -2,18 +2,7 @@
# Test live snapshot
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i
diff --git a/tests/functional/060 b/tests/functional/060
index 21257c4..9495ef5 100755
--- a/tests/functional/060
+++ b/tests/functional/060
@@ -1,18 +1,7 @@
#!/bin/bash
# Test reboot sheepdog without collie shutdown
-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
+. ./common
for i in `seq 0 7`; do
_start_sheep $i
diff --git a/tests/functional/061 b/tests/functional/061
index 1cd0391..26b8daf 100755
--- a/tests/functional/061
+++ b/tests/functional/061
@@ -2,18 +2,7 @@
# Test list preparation of sheep recovery logic
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i
diff --git a/tests/functional/062 b/tests/functional/062
index 782b30e..6bd84ee 100755
--- a/tests/functional/062
+++ b/tests/functional/062
@@ -2,18 +2,7 @@
# Test unaligned collie vdi read/write
-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
+. ./common
for i in `seq 0 2`; do
_start_sheep $i
diff --git a/tests/functional/063 b/tests/functional/063
index 2d687df..77206fa 100755
--- a/tests/functional/063
+++ b/tests/functional/063
@@ -1,20 +1,7 @@
#!/bin/bash
# Test reweight
-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
-
-_need_to_be_root
-
-_cleanup
+. ./common
_make_device 0 $((100 * 1024 ** 2))
_make_device 1 $((100 * 1024 ** 2))
diff --git a/tests/functional/064 b/tests/functional/064
index f6a294a..e379c98 100755
--- a/tests/functional/064
+++ b/tests/functional/064
@@ -1,20 +1,7 @@
#!/bin/bash
# Test node failure while reweighting
-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
-
-_need_to_be_root
-
-_cleanup
+. ./common
_make_device 0 $((200 * 1024 ** 2)) # 200 MB
_make_device 1 $((200 * 1024 ** 2)) # 200 MB
diff --git a/tests/functional/065 b/tests/functional/065
index 5f82d67..388d7e8 100755
--- a/tests/functional/065
+++ b/tests/functional/065
@@ -2,18 +2,7 @@
# Test cache push while in recovery
-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
+. ./common
for i in `seq 0 1`; do
_start_sheep $i "-w size=400"
diff --git a/tests/functional/066 b/tests/functional/066
index 5c652d3..1a36492 100755
--- a/tests/functional/066
+++ b/tests/functional/066
@@ -2,18 +2,7 @@
# Test cache push in stress
-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
+. ./common
for i in `seq 0 1 2`; do
_start_sheep $i "-w size=200"
diff --git a/tests/functional/067 b/tests/functional/067
index 16e0a3e..c47d387 100755
--- a/tests/functional/067
+++ b/tests/functional/067
@@ -2,18 +2,7 @@
# Test concurrent start up
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/068 b/tests/functional/068
index a6699ec..9de2893 100755
--- a/tests/functional/068
+++ b/tests/functional/068
@@ -2,18 +2,7 @@
# Test rejoin cluster
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/069 b/tests/functional/069
index 1b4927a..cf19f50 100755
--- a/tests/functional/069
+++ b/tests/functional/069
@@ -2,18 +2,7 @@
# Test joining sheep with wrong and newer epoch
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/070 b/tests/functional/070
index d38e462..1f7660e 100755
--- a/tests/functional/070
+++ b/tests/functional/070
@@ -2,18 +2,7 @@
# Test join to the clean cluster
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/071 b/tests/functional/071
index 1d6a41f..acf8b9f 100755
--- a/tests/functional/071
+++ b/tests/functional/071
@@ -2,18 +2,7 @@
# Test partially zeroed data
-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
+. ./common
for i in 0 1 2; do
_start_sheep $i
diff --git a/tests/functional/072 b/tests/functional/072
index b4e7792..cee96c9 100755
--- a/tests/functional/072
+++ b/tests/functional/072
@@ -2,18 +2,7 @@
# Test restart with missing object in stale directory
-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
+. ./common
MD=false
diff --git a/tests/functional/common b/tests/functional/common
new file mode 100644
index 0000000..9868903
--- /dev/null
+++ b/tests/functional/common
@@ -0,0 +1,12 @@
+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
--
1.7.9.5
More information about the sheepdog
mailing list