summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/geo-rep.rc59
-rw-r--r--tests/geo-rep/georep-basic-dr-rsync.t50
-rw-r--r--tests/geo-rep/georep-basic-dr-tarssh.t45
3 files changed, 95 insertions, 59 deletions
diff --git a/tests/geo-rep.rc b/tests/geo-rep.rc
index 4ef0796184b..208069c6918 100644
--- a/tests/geo-rep.rc
+++ b/tests/geo-rep.rc
@@ -40,10 +40,12 @@ function create_data()
ln ${master_mnt}/${prefix}_f1 ${master_mnt}/${prefix}_hl1
# Symlink
- ln -s ${master_mnt}/${prefix}_f1 ${master_mnt}/${prefix}_sl1
+ cd ${master_mnt}
+ ln -s ${prefix}_f1 ${prefix}_sl1
+ cd -
# data
- echo "Hello World!" >> ${master_mnt}/${prefix}_f1
+ echo "HelloWorld!" >> ${master_mnt}/${prefix}_f1
# UNLINK
rm ${master_mnt}/${prefix}_f2
@@ -100,8 +102,10 @@ function hardlink_file_ok()
function data_ok()
{
path=$1
- data1=$2
+ data1="$2"
data2=$(cat $path)
+ echo "data1:$data1"
+ echo "data2:$data2"
if test "X$data1" != "X$data2"
then
return 1
@@ -110,13 +114,14 @@ function data_ok()
function symlink_ok()
{
- local orig_file_name=$(basename $1)
+ local orig_file_name=$1
local symlink_file=$2
+
local file_type=$(stat --format "%F" "$symlink_file")
if test "X$file_type" != "Xsymbolic link"; then return 1; fi
- local fname=$(stat $symlink_file --format "%N")
+ local fname=$(readlink $symlink_file)
if test "X$fname" != "X$orig_file_name"; then return 1; fi
}
@@ -136,48 +141,12 @@ function rename_ok()
fi
}
-function data_tests()
-{
- local prefix=$1
-
- sleep 10
- #Regular file checking
- regular_file_ok ${slave_mnt}/${prefix}_f1
- if test $? != 0; then return $?; fi
-
- #Directory checking
- directory_ok ${slave_mnt}/${prefix}_d1
- if test $? != 0; then return $?; fi
-
- #Rename file/dir checking
- rename_ok ${slave_mnt}/${prefix}_f3 ${slave_mnt}/${prefix}_f4
- if test $? != 0; then return $?; fi
- rename_ok ${slave_mnt}/${prefix}_d3 ${slave_mnt}/${prefix}_d4
- if test $? != 0; then return $?; fi
-
- #Symlink
- symlink_ok ${slave_mnt}/${prefix}_f1 ${slave_mnt}/${prefix}_sl1
- if test $? != 0; then return $?; fi
-
- #Hardlink
- hardlink_file_ok ${slave_mnt}/${prefix}_f1 ${slave_mnt}/${prefix}_hl1
- if test $? != 0; then return $?; fi
-
- #Unlink/rmdir checking
- unlink_ok ${slave_mnt}/${prefix}_f2
- if test $? != 0; then return $?; fi
- unlink_ok ${slave_mnt}/${prefix}_d2
- if test $? != 0; then return $?; fi
-
- #Data
- data_ok ${master_mnt}/${prefix}_f1 "Hello World!"
- if test $? != 0; then return $?; fi
-}
-
function create_georep_session()
{
$CLI system:: execute gsec_create
- if test $? != 0; then return $?; fi
+ rc=$?
+ if test $rc != 0; then return $rc; fi
$CLI volume geo-rep $master $slave create push-pem
- if test $? != 0; then return $?; fi
+ rc=$?
+ if test $rc != 0; then return $rc; fi
}
diff --git a/tests/geo-rep/georep-basic-dr-rsync.t b/tests/geo-rep/georep-basic-dr-rsync.t
index 7562a206f2a..4c1885b78b2 100644
--- a/tests/geo-rep/georep-basic-dr-rsync.t
+++ b/tests/geo-rep/georep-basic-dr-rsync.t
@@ -63,27 +63,63 @@ TEST $GEOREP_CLI $master $slave start
sleep 10
EXPECT 2 check_status_num_rows "Active"
EXPECT 2 check_status_num_rows "Passive"
-TEST data_tests "hybrid" #20
+
+#DATA_TESTS HYBRID
+sleep 10
+TEST regular_file_ok ${slave_mnt}/hybrid_f1 #20
+TEST directory_ok ${slave_mnt}/$hybrid_d1
+TEST rename_ok ${slave_mnt}/hybrid_f3 ${slave_mnt}/hybrid_f4
+TEST rename_ok ${slave_mnt}/hybrid_d3 ${slave_mnt}/hybrid_d4
+TEST symlink_ok hybrid_f1 ${slave_mnt}/hybrid_sl1
+TEST hardlink_file_ok ${slave_mnt}/hybrid_f1 ${slave_mnt}/hybrid_hl1 #25
+TEST unlink_ok ${slave_mnt}/hybrid_f2
+TEST unlink_ok ${slave_mnt}/hybrid_d2
+TEST data_ok ${slave_mnt}/hybrid_f1 "HelloWorld!"
+
#Check History Crawl.
TEST $GEOREP_CLI $master $slave stop
-TEST create_data "history"
+TEST create_data "history" #30
TEST $GEOREP_CLI $master $slave start
sleep 10
EXPECT 2 check_status_num_rows "Active"
-EXPECT 2 check_status_num_rows "Passive" #25
-TEST data_tests "history"
+EXPECT 2 check_status_num_rows "Passive"
+
+
+
+#data_tests "history"
+sleep 10
+TEST regular_file_ok ${slave_mnt}/history_f1
+TEST directory_ok ${slave_mnt}/history_d1 #35
+TEST rename_ok ${slave_mnt}/history_f3 ${slave_mnt}/history_f4
+TEST rename_ok ${slave_mnt}/history_d3 ${slave_mnt}/history_d4
+TEST symlink_ok history_f1 ${slave_mnt}/history_sl1
+TEST hardlink_file_ok ${slave_mnt}/history_f1 ${slave_mnt}/history_hl1
+TEST unlink_ok ${slave_mnt}/history_f2 #40
+TEST unlink_ok ${slave_mnt}/history_d2
+TEST data_ok ${slave_mnt}/history_f1 "HelloWorld!"
#Check History Crawl.
TEST create_data "changelog"
sleep 15
TEST check_status "Changelog Crawl"
-TEST data_tests "changelog"
+
+#data_tests "changelog"
+sleep 10
+TEST regular_file_ok ${slave_mnt}/changelog_f1 #45
+TEST directory_ok ${slave_mnt}/changelog_d1
+TEST rename_ok ${slave_mnt}/changelog_f3 ${slave_mnt}/changelog_f4
+TEST rename_ok ${slave_mnt}/changelog_d3 ${slave_mnt}/changelog_d4
+TEST symlink_ok changelog_f1 ${slave_mnt}/changelog_sl1
+TEST hardlink_file_ok ${slave_mnt}/changelog_f1 ${slave_mnt}/changelog_hl1 #50
+TEST unlink_ok ${slave_mnt}/changelog_f2
+TEST unlink_ok ${slave_mnt}/changelog_d2
+TEST data_ok ${slave_mnt}/changelog_f1 "HelloWorld!"
#Stop Geo-rep
-TEST $GEOREP_CLI $master $slave stop #30
+TEST $GEOREP_CLI $master $slave stop
#Delete Geo-rep
-TEST $GEOREP_CLI $master $slave delete
+TEST $GEOREP_CLI $master $slave delete #55
cleanup;
diff --git a/tests/geo-rep/georep-basic-dr-tarssh.t b/tests/geo-rep/georep-basic-dr-tarssh.t
index cb4b7c55532..ccf688c2701 100644
--- a/tests/geo-rep/georep-basic-dr-tarssh.t
+++ b/tests/geo-rep/georep-basic-dr-tarssh.t
@@ -68,25 +68,56 @@ TEST $GEOREP_CLI $master $slave start
sleep 10
EXPECT 2 check_status_num_rows "Active"
EXPECT 2 check_status_num_rows "Passive" #20
-TEST data_tests "hybrid"
+
+#DATA_TESTS HYBRID
+sleep 10
+TEST regular_file_ok ${slave_mnt}/hybrid_f1
+TEST directory_ok ${slave_mnt}/$hybrid_d1
+TEST rename_ok ${slave_mnt}/hybrid_f3 ${slave_mnt}/hybrid_f4
+TEST rename_ok ${slave_mnt}/hybrid_d3 ${slave_mnt}/hybrid_d4
+TEST symlink_ok hybrid_f1 ${slave_mnt}/hybrid_sl1 #25
+TEST hardlink_file_ok ${slave_mnt}/hybrid_f1 ${slave_mnt}/hybrid_hl1
+TEST unlink_ok ${slave_mnt}/hybrid_f2
+TEST unlink_ok ${slave_mnt}/hybrid_d2
+TEST data_ok ${slave_mnt}/hybrid_f1 "HelloWorld!"
#Check History Crawl.
-TEST $GEOREP_CLI $master $slave stop
+TEST $GEOREP_CLI $master $slave stop #30
TEST create_data "history"
TEST $GEOREP_CLI $master $slave start
sleep 10
-EXPECT 2 check_status_num_rows "Active" #25
+EXPECT 2 check_status_num_rows "Active"
EXPECT 2 check_status_num_rows "Passive"
-TEST data_tests "history"
+#data_tests "history"
+sleep 10
+TEST regular_file_ok ${slave_mnt}/history_f1 #35
+TEST directory_ok ${slave_mnt}/history_d1
+TEST rename_ok ${slave_mnt}/history_f3 ${slave_mnt}/history_f4
+TEST rename_ok ${slave_mnt}/history_d3 ${slave_mnt}/history_d4
+TEST symlink_ok history_f1 ${slave_mnt}/history_sl1
+TEST hardlink_file_ok ${slave_mnt}/history_f1 ${slave_mnt}/history_hl1 #40
+TEST unlink_ok ${slave_mnt}/history_f2
+TEST unlink_ok ${slave_mnt}/history_d2
+TEST data_ok ${slave_mnt}/history_f1 "HelloWorld!"
#Check History Crawl.
TEST create_data "changelog"
sleep 15
-TEST check_status "Changelog Crawl"
-TEST data_tests "changelog" #30
+TEST check_status "Changelog Crawl" #45
+#data_tests "changelog"
+sleep 10
+TEST regular_file_ok ${slave_mnt}/changelog_f1
+TEST directory_ok ${slave_mnt}/changelog_d1
+TEST rename_ok ${slave_mnt}/changelog_f3 ${slave_mnt}/changelog_f4
+TEST rename_ok ${slave_mnt}/changelog_d3 ${slave_mnt}/changelog_d4
+TEST symlink_ok changelog_f1 ${slave_mnt}/changelog_sl1 #50
+TEST hardlink_file_ok ${slave_mnt}/changelog_f1 ${slave_mnt}/changelog_hl1
+TEST unlink_ok ${slave_mnt}/changelog_f2
+TEST unlink_ok ${slave_mnt}/changelog_d2
+TEST data_ok ${slave_mnt}/changelog_f1 "HelloWorld!"
#Stop Geo-rep
-TEST $GEOREP_CLI $master $slave stop
+TEST $GEOREP_CLI $master $slave stop #55
#Delete Geo-rep
TEST $GEOREP_CLI $master $slave delete