From 81d32caa26ef0e3db10cae53e6820927fe0569fc Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 21 Aug 2013 12:53:11 +0530 Subject: glusterd/gverify: Check for passwordless ssh in gverify. Change-Id: I8c2d398114ad4534bcc052f9a5be8bbb2e7e2582 BUG: 999531 Signed-off-by: Avra Sengupta Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/5677 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- geo-replication/src/gverify.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh index 49ed2e925..a2561fbe5 100755 --- a/geo-replication/src/gverify.sh +++ b/geo-replication/src/gverify.sh @@ -99,9 +99,18 @@ function main() log_file=$4 > $log_file + # Use FORCE_BLOCKER flag in the error message to differentiate + # between the errors which the force command should bypass + ping -w 5 $2; if [ $? -ne 0 ]; then - echo "$2 not reachable." > $log_file + echo "FORCE_BLOCKER|$2 not reachable." > $log_file + exit 1; + fi; + + ssh -oNumberOfPasswordPrompts=0 $2 "echo Testing_Passwordless_SSH"; + if [ $? -ne 0 ]; then + echo "FORCE_BLOCKER|Passwordless ssh login has not been setup with $2." > $log_file exit 1; fi; @@ -113,21 +122,20 @@ function main() master_version=$(echo $master_data | cut -f2 -d':'); slave_version=$(echo $slave_data | cut -f2 -d':'); slave_no_of_files=$(echo $slave_data | cut -f3 -d':'); - slave_vol_test=$5 if [[ "x$master_size" = "x" || "x$master_version" = "x" || "$master_size" -eq "0" ]]; then - echo "Unable to fetch master volume details. Please check the master cluster and master volume." > $log_file; + echo "FORCE_BLOCKER|Unable to fetch master volume details. Please check the master cluster and master volume." > $log_file; exit 1; fi; if [[ "x$slave_size" = "x" || "x$slave_version" = "x" || "$slave_size" -eq "0" ]]; then - echo "Unable to fetch slave volume details. Please check the slave cluster and slave volume." > $log_file; + echo "FORCE_BLOCKER|Unable to fetch slave volume details. Please check the slave cluster and slave volume." > $log_file; exit 1; fi; - if [ ! -z $slave_vol_test ]; then - exit $ERRORS; - fi + # The above checks are mandatory and force command should be blocked + # if they fail. The checks below can be bypassed if force option is + # provided hence no FORCE_BLOCKER flag. if [ ! $slave_size -ge $(($master_size - $BUFFER_SIZE )) ]; then echo "Total size of master is greater than available size of slave." >> $log_file; -- cgit