summaryrefslogtreecommitdiffstats
path: root/tests/features/weighted-rebalance.t
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-08-23 02:14:36 -0700
committerHarshavardhana <harsha@harshavardhana.net>2014-09-05 10:04:20 -0700
commitfd500d4396f910e4cf759e0fffa4daf4ed24745a (patch)
tree2e52c1b64659efc3cf98fed31a8a2fc6f8a4bc26 /tests/features/weighted-rebalance.t
parent88159becd90d40323ecfc24cf40813538c9204cc (diff)
porting: Provide setfattr/getfattr implementation
- Use 'getfattr' properly avoid redundant options during xattr query - Untabify certain parts of tests (remove tabs) - Avoid backtick evaluation for certain values to make code more portable. - Use awk on FreeBSD/Darwin, since 'wc' implementation is broken and adds spurious spaces in its output. Change-Id: I7dcc0b70874e43b4cda8c306ed18a31b7a3f990a BUG: 1131713 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8520 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
Diffstat (limited to 'tests/features/weighted-rebalance.t')
-rwxr-xr-xtests/features/weighted-rebalance.t40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/features/weighted-rebalance.t b/tests/features/weighted-rebalance.t
index 5bd858b4c4c..b9d9eb4eb73 100755
--- a/tests/features/weighted-rebalance.t
+++ b/tests/features/weighted-rebalance.t
@@ -7,35 +7,35 @@
NFILES=1000
touch_files () {
- for i in $(seq 1 $NFILES); do
- touch $(printf $M0/dir/file%02d $i) 2> /dev/null
- done
+ for i in $(seq 1 $NFILES); do
+ touch $(printf $M0/dir/file%02d $i) 2> /dev/null
+ done
}
count_files () {
- found=0
- for i in $(seq 1 $NFILES); do
- if [ -f $(printf $1/dir/file%02d $i) ]; then
- found=$((found+1))
- fi
- done
- echo $found
+ found=0
+ for i in $(seq 1 $NFILES); do
+ if [ -f $(printf $1/dir/file%02d $i) ]; then
+ found=$((found+1))
+ fi
+ done
+ echo $found
}
wait_for_rebalance () {
- while true; do
- rebalance_completed
- if [ $? -eq 1 ]; then
- sleep 1
- else
- break
- fi
- done
+ while true; do
+ rebalance_completed
+ if [ $? -eq 1 ]; then
+ sleep 1
+ else
+ break
+ fi
+ done
}
get_xattr () {
- cmd="getfattr --absolute-names --only-values -n trusted.glusterfs.dht"
- $cmd $1 | od -tx1 -An | tr -d ' '
+ cmd="getfattr --absolute-names --only-values -n trusted.glusterfs.dht"
+ $cmd $1 | od -tx1 -An | tr -d ' '
}
cleanup