summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrun-tests.sh158
-rw-r--r--tests/basic/afr/arbiter-mount.t4
-rw-r--r--tests/basic/afr/arbiter.t12
-rw-r--r--tests/basic/afr/durability-off.t1
-rw-r--r--tests/basic/afr/sparse-file-self-heal.t10
-rw-r--r--tests/basic/afr/split-brain-healing.t2
-rw-r--r--tests/basic/ec/ec.t4
-rw-r--r--tests/basic/gfapi/Makefile.am11
-rw-r--r--tests/basic/logchecks-messages.h5
-rwxr-xr-xtests/basic/mount-nfs-auth.t4
-rwxr-xr-xtests/basic/quota-anon-fd-nfs.t1
-rwxr-xr-xtests/basic/quota-nfs.t1
-rwxr-xr-xtests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t2
-rwxr-xr-xtests/basic/tier/ctr-rename-overwrite.t1
-rwxr-xr-xtests/basic/tier/file_with_spaces.t1
-rwxr-xr-xtests/basic/tier/fops-during-migration-pause.t8
-rwxr-xr-xtests/basic/tier/fops-during-migration.t3
-rw-r--r--tests/basic/tier/frequency-counters.t1
-rw-r--r--tests/basic/tier/legacy-many.t3
-rwxr-xr-xtests/basic/tier/locked_file_migration.t1
-rw-r--r--tests/basic/tier/new-tier-cmds.t1
-rw-r--r--tests/basic/tier/readdir-during-migration.t1
-rwxr-xr-xtests/basic/tier/record-metadata-heat.t3
-rw-r--r--tests/basic/tier/tier-file-create.t2
-rw-r--r--tests/basic/tier/tier-heald.t1
-rw-r--r--tests/basic/tier/tier-snapshot.t2
-rwxr-xr-xtests/basic/tier/tier.t1
-rwxr-xr-xtests/basic/tier/tier_lookup_heal.t2
-rw-r--r--tests/basic/tier/tierd_check.t1
-rwxr-xr-xtests/basic/tier/unlink-during-migration.t1
-rw-r--r--tests/bitrot/br-state-check.t1
-rw-r--r--tests/bugs/bitrot/bug-1288490.t4
-rw-r--r--tests/bugs/cli/bug-1030580.t3
-rw-r--r--tests/bugs/cli/bug-1047416.t3
-rwxr-xr-xtests/bugs/distribute/bug-1066798.t2
-rwxr-xr-xtests/bugs/distribute/bug-1117851.t4
-rwxr-xr-xtests/bugs/distribute/bug-1161311.t2
-rw-r--r--tests/bugs/distribute/bug-1190734.t2
-rw-r--r--tests/bugs/distribute/bug-860663.t2
-rwxr-xr-xtests/bugs/fuse/bug-924726.t4
-rw-r--r--tests/bugs/geo-replication/bug-1111490.t2
-rw-r--r--tests/bugs/glusterd/bug-1225716-brick-online-validation-remove-brick.t2
-rw-r--r--tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t3
-rwxr-xr-xtests/bugs/glusterd/bug-857330/normal.t2
-rwxr-xr-xtests/bugs/glusterd/bug-857330/xml.t2
-rwxr-xr-xtests/bugs/glusterfs/bug-853690.t1
-rw-r--r--tests/bugs/glusterfs/bug-867253.t4
-rwxr-xr-xtests/bugs/glusterfs/bug-892730.t1
-rwxr-xr-x[-rw-r--r--]tests/bugs/quick-read/bug-846240.t0
-rw-r--r--tests/bugs/quota/bug-1235182.t5
-rw-r--r--tests/bugs/quota/bug-1260545.t3
-rw-r--r--tests/bugs/replicate/bug-1221481-allow-fops-on-dir-split-brain.t2
-rwxr-xr-xtests/bugs/rpc/bug-954057.t4
-rw-r--r--tests/bugs/shard/bug-1256580.t1
-rw-r--r--tests/bugs/snapshot/bug-1109889.t2
-rw-r--r--tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t2
-rw-r--r--tests/bugs/snapshot/bug-1155042-dont-display-deactivated-snapshots.t6
-rwxr-xr-xtests/bugs/snapshot/bug-1162498.t3
-rwxr-xr-xtests/bugs/snapshot/bug-1166197.t1
-rw-r--r--tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t1
-rwxr-xr-xtests/bugs/tier/bug-1279376-rename-demoted-file.t3
-rw-r--r--tests/bugs/tier/bug-1286974.t3
-rw-r--r--tests/changelog.rc5
-rwxr-xr-xtests/features/ssl-authz.t2
-rwxr-xr-xtests/features/unhashed-auto.t6
-rw-r--r--tests/geo-rep/georep-basic-dr-rsync.t2
-rw-r--r--tests/geo-rep/georep-basic-dr-tarssh.t2
-rw-r--r--tests/include.rc186
-rw-r--r--tests/nfs.rc2
-rw-r--r--tests/snapshot.rc10
-rw-r--r--tests/volume.rc9
71 files changed, 378 insertions, 174 deletions
diff --git a/run-tests.sh b/run-tests.sh
index 2c1ff59442a..b4a5e677eba 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -6,7 +6,10 @@ export TZ=UTC
force="no"
retry="no"
tests=""
-exit_on_failure="yes"
+exit_on_failure="no"
+skip_bad_tests="yes"
+skip_known_bugs="yes"
+section_separator="========================================"
OSTYPE=$(uname -s)
@@ -155,47 +158,68 @@ function match()
return $match
}
-# If you're submitting a fix related to one of these tests and want its result
-# to be considered, you'll need to remove it from the list as part of your
-# patch.
-function is_bad_test ()
+# Tests can have comment lines with some comma separated values within them.
+# Key names used to determine test status are
+# G_TESTDEF_TEST_STATUS_CENTOS6
+# G_TESTDEF_TEST_STATUS_NETBSD7
+# Some examples:
+# G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=123456
+# G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=4444444
+# G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=123456;555555
+# You can change status of test to enabled or delete the line only if all the
+# bugs are closed or modified or if the patch fixes it.
+function get_test_status ()
{
- local name=$1
- for bt in ./tests/basic/quota-anon-fd-nfs.t \
- ./tests/bugs/quota/bug-1235182.t \
- ./tests/basic/quota-nfs.t \
- ./tests/basic/tier/tier_lookup_heal.t \
- ./tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t \
- ./tests/basic/tier/fops-during-migration.t \
- ./tests/basic/tier/record-metadata-heat.t \
- ./tests/basic/tier/tier-snapshot.t \
- ./tests/bugs/snapshot/bug-1109889.t \
- ./tests/bugs/distribute/bug-1066798.t \
- ./tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t \
- ./tests/geo-rep/georep-basic-dr-rsync.t \
- ./tests/geo-rep/georep-basic-dr-tarssh.t \
- ./tests/bugs/fuse/bug-924726.t \
- ./tests/basic/afr/split-brain-healing.t \
- ./tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t \
- ./tests/bugs/tier/bug-1286974.t \
- ./tests/features/weighted-rebalance.t \
- ./tests/performance/open-behind.t \
- ./tests/basic/afr/self-heald.t \
- ./tests/bugs/stripe/bug-1002207.t \
- ./tests/bugs/stripe/bug-1111454.t \
- ; do
- [ x"$name" = x"$bt" ] && return 0 # bash: zero means true/success
- done
- return 1 # bash: non-zero means false/failure
+ local test_name=$1
+ local host_os=""
+ local result=""
+
+ host_os=$(uname -s)
+
+ case "$host_os" in
+ # Leaving out the logic to determine the particular distro and version
+ # for later. Why does the key have the distro and version then?
+ # Because changing the key in all test files would be very big process
+ # updating just this function with a better logic much simpler.
+ Linux)
+ result=$(grep -e "^#G_TESTDEF_TEST_STATUS_CENTOS6" $test_name | \
+ awk -F"," {'print $1'} | awk -F"=" {'print $2'}) ;;
+ NetBSD)
+ result=$(grep -e "^#G_TESTDEF_TEST_STATUS_NETBSD7" $test_name | \
+ awk -F"," {'print $1'} | awk -F"=" {'print $2'}) ;;
+ *)
+ result="ENABLED" ;;
+ esac
+
+ echo "$result"
+
}
-function is_unsupported_test()
+function get_bug_list_for_disabled_test ()
{
- if [ x"$OSTYPE" != x"NetBSD" ]; then
- return 1
- fi
+ local test_name=$1
+ local host_os=""
+ local result=""
+
+ host_os=$(uname -s)
+
+ case "$host_os" in
+ # Leaving out the logic to determine the particular distro and version
+ # for later. Why does the key have the distro and version then?
+ # Because changing the key in all test files would be very big process
+ # updating just this function with a better logic much simpler.
+ Linux)
+ result=$(grep -e "^#G_TESTDEF_TEST_STATUS_CENTOS6" $test_name | \
+ awk -F"," {'print $2'} | awk -F"=" {'print $2'}) ;;
+ NetBSD)
+ result=$(grep -e "^#G_TESTDEF_TEST_STATUS_NETBSD7" $test_name | \
+ awk -F"," {'print $2'} | awk -F"=" {'print $2'}) ;;
+ *)
+ result="0000000" ;;
+ esac
+
+ echo "$result"
- grep -iqs tier $1
}
function run_tests()
@@ -203,6 +227,11 @@ function run_tests()
RES=0
FAILED=''
GENERATED_CORE=''
+ total_tests=0
+ selected_tests=0
+ skipped_bad_tests=0
+ skipped_known_issue_tests=0
+ total_run_tests=0
# key = path of .t file; value = time taken to run the .t file
declare -A ELAPSEDTIMEMAP
@@ -210,24 +239,35 @@ function run_tests()
for t in $(find ${regression_testsdir}/tests -name '*.t' \
| LC_COLLATE=C sort) ; do
old_cores=$(ls /*-*.core 2> /dev/null | wc -l)
+ total_tests=$((total_tests+1))
if match $t "$@" ; then
+ selected_tests=$((selected_tests+1))
echo
- echo "=================================================="
- if is_bad_test $t; then
+ echo $section_separator$section_separator
+ if [[ $(get_test_status $t) == "BAD_TEST" ]] && \
+ [[ $skip_bad_tests == "yes" ]]
+ then
+ skipped_bad_tests=$((skipped_bad_tests+1))
echo "Skipping bad test file $t"
- echo "=================================================="
+ echo "Reason: bug(s):" $(get_bug_list_for_disabled_test $t)
+ echo $section_separator$section_separator
echo
continue
fi
- if is_unsupported_test $t; then
- echo "Skipping test file $t (feature unsupported on platform)"
- echo "=================================================="
+ if [[ $(get_test_status $t) == "KNOWN_ISSUE" ]] && \
+ [[ $skip_known_bugs == "yes" ]]
+ then
+ skipped_known_issue_tests=$((skipped_known_issue_tests+1))
+ echo "Skipping test file $t due to known issue"
+ echo "Reason: bug(s):" $(get_bug_list_for_disabled_test $t)
+ echo $section_separator$section_separator
echo
continue
fi
- echo "Running tests in file $t"
+ total_run_tests=$((total_run_tests+1))
+ echo "[$(date +%H:%M:%S)] Running tests in file $t"
starttime="$(date +%s)"
- prove -mf --timer $t
+ prove -vf $t
TMP_RES=$?
ELAPSEDTIMEMAP[$t]=`expr $(date +%s) - $starttime`
if [ ${TMP_RES} -ne 0 ] && [ "x${retry}" = "xyes" ] ; then
@@ -239,7 +279,7 @@ function run_tests()
echo " * we got some spurous failures *"
echo " *********************************"
echo ""
- prove -mf --timer $t
+ prove -vf $t
TMP_RES=$?
fi
if [ ${TMP_RES} -ne 0 ] ; then
@@ -254,7 +294,7 @@ function run_tests()
GENERATED_CORE="${GENERATED_CORE}${t} "
fi
echo "End of test $t"
- echo "=================================================="
+ echo $section_separator$section_separator
echo
if [ $RES -ne 0 ] && [ x"$exit_on_failure" = "xyes" ] ; then
break;
@@ -263,33 +303,45 @@ function run_tests()
done
echo
echo "Run complete"
+ echo $section_separator$section_separator
+ echo "Number of tests found: $total_tests"
+ echo "Number of tests selected for run based on pattern: $selected_tests"
+ echo "Number of tests skipped as they were marked bad: $skipped_bad_tests"
+ echo "Number of tests skipped because of known_issues: $skipped_known_issue_tests"
+ echo "Number of tests that were run: $total_run_tests"
if [ ${RES} -ne 0 ] ; then
FAILED=$( echo ${FAILED} | tr ' ' '\n' | sort -u )
FAILED_COUNT=$( echo -n "${FAILED}" | grep -c '^' )
- echo -e "$FAILED_COUNT test(s) failed \n${FAILED}"
+ echo -e "\n$FAILED_COUNT test(s) failed \n${FAILED}"
GENERATED_CORE=$( echo ${GENERATED_CORE} | tr ' ' '\n' | sort -u )
GENERATED_CORE_COUNT=$( echo -n "${GENERATED_CORE}" | grep -c '^' )
- echo -e "$GENERATED_CORE_COUNT test(s) generated core \n${GENERATED_CORE}"
+ echo -e "\n$GENERATED_CORE_COUNT test(s) generated core \n${GENERATED_CORE}"
fi
- echo "Slowest 10 tests: "
+ echo
+ echo "Tests ordered by time taken, slowest to fastest: "
+ echo $section_separator$section_separator
for key in "${!ELAPSEDTIMEMAP[@]}"
do
- echo $key ' - ' ${ELAPSEDTIMEMAP["$key"]}
- done | sort -rn -k3 | head
+ echo "$key - ${ELAPSEDTIMEMAP["$key"]} second"
+ done | sort -rn -k3
+ echo
echo "Result is $RES"
+ echo
return ${RES}
}
function parse_args () {
- args=`getopt frc "$@"`
+ args=`getopt frcbk "$@"`
set -- $args
while [ $# -gt 0 ]; do
case "$1" in
-f) force="yes" ;;
-r) retry="yes" ;;
-c) exit_on_failure="no" ;;
+ -b) skip_bad_tests="no" ;;
+ -k) skip_known_bugs="no" ;;
--) shift; break;;
esac
shift
diff --git a/tests/basic/afr/arbiter-mount.t b/tests/basic/afr/arbiter-mount.t
index 47c327633f3..7276285202f 100644
--- a/tests/basic/afr/arbiter-mount.t
+++ b/tests/basic/afr/arbiter-mount.t
@@ -29,8 +29,8 @@ mount_nfs $H0:/$V0 $N0
TEST [ $? -ne 0 ]
TEST $CLI volume start $V0 force
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/${V0}0
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/${V0}1
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}1
EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0
diff --git a/tests/basic/afr/arbiter.t b/tests/basic/afr/arbiter.t
index c91e2e90098..6bcc5e9ab17 100644
--- a/tests/basic/afr/arbiter.t
+++ b/tests/basic/afr/arbiter.t
@@ -9,15 +9,23 @@ TEST glusterd;
TEST pidof glusterd
# Non arbiter replica 3 volumes should not have arbiter-count option enabled.
+TEST mkdir -p $B0/${V0}{0,1,2}
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume start $V0
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
TEST ! stat $M0/.meta/graphs/active/$V0-replicate-0/options/arbiter-count
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
TEST $CLI volume stop $V0
TEST $CLI volume delete $V0
+# Make sure we clean up *all the way* so we don't get "brick X is already part
+# of a volume" errors.
+cleanup;
+TEST glusterd;
+TEST pidof glusterd
+
# Create and mount a replica 3 arbiter volume.
+TEST mkdir -p $B0/${V0}{0,1,2}
TEST $CLI volume create $V0 replica 3 arbiter 1 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 performance.write-behind off
TEST $CLI volume set $V0 performance.stat-prefetch off
@@ -72,5 +80,5 @@ EXPECT 0 get_pending_heal_count $V0
TEST cat $M0/file
TEST getfattr -n user.name $M0/file
TEST `echo append>> $M0/file`
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
cleanup
diff --git a/tests/basic/afr/durability-off.t b/tests/basic/afr/durability-off.t
index 155ffa09ef0..93346c40112 100644
--- a/tests/basic/afr/durability-off.t
+++ b/tests/basic/afr/durability-off.t
@@ -42,3 +42,4 @@ EXPECT_WITHIN $HEAL_TIMEOUT "0" get_pending_heal_count $V0
EXPECT "^2$" echo $($CLI volume profile $V0 info | grep -w FSYNC | wc -l)
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=1332797
diff --git a/tests/basic/afr/sparse-file-self-heal.t b/tests/basic/afr/sparse-file-self-heal.t
index 67d9c4f5182..04b77c41de1 100644
--- a/tests/basic/afr/sparse-file-self-heal.t
+++ b/tests/basic/afr/sparse-file-self-heal.t
@@ -56,6 +56,11 @@ EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1
TEST gluster volume heal $V0 full
EXPECT_WITHIN $HEAL_TIMEOUT "0" get_pending_heal_count $V0
+#If the file system of bricks is XFS and speculative preallocation is on,
+#dropping cahce should be done to free speculatively pre-allocated blocks
+#by XFS.
+drop_cache $M0
+
big_md5sum_0=$(md5sum $B0/${V0}0/big | awk '{print $1}')
small_md5sum_0=$(md5sum $B0/${V0}0/small | awk '{print $1}')
bigger2big_md5sum_0=$(md5sum $B0/${V0}0/bigger2big | awk '{print $1}')
@@ -137,6 +142,11 @@ EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1
TEST gluster volume heal $V0 full
EXPECT_WITHIN $HEAL_TIMEOUT "0" get_pending_heal_count $V0
+#If the file system of bricks is XFS and speculative preallocation is on,
+#dropping cahce should be done to free speculatively pre-allocated blocks
+#by XFS.
+drop_cache $M0
+
big_md5sum_0=$(md5sum $B0/${V0}0/big | awk '{print $1}')
small_md5sum_0=$(md5sum $B0/${V0}0/small | awk '{print $1}')
bigger2big_md5sum_0=$(md5sum $B0/${V0}0/bigger2big | awk '{print $1}')
diff --git a/tests/basic/afr/split-brain-healing.t b/tests/basic/afr/split-brain-healing.t
index 2171de3029d..71352059f5f 100644
--- a/tests/basic/afr/split-brain-healing.t
+++ b/tests/basic/afr/split-brain-healing.t
@@ -224,3 +224,5 @@ EXPECT "1" echo $?
cd -
TEST rm $AREQUAL_PATH/arequal-checksum
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/basic/ec/ec.t b/tests/basic/ec/ec.t
index 773d8af3084..b07006545b9 100644
--- a/tests/basic/ec/ec.t
+++ b/tests/basic/ec/ec.t
@@ -221,7 +221,7 @@ TEST setup_perm_file $M0
sleep 2
# Unmount/remount so that create/write and truncate don't see cached data.
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
TEST $GFS -s $H0 --volfile-id $V0 $M1
EXPECT_WITHIN $CHILD_UP_TIMEOUT "8" ec_child_up_count $V0 0
@@ -235,7 +235,7 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status'
EXPECT_WITHIN $CHILD_UP_TIMEOUT "10" ec_child_up_count $V0 0
# Unmount/remount again, same reason as before.
-TEST umount $M1
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1
TEST $GFS -s $H0 --volfile-id $V0 $M0
EXPECT_WITHIN $CHILD_UP_TIMEOUT "10" ec_child_up_count $V0 0
diff --git a/tests/basic/gfapi/Makefile.am b/tests/basic/gfapi/Makefile.am
index cdb0e543803..b166fcc3fa6 100644
--- a/tests/basic/gfapi/Makefile.am
+++ b/tests/basic/gfapi/Makefile.am
@@ -4,12 +4,17 @@
CFLAGS = -Wall -g $(shell pkg-config --cflags glusterfs-api)
LDFLAGS = $(shell pkg-config --libs glusterfs-api)
-BINARIES = upcall-cache-invalidate libgfapi-fini-hang anonymous_fd
+BINARIES = upcall-cache-invalidate libgfapi-fini-hang anonymous_fd seek
%: %.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
-all: $(BINARIES)
+all: check-pkgconfig $(BINARIES)
clean:
- -$(RM) $(BINARIES)
+ -$(RM) $(BINARIES)
+.phony: check-pkgconfig
+
+check-pkgconfig:
+ pkg-config --exists glusterfs-api
diff --git a/tests/basic/logchecks-messages.h b/tests/basic/logchecks-messages.h
index 50efe9dfadd..6344037b44a 100644
--- a/tests/basic/logchecks-messages.h
+++ b/tests/basic/logchecks-messages.h
@@ -11,11 +11,6 @@
#ifndef _LOGCHECKS_MESSAGES_H_
#define _LOGCHECKS_MESSAGES_H_
-#ifndef _CONFIG_H
-#define _CONFIG_H
-#include "config.h"
-#endif
-
#include "glfs-message-id.h"
/* NOTE: Rules for message additions
diff --git a/tests/basic/mount-nfs-auth.t b/tests/basic/mount-nfs-auth.t
index 369333241c1..6ecac5b469a 100755
--- a/tests/basic/mount-nfs-auth.t
+++ b/tests/basic/mount-nfs-auth.t
@@ -70,7 +70,7 @@ function netgroup_deny_this_host () {
}
function create_vol () {
- TEST $CLI vol create $V0 replica 3 $H0:$B0/b0 $H0:$B0/b1 $H0:$B0/b2
+ $CLI vol create $V0 $H0:$B0/b0
}
function setup_cluster() {
@@ -140,9 +140,7 @@ function restart_nfs () {
setup_cluster
# run preliminary tests
-TEST $CLI vol set $V0 cluster.self-heal-daemon off
TEST $CLI vol set $V0 nfs.disable off
-TEST $CLI vol set $V0 cluster.choose-local off
TEST $CLI vol start $V0
# Get NFS state directory
diff --git a/tests/basic/quota-anon-fd-nfs.t b/tests/basic/quota-anon-fd-nfs.t
index aaba0b1d16e..e2cce0b69c2 100755
--- a/tests/basic/quota-anon-fd-nfs.t
+++ b/tests/basic/quota-anon-fd-nfs.t
@@ -102,3 +102,4 @@ EXPECT "1" get_aux
rm -f $QDD
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/basic/quota-nfs.t b/tests/basic/quota-nfs.t
index 00c76a49f56..16d5aa6a90c 100755
--- a/tests/basic/quota-nfs.t
+++ b/tests/basic/quota-nfs.t
@@ -61,3 +61,4 @@ EXPECT "1" get_aux
rm -f $QDD
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t b/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t
index 8aa1380ae46..754e8033f61 100755
--- a/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t
+++ b/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t
@@ -53,3 +53,5 @@ EXPECT_WITHIN $REBALANCE_TIMEOUT "0" confirm_vol_stopped $V0
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/basic/tier/ctr-rename-overwrite.t b/tests/basic/tier/ctr-rename-overwrite.t
index a1d5af03a39..8bccd3b3489 100755
--- a/tests/basic/tier/ctr-rename-overwrite.t
+++ b/tests/basic/tier/ctr-rename-overwrite.t
@@ -47,3 +47,4 @@ ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \
TEST [ $ENTRY_COUNT -eq 2 ]
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/file_with_spaces.t b/tests/basic/tier/file_with_spaces.t
index 3e3c34da725..bd99e71ffe5 100755
--- a/tests/basic/tier/file_with_spaces.t
+++ b/tests/basic/tier/file_with_spaces.t
@@ -68,3 +68,4 @@ EXPECT "yes" exists_and_regular_file $CPATH
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/fops-during-migration-pause.t b/tests/basic/tier/fops-during-migration-pause.t
index 20719c8510a..10bd3f4667a 100755
--- a/tests/basic/tier/fops-during-migration-pause.t
+++ b/tests/basic/tier/fops-during-migration-pause.t
@@ -5,8 +5,8 @@
. $(dirname $0)/../../tier.rc
NUM_BRICKS=3
-DEMOTE_FREQ=30
-PROMOTE_FREQ=30
+DEMOTE_FREQ=10
+PROMOTE_FREQ=10
TEST_STR="Testing write and truncate fops on tier migration"
@@ -59,9 +59,8 @@ TEST mkdir $M0/dir1
# Create a large file (800MB), so that rebalance takes time
# The file will be created on the hot tier
-
sleep_until_mid_cycle $DEMOTE_FREQ
-dd if=/dev/zero of=$M0/dir1/FILE1 bs=256k count=4096
+dd if=/dev/zero of=$M0/dir1/FILE1 bs=256k count=5120
# Get the path of the file on the hot tier
HPATH=`find $B0/hot/ -name FILE1`
@@ -87,3 +86,4 @@ TEST test -s $HPATH
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/fops-during-migration.t b/tests/basic/tier/fops-during-migration.t
index 96180d23917..4be05acb357 100755
--- a/tests/basic/tier/fops-during-migration.t
+++ b/tests/basic/tier/fops-during-migration.t
@@ -103,4 +103,5 @@ EXPECT "1" check_file_content $M0/dir1/FILE1 "$TEST_STR"
TEST getfattr -n "user.test_xattr" $M0/dir1/FILE1
cleanup;
-
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/basic/tier/frequency-counters.t b/tests/basic/tier/frequency-counters.t
index 51c7ab4a700..c335c02c563 100644
--- a/tests/basic/tier/frequency-counters.t
+++ b/tests/basic/tier/frequency-counters.t
@@ -79,3 +79,4 @@ cd /
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/legacy-many.t b/tests/basic/tier/legacy-many.t
index e419bec53bc..a9fcba85209 100644
--- a/tests/basic/tier/legacy-many.t
+++ b/tests/basic/tier/legacy-many.t
@@ -42,7 +42,7 @@ TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0;
# Create a number of "legacy" files before attaching tier
mkdir $M0/${TEST_DIR}
cd $M0/${TEST_DIR}
-TEST create_many_files tfile $NUM_FILES
+TEST create_many_files file $NUM_FILES
wait
# Attach tier
@@ -84,3 +84,4 @@ TEST ! getfattr -n "trusted.tier.fix.layout.complete" $CPATH
cd;
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/locked_file_migration.t b/tests/basic/tier/locked_file_migration.t
index f7a9d1f355d..1a7e3f53c8e 100755
--- a/tests/basic/tier/locked_file_migration.t
+++ b/tests/basic/tier/locked_file_migration.t
@@ -77,3 +77,4 @@ rm $(dirname $0)/file_lock
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/new-tier-cmds.t b/tests/basic/tier/new-tier-cmds.t
index ce8dbae8660..e4fef69d265 100644
--- a/tests/basic/tier/new-tier-cmds.t
+++ b/tests/basic/tier/new-tier-cmds.t
@@ -87,3 +87,4 @@ EXPECT "Tier command failed" $CLI_1 volume tier $V0 detach status
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/readdir-during-migration.t b/tests/basic/tier/readdir-during-migration.t
index 42199c57768..e2a43c93572 100644
--- a/tests/basic/tier/readdir-during-migration.t
+++ b/tests/basic/tier/readdir-during-migration.t
@@ -62,3 +62,4 @@ cd /
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/record-metadata-heat.t b/tests/basic/tier/record-metadata-heat.t
index d36ed80591a..d4481371f68 100755
--- a/tests/basic/tier/record-metadata-heat.t
+++ b/tests/basic/tier/record-metadata-heat.t
@@ -98,4 +98,5 @@ echo "File path on hot tier: "$HPATH
EXPECT "yes" exists_and_regular_file $HPATH
cleanup;
-
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/basic/tier/tier-file-create.t b/tests/basic/tier/tier-file-create.t
index 28caacd2a5a..06f0e241502 100644
--- a/tests/basic/tier/tier-file-create.t
+++ b/tests/basic/tier/tier-file-create.t
@@ -57,3 +57,5 @@ cd
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=KNOWN_ISSUE,BUG=1315560
diff --git a/tests/basic/tier/tier-heald.t b/tests/basic/tier/tier-heald.t
index 05b19e437c0..8dcdd39c619 100644
--- a/tests/basic/tier/tier-heald.t
+++ b/tests/basic/tier/tier-heald.t
@@ -95,3 +95,4 @@ TEST ! $CLI volume set dist disperse-self-heal-daemon off
TEST ! $CLI volume set dist cluster.disperse-self-heal-daemon on
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/tier-snapshot.t b/tests/basic/tier/tier-snapshot.t
index b90d5606998..6e7951d1963 100644
--- a/tests/basic/tier/tier-snapshot.t
+++ b/tests/basic/tier/tier-snapshot.t
@@ -46,3 +46,5 @@ TEST $CLI snapshot create snap4 $V0 no-timestamp;
TEST $CLI snapshot delete all;
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/basic/tier/tier.t b/tests/basic/tier/tier.t
index 4b3693037fe..5f1dbde8d03 100755
--- a/tests/basic/tier/tier.t
+++ b/tests/basic/tier/tier.t
@@ -205,3 +205,4 @@ cleanup
rm -rf /tmp/d1
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/tier_lookup_heal.t b/tests/basic/tier/tier_lookup_heal.t
index 81bb0d67179..825f81db392 100755
--- a/tests/basic/tier/tier_lookup_heal.t
+++ b/tests/basic/tier/tier_lookup_heal.t
@@ -72,3 +72,5 @@ EXPECT_WITHIN $PROMOTE_TIMEOUT "0" file_on_fast_tier file1
cd;
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/basic/tier/tierd_check.t b/tests/basic/tier/tierd_check.t
index 9ef12d50211..2b8ccbbbd96 100644
--- a/tests/basic/tier/tierd_check.t
+++ b/tests/basic/tier/tierd_check.t
@@ -60,3 +60,4 @@ TEST pkill -f "$B0/hot/$V0"
TEST ! $CLI volume tier $V0 detach start
cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/basic/tier/unlink-during-migration.t b/tests/basic/tier/unlink-during-migration.t
index 78887433ccb..0c2255cfda6 100755
--- a/tests/basic/tier/unlink-during-migration.t
+++ b/tests/basic/tier/unlink-during-migration.t
@@ -89,3 +89,4 @@ TEST ! stat $CPATH
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/bitrot/br-state-check.t b/tests/bitrot/br-state-check.t
index 0390df5e4a0..1efd2087897 100644
--- a/tests/bitrot/br-state-check.t
+++ b/tests/bitrot/br-state-check.t
@@ -79,3 +79,4 @@ TEST $CLI volume bitrot $V0 scrub pause
TEST kill_brick $V0 $H0 $B0/${V0}2
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=1332477
diff --git a/tests/bugs/bitrot/bug-1288490.t b/tests/bugs/bitrot/bug-1288490.t
index 1d5e913cd59..5f67f4a6ec5 100644
--- a/tests/bugs/bitrot/bug-1288490.t
+++ b/tests/bugs/bitrot/bug-1288490.t
@@ -25,8 +25,8 @@ TEST setfattr -n trusted.bit-rot.bad-file -v 0x3100 $B0/brick0/FILE
TEST $CLI volume stop $V0
TEST $CLI volume start $V0
EXPECT 'Started' volinfo_field $V0 'Status';
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/brick0
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/brick1
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/brick0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/brick1
EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0
EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 1
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count
diff --git a/tests/bugs/cli/bug-1030580.t b/tests/bugs/cli/bug-1030580.t
index a907950e73f..fc6efe1e69a 100644
--- a/tests/bugs/cli/bug-1030580.t
+++ b/tests/bugs/cli/bug-1030580.t
@@ -16,6 +16,9 @@ TEST $CLI volume start $V0
TEST $CLI volume profile $V0 start
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
+# Clear the profile info uptill now.
+TEST $CLI volume profile $V0 info clear
+
# Verify 'volume profile info' prints both cumulative and incremental stats
write_to_file &
wait
diff --git a/tests/bugs/cli/bug-1047416.t b/tests/bugs/cli/bug-1047416.t
index 6e1b0a48467..d4ad5c49a59 100644
--- a/tests/bugs/cli/bug-1047416.t
+++ b/tests/bugs/cli/bug-1047416.t
@@ -16,6 +16,9 @@ TEST $CLI volume start $V0
TEST $CLI volume profile $V0 start
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
+# Clear the profile info uptill now.
+TEST $CLI volume profile $V0 info clear
+
# Verify 'volume profile info' prints both cumulative and incremental stats
write_to_file &
wait
diff --git a/tests/bugs/distribute/bug-1066798.t b/tests/bugs/distribute/bug-1066798.t
index e53e1aebf2b..03de970a637 100755
--- a/tests/bugs/distribute/bug-1066798.t
+++ b/tests/bugs/distribute/bug-1066798.t
@@ -84,3 +84,5 @@ TEST [ `echo $var | awk '{print $5}'` = "0" ]
TEST [ `echo $var | awk '{print $6}'` = "0" ]
cleanup
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/bugs/distribute/bug-1117851.t b/tests/bugs/distribute/bug-1117851.t
index 4e35debae9d..678103869cf 100755
--- a/tests/bugs/distribute/bug-1117851.t
+++ b/tests/bugs/distribute/bug-1117851.t
@@ -85,8 +85,8 @@ TEST move_files $M1
EXPECT_WITHIN 120 "done" cat $M0/status_0
EXPECT_WITHIN 120 "done" cat $M1/status_1
-TEST umount $M0
-TEST umount $M1
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1
TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0;
TEST check_files $M0
diff --git a/tests/bugs/distribute/bug-1161311.t b/tests/bugs/distribute/bug-1161311.t
index d1bd47826f9..c5a7f041ac8 100755
--- a/tests/bugs/distribute/bug-1161311.t
+++ b/tests/bugs/distribute/bug-1161311.t
@@ -63,7 +63,7 @@ dd if=/dev/urandom of=$M0/dir1/FILE2 bs=64k count=10240
TEST mv $M0/dir1/FILE2 $M0/dir1/FILE1
# unmount and remount the volume
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
TEST glusterfs -s $H0 --volfile-id $V0 $M0;
# Start the rebalance
diff --git a/tests/bugs/distribute/bug-1190734.t b/tests/bugs/distribute/bug-1190734.t
index 895dd771ed6..ae34ec84729 100644
--- a/tests/bugs/distribute/bug-1190734.t
+++ b/tests/bugs/distribute/bug-1190734.t
@@ -22,7 +22,7 @@ function get_file_count {
function reset {
$CLI volume stop $V0
- umount $1
+ ${UMOUNT_F} $1
$CLI volume delete $V0
}
diff --git a/tests/bugs/distribute/bug-860663.t b/tests/bugs/distribute/bug-860663.t
index cc2b505080b..a4946718398 100644
--- a/tests/bugs/distribute/bug-860663.t
+++ b/tests/bugs/distribute/bug-860663.t
@@ -40,7 +40,7 @@ kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`;
TEST ! $CLI volume rebalance $V0 fix-layout start
TEST $CLI volume start $V0 force
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/${V0}1
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}1
TEST $CLI volume rebalance $V0 fix-layout start
diff --git a/tests/bugs/fuse/bug-924726.t b/tests/bugs/fuse/bug-924726.t
index 58bf2c8a083..65c56aa57b8 100755
--- a/tests/bugs/fuse/bug-924726.t
+++ b/tests/bugs/fuse/bug-924726.t
@@ -25,7 +25,7 @@ TEST glusterfs -s $H0 --volfile-id $V0 $M0;
TEST ls $M0
-GLFS_MNT_PID=`ps ax | grep -i $M0 | grep glusterfs | grep -v grep | sed -e "s/^ *\([0-9]*\).*/\1/g"`
+GLFS_MNT_PID=`ps ax | grep "glusterfs -s $H0 \-\-volfile\-id $V0 $M0" | sed -e "s/^ *\([0-9]*\).*/\1/g"`
SOCKETS_BEFORE_SWITCH=`netstat -nap | grep $GLFS_MNT_PID | grep ESTABLISHED | wc -l`
@@ -43,3 +43,5 @@ SOCKETS_AFTER_SWITCH=`netstat -nap | grep $GLFS_MNT_PID | grep ESTABLISHED | wc
TEST [ $SOCKETS_AFTER_SWITCH = `expr $SOCKETS_BEFORE_SWITCH + 1` ]
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/bugs/geo-replication/bug-1111490.t b/tests/bugs/geo-replication/bug-1111490.t
index d29cba1a396..9686fb5a0ef 100644
--- a/tests/bugs/geo-replication/bug-1111490.t
+++ b/tests/bugs/geo-replication/bug-1111490.t
@@ -25,7 +25,7 @@ EXPECT "$uuid" getfattr --only-values -n glusterfs.gfid.string $M0/file0
# unmount and mount again so as to start with a fresh inode table
# or use another mount...
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 --aux-gfid-mount
# touch the file again (gfid-access.py handles errno)
diff --git a/tests/bugs/glusterd/bug-1225716-brick-online-validation-remove-brick.t b/tests/bugs/glusterd/bug-1225716-brick-online-validation-remove-brick.t
index 5ac2ae2a91e..eca1c1a3723 100644
--- a/tests/bugs/glusterd/bug-1225716-brick-online-validation-remove-brick.t
+++ b/tests/bugs/glusterd/bug-1225716-brick-online-validation-remove-brick.t
@@ -18,7 +18,7 @@ kill -15 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`;
TEST ! $CLI volume remove-brick $V0 $H0:$B0/${V0}1 start
TEST $CLI volume start $V0 force
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/${V0}1
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}1
#remove-brick start should succeed as the brick is up
TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}1 start
diff --git a/tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t b/tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t
index 9ff1758f9c1..2ef20b94b69 100644
--- a/tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t
+++ b/tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t
@@ -38,4 +38,5 @@ TEST $CLI_1 peer detach $H2;
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_nfs_count
cleanup;
-
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/bugs/glusterd/bug-857330/normal.t b/tests/bugs/glusterd/bug-857330/normal.t
index d42f5dacaf6..70cb89dd462 100755
--- a/tests/bugs/glusterd/bug-857330/normal.t
+++ b/tests/bugs/glusterd/bug-857330/normal.t
@@ -46,7 +46,7 @@ TEST $CLI volume replace-brick $V0 $REP_BRICK_PAIR commit force;
##################
## Remove-brick ##
##################
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/${V0}3
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}3
COMMAND="volume remove-brick $V0 $H0:$B0/${V0}3 start"
PATTERN="ID:"
diff --git a/tests/bugs/glusterd/bug-857330/xml.t b/tests/bugs/glusterd/bug-857330/xml.t
index 6b87f21d9c1..391d189e387 100755
--- a/tests/bugs/glusterd/bug-857330/xml.t
+++ b/tests/bugs/glusterd/bug-857330/xml.t
@@ -52,7 +52,7 @@ TEST $CLI volume replace-brick $V0 $H0:$B0/${V0}2 $H0:$B0/${V0}3 commit force
##################
## Remove-brick ##
##################
-EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" brick_up_status $V0 $H0 $B0/${V0}3
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}3
COMMAND="volume remove-brick $V0 $H0:$B0/${V0}3 start"
PATTERN="task-id"
diff --git a/tests/bugs/glusterfs/bug-853690.t b/tests/bugs/glusterfs/bug-853690.t
index 59facfcddb0..7880b64488f 100755
--- a/tests/bugs/glusterfs/bug-853690.t
+++ b/tests/bugs/glusterfs/bug-853690.t
@@ -53,6 +53,7 @@ end-volume
volume test-replicate-0
type cluster/replicate
+ option afr-pending-xattr test-locks-0,test-locks-1
option background-self-heal-count 0
subvolumes test-locks-0 test-locks-1
end-volume
diff --git a/tests/bugs/glusterfs/bug-867253.t b/tests/bugs/glusterfs/bug-867253.t
index aee27c87158..41972a7731b 100644
--- a/tests/bugs/glusterfs/bug-867253.t
+++ b/tests/bugs/glusterfs/bug-867253.t
@@ -37,7 +37,7 @@ touch $M0/files{1..1000};
# Kill a brick process
kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}0.pid`;
-( cd $M0 ; umount $M0 ) # fail but drops kernel cache
+drop_cache $M0
ls -l $M0 >/dev/null;
@@ -48,7 +48,7 @@ TEST $CLI volume start $V0 force
# Kill a brick process
kill -9 `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-${V0}1.pid`;
-( cd $M0 ; umount $M0 )
+drop_cache $M0
ls -l $M0 >/dev/null;
diff --git a/tests/bugs/glusterfs/bug-892730.t b/tests/bugs/glusterfs/bug-892730.t
index a76961134c5..1fa0ff3bfb4 100755
--- a/tests/bugs/glusterfs/bug-892730.t
+++ b/tests/bugs/glusterfs/bug-892730.t
@@ -53,6 +53,7 @@ end-volume
volume test-replicate-0
type cluster/replicate
+ option afr-pending-xattr test-locks-0,test-locks-1
option background-self-heal-count 0
subvolumes test-locks-0 test-locks-1
end-volume
diff --git a/tests/bugs/quick-read/bug-846240.t b/tests/bugs/quick-read/bug-846240.t
index c47040de1d1..c47040de1d1 100644..100755
--- a/tests/bugs/quick-read/bug-846240.t
+++ b/tests/bugs/quick-read/bug-846240.t
diff --git a/tests/bugs/quota/bug-1235182.t b/tests/bugs/quota/bug-1235182.t
index 26cbaafe73b..c13f1bf7ef3 100644
--- a/tests/bugs/quota/bug-1235182.t
+++ b/tests/bugs/quota/bug-1235182.t
@@ -43,14 +43,17 @@ for i in {1..50}; do
#rename to different dir
TEST_IN_LOOP mkdir $M0/$ii
TEST_IN_LOOP mv -f $M0/$i/f$ii $M0/$ii/f$ii;
+ stat $M0/$ii/f$ii >/dev/null
done
echo "Wait for process with pid $PID to complete"
wait $PID
echo "Process with pid $PID finished"
-EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "100.0MB" quotausage "/"
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" STAT $M0/51/f51
rm -f $QDD
cleanup;
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/bugs/quota/bug-1260545.t b/tests/bugs/quota/bug-1260545.t
index 92cf2125fc2..46808022f01 100644
--- a/tests/bugs/quota/bug-1260545.t
+++ b/tests/bugs/quota/bug-1260545.t
@@ -19,12 +19,11 @@ TEST $CLI volume quota $V0 enable;
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0;
-TEST $CLI volume quota $V0 limit-usage / 10MB
+TEST $CLI volume quota $V0 limit-usage / 11MB
TEST $CLI volume quota $V0 hard-timeout 0
TEST $CLI volume quota $V0 soft-timeout 0
TEST $QDD $M0/f1 256 40
-TEST ! $QDD $M0/f2 256 40
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quotausage "/"
diff --git a/tests/bugs/replicate/bug-1221481-allow-fops-on-dir-split-brain.t b/tests/bugs/replicate/bug-1221481-allow-fops-on-dir-split-brain.t
index 1283d8eeef4..c4752c488f4 100644
--- a/tests/bugs/replicate/bug-1221481-allow-fops-on-dir-split-brain.t
+++ b/tests/bugs/replicate/bug-1221481-allow-fops-on-dir-split-brain.t
@@ -30,5 +30,5 @@ EXPECT "6" echo $(ls | wc -l)
TEST ! cat FILE
TEST `echo hello>hello.txt`
cd -
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
cleanup
diff --git a/tests/bugs/rpc/bug-954057.t b/tests/bugs/rpc/bug-954057.t
index faaf261d88b..65af274f09d 100755
--- a/tests/bugs/rpc/bug-954057.t
+++ b/tests/bugs/rpc/bug-954057.t
@@ -8,7 +8,7 @@
# Note on re-reading $M0/new after enabling root-squash:
# Since we have readen it once, the file is present in various caches.
# In order to actually fail on second attempt we must:
-# 1) drop kernel cache, by ( cd $M0 ; umount $M0 )
+# 1) drop kernel cache
# 2) make sure FUSE does not cache the entry. This is also
# in the kernel, but not flushed by a failed umount.
# Using $GFS enforces this because it sets --entry-timeout=0
@@ -33,7 +33,7 @@ TEST cat $M0/new
TEST $CLI volume set $V0 performance.stat-prefetch off
TEST $CLI volume set $V0 server.root-squash enable
-( cd $M0 ; umount $M0 ) # fails but drops kernel cache
+drop_cache $M0
TEST ! mkdir $M0/other
TEST mkdir $M0/nobody/other
TEST cat $M0/file
diff --git a/tests/bugs/shard/bug-1256580.t b/tests/bugs/shard/bug-1256580.t
index fed13679253..279fcc54e48 100644
--- a/tests/bugs/shard/bug-1256580.t
+++ b/tests/bugs/shard/bug-1256580.t
@@ -31,5 +31,4 @@ TEST dd if=/dev/zero of=$M0/dir/file bs=1024 seek=7168 count=2048 conv=notrunc
# Ensure that the file size is not greater than 9M.
EXPECT '9437184' stat -c %s $M0/dir/file
-
cleanup
diff --git a/tests/bugs/snapshot/bug-1109889.t b/tests/bugs/snapshot/bug-1109889.t
index 6b0eb37f14f..6b29cdd9eb1 100644
--- a/tests/bugs/snapshot/bug-1109889.t
+++ b/tests/bugs/snapshot/bug-1109889.t
@@ -69,6 +69,6 @@ TEST $CLI volume start $V0 force;
# let client get the snapd port from glusterd and connect
EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" snap_client_connected_status $V0
-TEST stat $M0/.snaps;
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" STAT $M0/.snaps
cleanup;
diff --git a/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t b/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t
index b9f6dc715e6..c536c8261e4 100644
--- a/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t
+++ b/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t
@@ -39,3 +39,5 @@ TEST $CLI volume set $V0 encryption.master-key $GLUSTERD_WORKDIR/$V0-master-key
TEST $CLI volume set $V0 features.encryption on
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
diff --git a/tests/bugs/snapshot/bug-1155042-dont-display-deactivated-snapshots.t b/tests/bugs/snapshot/bug-1155042-dont-display-deactivated-snapshots.t
index 6697c263ac1..c5a285eb775 100644
--- a/tests/bugs/snapshot/bug-1155042-dont-display-deactivated-snapshots.t
+++ b/tests/bugs/snapshot/bug-1155042-dont-display-deactivated-snapshots.t
@@ -21,16 +21,16 @@ TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0
# in the USS world
gluster snapshot config activate-on-create enable
for i in {1..10}; do $CLI snapshot create snap$i $V0 no-timestamp; done
-EXPECT 10 uss_count_snap_displayed $M0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 10 uss_count_snap_displayed $M0
# snapshots should not be displayed after deactivation
for i in {1..10}; do $CLI snapshot deactivate snap$i --mode=script; done
-EXPECT 0 uss_count_snap_displayed $M0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 uss_count_snap_displayed $M0
# activate all the snapshots and check if all the activated snapshots
# are displayed again
for i in {1..10}; do $CLI snapshot activate snap$i --mode=script; done
-EXPECT 10 uss_count_snap_displayed $M0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 10 uss_count_snap_displayed $M0
cleanup;
diff --git a/tests/bugs/snapshot/bug-1162498.t b/tests/bugs/snapshot/bug-1162498.t
index afc065000d5..a97e4429ee7 100755
--- a/tests/bugs/snapshot/bug-1162498.t
+++ b/tests/bugs/snapshot/bug-1162498.t
@@ -1,6 +1,7 @@
#!/bin/bash
. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../snapshot.rc
cleanup;
@@ -35,7 +36,7 @@ TEST $CLI volume stop $V0
TEST $CLI snapshot restore snap2
TEST $CLI volume start $V0
-umount -f $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
TEST glusterfs -s $H0 --volfile-id=$V0 $M0
#Dir xyz exists in snap1
diff --git a/tests/bugs/snapshot/bug-1166197.t b/tests/bugs/snapshot/bug-1166197.t
index 65b242250bf..739839fab81 100755
--- a/tests/bugs/snapshot/bug-1166197.t
+++ b/tests/bugs/snapshot/bug-1166197.t
@@ -20,6 +20,7 @@ TEST $CLI snapshot config activate-on-create enable
TEST $CLI volume set $V0 features.uss enable
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status';
+EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;
TEST mount_nfs $H0:/$V0 $N0 nolock
TEST mkdir $N0/testdir
diff --git a/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t b/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t
index dc16fed0052..752c517adc3 100644
--- a/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t
+++ b/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t
@@ -69,3 +69,4 @@ cleanup
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/bugs/tier/bug-1279376-rename-demoted-file.t b/tests/bugs/tier/bug-1279376-rename-demoted-file.t
index 485a14ddde1..c4a50d9d9f7 100755
--- a/tests/bugs/tier/bug-1279376-rename-demoted-file.t
+++ b/tests/bugs/tier/bug-1279376-rename-demoted-file.t
@@ -73,7 +73,7 @@ echo "File path on cold tier: "$CPATH
EXPECT_WITHIN $DEMOTE_TIMEOUT "yes" exists_and_regular_file $CPATH
-# We don't want $DST_FILE to get demoted
+#We don't want $DST_FILE to get demoted
TEST $CLI volume set $V0 cluster.tier-demote-frequency $PROMOTE_FREQ
#This will be created on the hot tier
@@ -90,3 +90,4 @@ EXPECT 1 echo $(ls -l $M0 | grep $DST_FILE | wc -l)
cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000
diff --git a/tests/bugs/tier/bug-1286974.t b/tests/bugs/tier/bug-1286974.t
index a2d8131a0da..1df837c9d83 100644
--- a/tests/bugs/tier/bug-1286974.t
+++ b/tests/bugs/tier/bug-1286974.t
@@ -69,4 +69,5 @@ TEST $CLI volume tier $V0 detach stop
EXPECT "0" tier_task_name "Tier migration";
cleanup;
-
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/changelog.rc b/tests/changelog.rc
index e3b040226ec..ffad2e80632 100644
--- a/tests/changelog.rc
+++ b/tests/changelog.rc
@@ -2,3 +2,8 @@
function count_htime_files {
ls -l $B0/$V0"1"/.glusterfs/changelogs/htime/ | grep HTIME | wc -l
}
+
+function count_changelog_files {
+ # Where $1 is the brick name passed
+ ls -l $1/.glusterfs/changelogs/ | grep CHANGELOG | wc -l
+}
diff --git a/tests/features/ssl-authz.t b/tests/features/ssl-authz.t
index 17ae356717c..3cb45b5e582 100755
--- a/tests/features/ssl-authz.t
+++ b/tests/features/ssl-authz.t
@@ -48,7 +48,7 @@ ln $SSL_CERT $SSL_CA
TEST $CLI volume create $V0 $H0:$B0/1
TEST $CLI volume set $V0 server.ssl on
TEST $CLI volume set $V0 client.ssl on
-#EST $CLI volume set $V0 ssl.cipher-list $(valid_ciphers)
+TEST $CLI volume set $V0 ssl.cipher-list $(valid_ciphers)
TEST $CLI volume start $V0
EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count
diff --git a/tests/features/unhashed-auto.t b/tests/features/unhashed-auto.t
index cba5b772106..ddebd03299d 100755
--- a/tests/features/unhashed-auto.t
+++ b/tests/features/unhashed-auto.t
@@ -63,7 +63,7 @@ EXPECT 'Started' volinfo_field $V0 'Status'
TEST $GFS -s $H0 --volfile-id $V0 $M0
TEST mkdir $M0/dir
TEST touch_files
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
# Add a brick and do the fix-layout part of rebalance to update directory layouts
# (including their directory commit hashes).
@@ -82,7 +82,7 @@ TEST setfattr -x trusted.glusterfs.dht.commithash $B0/${V0}3
# correctly skipped the broadcast lookup that would have found them.
TEST $GFS -s $H0 --volfile-id $V0 $M0
TEST [ $(count_files) -ne 100 ]
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
# Do the fix-layout again to generate a new volume commit hash.
TEST $CLI volume rebalance $V0 fix-layout start
@@ -92,7 +92,7 @@ TEST wait_for_rebalance
# the mismatch and did the broadcast lookup this time.
TEST $GFS -s $H0 --volfile-id $V0 $M0
TEST [ $(count_files) -eq 100 ]
-TEST umount $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
# Do a *full* rebalance and verify that the directory commit hash changed.
old_val=$(get_xattr $B0/${V0}1/dir)
diff --git a/tests/geo-rep/georep-basic-dr-rsync.t b/tests/geo-rep/georep-basic-dr-rsync.t
index 220b4713c69..e8b39938082 100644
--- a/tests/geo-rep/georep-basic-dr-rsync.t
+++ b/tests/geo-rep/georep-basic-dr-rsync.t
@@ -126,3 +126,5 @@ TEST $GEOREP_CLI $master $slave stop
TEST $GEOREP_CLI $master $slave delete
cleanup;
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/geo-rep/georep-basic-dr-tarssh.t b/tests/geo-rep/georep-basic-dr-tarssh.t
index cf661d08782..5f879db99cf 100644
--- a/tests/geo-rep/georep-basic-dr-tarssh.t
+++ b/tests/geo-rep/georep-basic-dr-tarssh.t
@@ -128,3 +128,5 @@ TEST $GEOREP_CLI $master $slave stop
TEST $GEOREP_CLI $master $slave delete
cleanup;
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000
diff --git a/tests/include.rc b/tests/include.rc
index 9be67de8a07..13a5188a34e 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -39,6 +39,7 @@ H0=${H0:=`hostname`}; # hostname
MOUNT_TYPE_FUSE="fuse.glusterfs"
GREP_MOUNT_OPT_RO="grep (ro"
GREP_MOUNT_OPT_RW="grep (rw"
+UMOUNT_F="umount -f"
PATH=$PATH:${PWD}/tests/utils
@@ -50,6 +51,7 @@ NetBSD)
MOUNT_TYPE_FUSE="puffs|perfuse|fuse.glusterfs"
GREP_MOUNT_OPT_RO="grep (read-only"
GREP_MOUNT_OPT_RW="grep -v (read-only"
+ UMOUNT_F="umount -f -R"
;;
*)
;;
@@ -125,6 +127,23 @@ function dbg()
[ "x$DEBUG" = "x0" ] || echo "$*" >&2;
}
+function G_LOG()
+{
+ local g_log_logdir;
+ g_log_logdir=`$CLI --print-logdir`
+ test -d $g_log_logdir
+ if [ $? != 0 ]; then
+ return
+ fi
+ local g_log_string;
+ g_log_string="++++++++++ G_LOG:$0: TEST: $@ ++++++++++"
+ g_log_string="`date -u +["%F %T.%6N"]`:$g_log_string"
+ local g_log_filename
+ for g_log_filename in `find $g_log_logdir/ -type f -name \*.log`;
+ do
+ echo "$g_log_string" >> "$g_log_filename"
+ done
+}
function test_header()
{
@@ -137,12 +156,13 @@ function test_header()
function test_footer()
{
RET=$?
- local err=$1
+ local lineno=$1
+ local err=$2
if [ $RET -eq 0 ]; then
- echo "ok $t";
+ echo "ok $t, LINENUM:$lineno";
else
- echo "not ok $t $err";
+ echo "not ok $t $err, LINENUM:$lineno";
# With DEBUG, this was already printed out, so skip it.
if [ x"$DEBUG" = x"0" ]; then
echo "FAILED COMMAND: $saved_cmd"
@@ -159,8 +179,9 @@ function test_footer()
function test_expect_footer()
{
- local e=$1
- local a=$2
+ local lineno=$1
+ local e=$2
+ local a=$3
local err=""
if ! [[ "$a" =~ $e ]]; then
@@ -168,7 +189,7 @@ function test_expect_footer()
fi
[[ "$a" =~ $e ]];
- test_footer "$err";
+ test_footer "$lineno" "$err";
}
function _EXPECT()
@@ -177,6 +198,7 @@ function _EXPECT()
shift;
local a=""
+ G_LOG $TESTLINE "$@";
test_header "$@";
e="$1";
@@ -184,16 +206,17 @@ function _EXPECT()
a=$("$@" | tail -1)
if [ "x$e" = "x" ] ; then
- test_expect_footer "x$e" "x$a";
+ test_expect_footer "$TESTLINE" "x$e" "x$a";
else
- test_expect_footer "$e" "$a";
+ test_expect_footer "$TESTLINE" "$e" "$a";
fi
}
function test_expect_not_footer()
{
- local e=$1
- local a=$2
+ local lineno=$1
+ local e=$2
+ local a=$3
local err=""
if [[ "$a" =~ $e ]]; then
@@ -201,7 +224,7 @@ function test_expect_not_footer()
fi
! [[ "$a" =~ "$e" ]];
- test_footer "$err";
+ test_footer "$lineno" "$err";
}
function _EXPECT_NOT()
@@ -210,6 +233,7 @@ function _EXPECT_NOT()
shift;
local a=""
+ G_LOG $TESTLINE "$@";
test_header "$@";
e="$1";
@@ -217,9 +241,9 @@ function _EXPECT_NOT()
a=$("$@" | tail -1)
if [ "x$e" = "x" ] ; then
- test_expect_not_footer "x$e" "x$a";
+ test_expect_not_footer "$TESTLINE" "x$e" "x$a";
else
- test_expect_not_footer "$e" "$a";
+ test_expect_not_footer "$TESTLINE" "$e" "$a";
fi
}
@@ -227,23 +251,23 @@ function _EXPECT_KEYWORD()
{
TESTLINE=$1;
shift;
-
+ G_LOG $TESTLINE "$@";
test_header "$@";
e="$1";
shift;
"$@" | tail -1 | grep -q "$e"
- test_footer;
+ test_footer "$TESTLINE";
}
-
function _TEST()
{
TESTLINE=$1;
shift;
local redirect=""
+ G_LOG $TESTLINE "$@";
test_header "$@";
if [ "$1" = "!" ]; then
@@ -252,7 +276,7 @@ function _TEST()
eval "$@" >/dev/null $redirect
- test_footer;
+ test_footer "$TESTLINE";
}
function _EXPECT_WITHIN()
@@ -263,6 +287,7 @@ function _EXPECT_WITHIN()
local timeout=$1
shift;
+ G_LOG $TESTLINE "$@";
test_header "$@"
e=$1;
@@ -286,9 +311,9 @@ function _EXPECT_WITHIN()
done
if [ "x$e" = "x" ] ; then
- test_expect_footer "x$e" "x$a";
+ test_expect_footer "$TESTLINE" "x$e" "x$a";
else
- test_expect_footer "$e" "$a";
+ test_expect_footer "$TESTLINE" "$e" "$a";
fi
}
@@ -308,6 +333,12 @@ function _TEST_IN_LOOP()
_TEST $@
}
+function _EXPECT_WITHIN_TEST_IN_LOOP()
+{
+ testcnt=`expr $testcnt + 1`;
+ _EXPECT_WITHIN $@
+}
+
which killall > /dev/null || {
killall() {
pkill $@
@@ -387,20 +418,42 @@ stat -c %s /dev/null > /dev/null 2>&1 || {
function cleanup()
{
- # unmount filesystems before killing daemons to avoid deadllocks
- MOUNTPOINTS=`mount | grep "$B0/" | awk '{print $3}'`
- for m in $MOUNTPOINTS;
- do
- umount $m
- done
- killall -15 glusterfs glusterfsd glusterd 2>/dev/null || true;
+ # Prepare flags for umount
+ case `uname -s` in
+ Linux)
+ flag="-l"
+ ;;
+ NetBSD)
+ flag="-f -R"
+ ;;
+ FreeBSD|Darwin)
+ flag="-f"
+ ;;
+ *)
+ flag=""
+ ;;
+ esac
+
+ # Clean up all client mounts
for m in `mount | grep fuse.glusterfs | awk '{print $3}'`; do
- umount $m
+ umount $flag $m
done
- test x"$OSTYPE" = x"NetBSD" && pkill -15 perfused rpc.statd || true
- # allow completion of signal handlers for SIGTERM before issue SIGKILL
- sleep 1
+
+ # Unmount all well known mount points
+ umount $flag $M0 2>/dev/null || umount -f $M0 2>/dev/null || true;
+ umount $flag $M1 2>/dev/null || umount -f $M1 2>/dev/null || true;
+ umount $flag $M2 2>/dev/null || umount -f $M2 2>/dev/null || true;
+ umount $flag $N0 2>/dev/null || umount -f $N0 2>/dev/null || true;
+ umount $flag $N1 2>/dev/null || umount -f $N1 2>/dev/null || true;
+
+
+ # unmount all stale mounts from /tmp, This is a temporary work around
+ # till the stale mount in /tmp is found.
+ umount $flag /tmp/mnt* 2>/dev/null
+
+
+ # Send SIGKILL to all gluster processes that are still running
killall -9 glusterfs glusterfsd glusterd 2>/dev/null || true;
test x"$OSTYPE" = x"NetBSD" && pkill -9 perfused rpc.statd || true
@@ -416,8 +469,18 @@ function cleanup()
## nfs_acl
rpcinfo -d 100227 3 2>/dev/null || true;
+ # unmount brick filesystems after killing daemons
+ MOUNTPOINTS=`mount | grep "$B0/" | awk '{print $3}'`
+ for m in $MOUNTPOINTS;
+ do
+ umount $flag $m
+ done
+
+ # Cleanup lvm
type cleanup_lvm &>/dev/null && cleanup_lvm || true;
+ # Destroy loop devices
+ # TODO: This should be a function DESTROY_LOOP
case `uname -s` in
Linux)
LOOPDEVICES=`losetup -a | grep "$B0/" | \
@@ -457,31 +520,16 @@ function cleanup()
# remove contents of "GLUSTERD_WORKDIR" except hooks and groups
# directories.
- find $GLUSTERD_WORKDIR/* -maxdepth 0 -name 'hooks' -prune \
- -o -name 'groups' -prune -o -exec rm -rf '{}' ';'
-
- rm -rf $B0/* /etc/glusterd/*;
-
- # unmount all stale mounts from /tmp, This is a temporary work around
- # till the stale mount in /tmp is found.
- case `uname -s` in
- Linux)
- flag="-l"
- ;;
- NetBSD|FreeBSD|Darwin)
- flag="-f"
- ;;
- *)
- flag=""
- ;;
- esac
- umount $flag /tmp/mnt* 2>/dev/null
- umount $flag $M0 2>/dev/null || umount -f $M0 2>/dev/null || true;
- umount $flag $M1 2>/dev/null || umount -f $M1 2>/dev/null || true;
- umount $flag $M2 2>/dev/null || umount -f $M2 2>/dev/null || true;
- umount $flag $N0 2>/dev/null || umount -f $N0 2>/dev/null || true;
- umount $flag $N1 2>/dev/null || umount -f $N1 2>/dev/null || true;
+ if [ -n $GLUSTERD_WORKDIR ]
+ then
+ find $GLUSTERD_WORKDIR/* -maxdepth 0 -name 'hooks' -prune \
+ -o -name 'groups' -prune -o -exec rm -rf '{}' ';'
+ else
+ echo "GLUSTERD_WORKDIR is not set"
+ fi
+ # Complete cleanup time
+ rm -rf "$B0/*" "/etc/glusterd/*";
rm -rf $WORKDIRS
leftover=""
for d in $WORKDIRS ; do
@@ -501,6 +549,20 @@ function cleanup()
echo
return 1;
fi >&2
+
+ # tar logs at the start and end of every test
+ if [ -n "$LOGDIR" -a -z "$STOP_WASTING_SPACE" ]
+ then
+ tarname=$(basename $0 .t)
+ tar -rf ${LOGDIR}/${tarname}.tar ${LOGDIR}/* \
+ --exclude="*.tar" \
+ && \
+ find $LOGDIR/* -maxdepth 0 -name '*.tar' -prune \
+ -o -exec rm -rf '{}' ';'
+ else
+ echo "LOGDIR is not set"
+ fi
+
mkdir -p $WORKDIRS
# This is usually the last thing a test script calls, so our return
# value becomes their exit value. While it's not great for the mkdir
@@ -510,6 +572,16 @@ function cleanup()
return 0
}
+function force_terminate () {
+ local ret=$?;
+ >&2 echo -e "\nreceived external"\
+ "signal --`kill -l $ret`--, calling 'cleanup' ...\n";
+ cleanup;
+ exit $ret;
+}
+
+trap force_terminate INT TERM HUP
+
function volinfo_field()
{
local vol=$1;
@@ -734,6 +806,7 @@ alias TEST='_TEST $LINENO'
alias EXPECT_WITHIN='_EXPECT_WITHIN $LINENO'
alias EXPECT_KEYWORD='_EXPECT_KEYWORD $LINENO'
alias TEST_IN_LOOP='_TEST_IN_LOOP $LINENO'
+alias EXPECT_WITHIN_TEST_IN_LOOP='_EXPECT_WITHIN_TEST_IN_LOOP $LINENO'
shopt -s expand_aliases
if [ x"$OSTYPE" = x"Linux" ]; then
@@ -832,12 +905,15 @@ log_newer()
msg=$2
logdir=`$CLI --print-logdir`
+ local x_ifs=$IFS
IFS="["
- for date in `grep -hr "$msg" $logdir | awk -F '[\]]' '{print $1}'` ; do
+ for date in `grep -hr "$msg" $logdir | grep -v "G_LOG" | awk -F '[\]]' '{print $1}'` ; do
if [ `date -d "$date" +%s` -gt $ts ] ; then
+ IFS=$x_ifs
return 0;
fi
done 2>/dev/null
+ IFS=$x_ifs
return 1
}
diff --git a/tests/nfs.rc b/tests/nfs.rc
index 2e0241709d3..2140f311c33 100644
--- a/tests/nfs.rc
+++ b/tests/nfs.rc
@@ -65,6 +65,6 @@ function mount_nfs ()
}
function umount_nfs {
- umount -f $1
+ ${UMOUNT_F} $1
if [ $? -eq 0 ]; then echo "Y"; else echo "N"; fi
}
diff --git a/tests/snapshot.rc b/tests/snapshot.rc
index 9304fdaee64..cca1f4d4988 100644
--- a/tests/snapshot.rc
+++ b/tests/snapshot.rc
@@ -3,7 +3,7 @@
LVM_DEFINED=0
LVM_PREFIX="patchy_snap"
LVM_COUNT=0
-VHD_SIZE="1G"
+VHD_SIZE="300M"
#This function will init B# bricks
#This is used when launch_cluster is
@@ -127,7 +127,7 @@ function _cleanup_lvm() {
function _cleanup_lvm_again() {
local file
- mount | grep $LVM_PREFIX | awk '{print $3}' | xargs -r umount -f
+ mount | grep $LVM_PREFIX | awk '{print $3}' | xargs -r ${UMOUNT_F}
/sbin/vgs | grep $LVM_PREFIX | awk '{print $1}' | xargs -r vgremove -f
@@ -158,8 +158,8 @@ function _create_lv() {
local dir=$1
local num=$2
local vg="VG$num"
- local thinpoolsize="0.8G"
- local virtualsize="0.6G"
+ local thinpoolsize="200M"
+ local virtualsize="150M"
/sbin/pvcreate $dir/${LVM_PREFIX}_loop
/sbin/vgcreate ${!vg} $dir/${LVM_PREFIX}_loop
@@ -182,7 +182,7 @@ function _umount_lv() {
local num=$1
local l="L$num"
- umount -f ${!l} 2>/dev/null || true
+ ${UMOUNT_F} ${!l} 2>/dev/null || true
rmdir ${!l} 2>/dev/null || true
}
diff --git a/tests/volume.rc b/tests/volume.rc
index 19848bca883..e488aa73b1c 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -30,8 +30,7 @@ function brick_up_status {
local vol=$1
local host=$2
local brick=$3
- brick_pid=$(get_brick_pid $vol $host $brick)
- gluster volume status | grep $brick_pid | awk '{print $4}'
+ $CLI volume status $vol $host:$brick --xml | sed -ne 's/.*<status>\([01]\)<\/status>/\1/p'
}
function volume_option()
@@ -50,6 +49,10 @@ function rebalance_status_field {
$CLI volume rebalance $1 status | awk '{print $7,$8,$9}' |sed -n 3p |tr -d '[^0-9+\.]'|sed 's/ *$//g'
}
+function detach_tier_status_field {
+ $CLI volume tier $1 detach status | awk '{print $7,$8,$9}' |sed -n 3p |tr -d '[^0-9+\.]'|sed 's/ *$//g'
+}
+
function remove_brick_status_completed_field {
local vol=$1
local brick_list=$2
@@ -464,7 +467,7 @@ function path_exists {
}
function force_umount {
- umount -f $*
+ ${UMOUNT_F} $*
if [ $? -eq 0 ]; then echo "Y"; else echo "N"; fi
}