cleanup_tests
}
+set_cleanup_trap() {
+ trap "cleanup_pools $FSNAME" EXIT
+}
# Initialization
remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
ost_pools_init
-trap "cleanup_pools $FSNAME" EXIT
# Tests for new commands added
test_1() {
+ set_cleanup_trap
echo "Creating a pool with a 1 character pool name"
create_pool_nofail p
run_test 1 "Test lctl pool_new ========================================="
test_2a() {
+ set_cleanup_trap
destroy_pool $POOL
do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $FSNAME-OST0000 2>/dev/null
run_test 2a "pool_add: non-existant pool"
test_2b() {
+ set_cleanup_trap
do_facet $SINGLEMDS lctl pool_add $FSNAME.p1234567891234567890 \
$FSNAME-OST0000 2>/dev/null
[[ $? -ne 0 ]] || \
# Testing various combinations of OST name list
test_2c() {
+ set_cleanup_trap
local TGT
local RC
run_test 2c "pool_add: OST index combinations ==========================="
test_2d() {
+ set_cleanup_trap
local TGT
local RC
run_test 2d "pool_add: OSTs that don't exist should be rejected ========"
test_2e() {
+ set_cleanup_trap
local TGT
local RC
local RESULT
run_test 2e "pool_add: OST already in a pool should be rejected ========"
test_3a() {
+ set_cleanup_trap
lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
[[ $? -ne 0 ]] || \
destroy_pool $POOL
run_test 3a "pool_remove: non-existant pool"
test_3b() {
+ set_cleanup_trap
do_facet $SINGLEMDS lctl pool_remove ${NON_EXISTANT_FS}.$POOL OST0000 2>/dev/null
[[ $? -ne 0 ]] || \
error "pool_remove did not fail even though fsname did not exist."
run_test 3b "pool_remove: non-existant fsname"
test_3c() {
+ set_cleanup_trap
do_facet $SINGLEMDS lctl pool_remove $FSNAME.p1234567891234567890 \
$FSNAME-OST0000 2>/dev/null
[[ $? -ne 0 ]] || \
# Testing various combinations of OST name list
test_3d() {
+ set_cleanup_trap
lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
[[ $? -ne 0 ]] || \
destroy_pool $POOL
run_test 3d "pool_remove: OST index combinations ==========================="
test_4a() {
+ set_cleanup_trap
lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
[[ $? -ne 0 ]] || \
destroy_pool $POOL
run_test 4a "pool_destroy: non-existant pool"
test_4b() {
+ set_cleanup_trap
do_facet $SINGLEMDS lctl pool_destroy ${NON_EXISTANT_FS}.$POOL 2>/dev/null
[[ $? -ne 0 ]] || \
error "pool_destroy did not fail even though the filesystem did not exist."
run_test 4b "pool_destroy: non-existant fs-name"
test_4c() {
+ set_cleanup_trap
create_pool_nofail $POOL
add_pool $POOL "OST0000" "$FSNAME-OST0000_UUID "
}
test_5() {
+ set_cleanup_trap
# Issue commands from client
sub_test_5 $LCTL
sub_test_5 $LFS
run_test 5 "lfs/lctl pool_list"
test_6() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local POOL_DIR=$POOL_ROOT/dir_tst
local POOL_FILE=$POOL_ROOT/file_tst
[[ $? -ne 0 ]] || \
error "$SETSTRIPE with start index outside the pool did not fail."
- destroy_pool $POOL
- destroy_pool $POOL2
}
run_test 6 "getstripe/setstripe"
test_11() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
[[ $OSTCOUNT -le 1 ]] && skip_env "Need atleast 2 OSTs" && return
rm -rf $POOL_ROOT/dir?
- destroy_pool $POOL
- destroy_pool $POOL2
-
return 0
}
run_test 11 "OSTs in overlapping/multiple pools"
test_12() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
[[ $OSTCOUNT -le 2 ]] && skip_env "Need atleast 3 OSTs" && return
check_file_in_pool $POOL_ROOT/file3 $POOL
check_file_in_pool $POOL_ROOT/file4 $POOL2
- destroy_pool $POOL
- destroy_pool $POOL2
-
return 0
}
run_test 12 "OST Pool Membership"
test_13() {
+ set_cleanup_trap
[[ $OSTCOUNT -le 2 ]] && skip_env "Need atleast 3 OSTs" && return
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
done
rm -rf create_dir $POOL_ROOT/dir?
- destroy_pool $POOL
return 0
}
run_test 13 "Striping characteristics in a pool"
test_14() {
+ set_cleanup_trap
[[ $OSTCOUNT -le 2 ]] && skip_env "Need atleast 3 OSTs" && return
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
done
rm -rf $POOL_ROOT
- destroy_pool $POOL
- destroy_pool $POOL2
return 0
}
run_test 14 "Round robin and QOS striping within a pool"
test_15() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=100
local i=0
i=$((i+1))
done
- i=0
- while [[ $i -lt $OSTCOUNT ]]
- do
- destroy_pool pool${i}
- i=$((i+1))
- done
-
return 0
}
run_test 15 "One directory per OST/pool"
test_16() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=10
local i=0
rm -rf $POOL_ROOT/$tdir
- destroy_pool $POOL
-
return 0
}
run_test 16 "Inheritance of pool properties"
test_17() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=10
local i=0
}
test_18() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=10000
local i=0
test_19() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=12
local dir1=$POOL_ROOT/dir1
done
rm -rf $dir1 $dir2
- destroy_pool $POOL
return 0
}
run_test 19 "Pools should not come into play when not specified"
test_20() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=12
local dir1=$POOL_ROOT/dir1
check_file_not_in_pool $dir2/file4 $POOL2
rm -rf $dir1
- destroy_pool $POOL
- destroy_pool $POOL2
return 0
}
run_test 20 "Different pools in a directory hierarchy."
test_21() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
[[ $OSTCOUNT -le 1 ]] && skip_env "Need atleast 2 OSTs" && return
check_file_in_pool $dir/file1 $POOL
rm -rf $dir
- destroy_pool $POOL
return 0
}
}
test_22() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
[[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
error "createmany $POOL_ROOT/${tfile} failed!"
wait
- destroy_pool $POOL
- destroy_pool $POOL2
-
return 0
}
run_test 22 "Simultaneous manipulation of a pool"
test_23() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
[[ $OSTCOUNT -le 1 ]] && skip_env "Need atleast 2 OSTs" && return
df -h
rm -rf $POOL_ROOT
- destroy_pool $POOL
return 0
}
run_test 23 "OST pools and quota"
test_24() {
+ set_cleanup_trap
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
[[ $OSTCOUNT -le 1 ]] && skip_env "Need atleast 2 OSTs" && return
done
rm -rf $POOL_ROOT
- destroy_pool $POOL
return 0
}
run_test 24 "Independence of pool from other setstripe parameters"
test_25() {
+ set_cleanup_trap
local dev=$(mdsdevname ${SINGLEMDS//mds/})
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
done
rm -rf $POOL_ROOT
- for i in $(seq 10); do
- destroy_pool pool$i
- done
}
run_test 25 "Create new pool and restart MDS ======================="