diff options
author | Saravanakumar Arumugam <sarumuga@redhat.com> | 2016-02-09 16:44:03 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-02-29 23:57:20 -0800 |
commit | a35bfdaa6279a981a84e8831d65702496f1e478e (patch) | |
tree | 28e0ec3a629807757cfbe2761ed0baf058efb6d3 /geo-replication | |
parent | 9afe93bee897c8ead507a8dadb0e0fc32ed8abf0 (diff) |
geo-rep: Fix invalid disk size in gverify.sh
Problem:
Due to the wrong interpretation of disk size, gverify.sh script
exits in between with error "integer expression expected".
This error can be observed, only if gverify.sh is run standalone.
Solution:
Fix the interpretation of disk size.
Also, verify that master and slave's gluster version are same.
Change-Id: Id095dfffd07a93a535a380f617ad215230979870
BUG: 1305839
Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Reviewed-on: http://review.gluster.org/13407
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'geo-replication')
-rwxr-xr-x | geo-replication/src/gverify.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh index 42d9dcc6f51..9b1328aa631 100755 --- a/geo-replication/src/gverify.sh +++ b/geo-replication/src/gverify.sh @@ -60,9 +60,9 @@ function disk_usage() esac if [[ "X$os" = "XNetBSD" ]]; then - echo $(df -P "$1") + echo $(df -P "$1" | tail -1) else - echo $(df -P -B1 "$1") + echo $(df -P -B1 "$1" | tail -1) fi; } @@ -100,8 +100,8 @@ function master_stats() exit 1; fi; cd $d; - disk_size=$(disk_usage $d | tail -1 | awk "{print \$2}"); - used_size=$(disk_usage $d | tail -1 | awk "{print \$3}"); + disk_size=$(disk_usage $d | awk "{print \$2}"); + used_size=$(disk_usage $d | awk "{print \$3}"); umount_lazy $d; rmdir $d; ver=$(gluster --version | head -1 | cut -f2 -d " "); @@ -127,8 +127,8 @@ function slave_stats() exit 1; fi; cd $d; - disk_size=$(disk_usage $d | tail -1 | awk "{print \$2}"); - used_size=$(disk_usage $d | tail -1 | awk "{print \$3}"); + disk_size=$(disk_usage $d | awk "{print \$2}"); + used_size=$(disk_usage $d | awk "{print \$3}"); no_of_files=$(find $d -maxdepth 1 -path "$d/.trashcan" -prune -o -path "$d" -o -print0 -quit); umount_lazy $d; rmdir $d; @@ -222,7 +222,7 @@ function main() ERRORS=$(($ERRORS + 1)); fi; - if [[ $master_version > $slave_version ]]; then + if [[ $master_version != $slave_version ]]; then echo "Gluster version mismatch between master and slave." >> $log_file; ERRORS=$(($ERRORS + 1)); fi; |