summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-01-18 05:43:56 +0000
committerAmar Tumballi <amarts@redhat.com>2018-01-19 03:53:24 +0000
commit890078423b4b720dd124f07c975e834695bcc915 (patch)
treee77d6a0d771dca7dc120b17f5c5d0d0ef7062e84
parentdc70cf124c1625a0ada4b25cb0e055f5b6895036 (diff)
downloadglusterfs-890078423b4b720dd124f07c975e834695bcc915.tar.gz
glusterfs-890078423b4b720dd124f07c975e834695bcc915.tar.xz
glusterfs-890078423b4b720dd124f07c975e834695bcc915.zip
geo-rep: Validate availability of gluster binary on slave
1. Adds validation to check if gluster binary is available on slave 2. Add a simple geo-rep setup test case to verify whether setup is fine. It's named in such a way that it runs first. BUG: 1532591 Change-Id: Ie777e55ae13db8fa97d4e32464ad82269ee5fd07 Signed-off-by: Kotresh HR <khiremat@redhat.com>
-rwxr-xr-xgeo-replication/src/gverify.sh13
-rw-r--r--tests/00-geo-rep/00-georep-verify-setup.t65
2 files changed, 77 insertions, 1 deletions
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh
index 8eae8469ff..7440f44c02 100755
--- a/geo-replication/src/gverify.sh
+++ b/geo-replication/src/gverify.sh
@@ -191,6 +191,17 @@ function main()
exit 1;
fi;
+ if [[ -z "${GR_SSH_IDENTITY_KEY}" ]]; then
+ err=$((ssh -p ${SSH_PORT} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "gluster --version") 2>&1)
+ else
+ err=$((ssh -p ${SSH_PORT} -i ${GR_SSH_IDENTITY_KEY} -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $2@$3 "gluster --version") 2>&1)
+ fi
+
+ if [ $? -ne 0 ]; then
+ echo "FORCE_BLOCKER|gluster command on $2@$3 failed. Error: $err" > $log_file
+ exit 1;
+ fi;
+
ERRORS=0;
master_data=$(master_stats $1);
slave_data=$(slave_stats $2 $3 $4);
@@ -236,7 +247,7 @@ function main()
fi;
if [[ $master_version != $slave_version ]]; then
- echo "Gluster version mismatch between master and slave." >> $log_file;
+ echo "Gluster version mismatch between master and slave. Master version: $master_version Slave version: $slave_version" >> $log_file;
ERRORS=$(($ERRORS + 1));
fi;
diff --git a/tests/00-geo-rep/00-georep-verify-setup.t b/tests/00-geo-rep/00-georep-verify-setup.t
new file mode 100644
index 0000000000..f031be1898
--- /dev/null
+++ b/tests/00-geo-rep/00-georep-verify-setup.t
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+. $(dirname $0)/../geo-rep.rc
+. $(dirname $0)/../env.rc
+
+### Basic Tests with Distribute Replicate volumes
+
+##Cleanup and start glusterd
+cleanup;
+TEST glusterd;
+TEST pidof glusterd
+
+
+##Variables
+GEOREP_CLI="$CLI volume geo-replication"
+master=$GMV0
+SH0="127.0.0.1"
+slave=${SH0}::${GSV0}
+num_active=2
+num_passive=2
+master_mnt=$M0
+slave_mnt=$M1
+
+############################################################
+#SETUP VOLUMES AND GEO-REPLICATION
+############################################################
+
+##create_and_start_master_volume
+TEST $CLI volume create $GMV0 replica 2 $H0:$B0/${GMV0}{1,2,3,4};
+TEST $CLI volume start $GMV0
+
+##create_and_start_slave_volume
+TEST $CLI volume create $GSV0 replica 2 $H0:$B0/${GSV0}{1,2,3,4};
+TEST $CLI volume start $GSV0
+
+##Create, start and mount meta_volume
+TEST $CLI volume create $META_VOL replica 3 $H0:$B0/${META_VOL}{1,2,3};
+TEST $CLI volume start $META_VOL
+TEST mkdir -p $META_MNT
+TEST glusterfs -s $H0 --volfile-id $META_VOL $META_MNT
+
+##Mount master
+TEST glusterfs -s $H0 --volfile-id $GMV0 $M0
+
+##Mount slave
+TEST glusterfs -s $H0 --volfile-id $GSV0 $M1
+
+############################################################
+#BASIC GEO-REPLICATION TESTS
+############################################################
+
+#Create geo-rep session
+TEST create_georep_session $master $slave
+
+#Delete Geo-rep
+TEST $GEOREP_CLI $master $slave delete
+
+#Cleanup authorized keys
+sed -i '/^command=.*SSH_ORIGINAL_COMMAND#.*/d' ~/.ssh/authorized_keys
+sed -i '/^command=.*gsyncd.*/d' ~/.ssh/authorized_keys
+
+cleanup;
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000