summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-02-01 03:48:05 +0100
committerVijay Bellur <vbellur@redhat.com>2015-01-31 21:46:14 -0800
commite9276230e13e2c67b9944c604e8d4485ee3e3a63 (patch)
treed9a062eafad4a8dbafa93b93ac409abe2d4e77c2 /tests/include.rc
parentc46070189e4d9a71f7884dad06ee48b935c591e9 (diff)
Emulate Linux truncate for G and GB units
Recent modification in sparse-file-self-heal.t added a truncate -s 1G, and that unit was not emulated correctly for non Linux systems. As a result, all regression tests hang. Fill the gap to restore regression. BUG: 1129939 Change-Id: Ib45376b4b2e74d1868f3ebdd5564b2186b4318fa Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9519 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 1e0e08cbb7c..e7d982f7e5d 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -569,7 +569,7 @@ which truncate > /dev/null || {
exit 2;
}
- echo $newsize | egrep -q '[GTPEZY]B?$' && {
+ echo $newsize | egrep -q '[TPEZY]B?$' && {
echo "Unit not implemented for ${newsize}"
exit 2;
}
@@ -587,6 +587,12 @@ which truncate > /dev/null || {
*M)
newsize=$(( ${newsize/M/} * 1024 * 1024 ))
;;
+ *GB)
+ newsize=$(( ${newsize/GB/} * 1000 * 1000 * 1000 ))
+ ;;
+ *G)
+ newsize=$(( ${newsize/G/} * 1024 * 1024 * 1024 ))
+ ;;
esac
fi