summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-07-10 05:45:52 +0200
committerVijay Bellur <vbellur@redhat.com>2014-07-14 06:29:15 -0700
commit210a59e48a52515615e440e2a6e1b650063c370b (patch)
treed7b6c13f342fc7ca01c17216720cf52990bd70aa /tests/basic
parentf637f2f101b13388187f8a6852d3ae6f1d9c2ad5 (diff)
Regression test portability: dd usage
NetBSD, FreeBSD, and MacOS X dd(1) bs argument uses m for megabyte, while Linux uses M. Use bs=1024k instead of bs=1M for better compatibility. BUG: 764655 Change-Id: I603f57adbc9b31f6d634b918726437fbfce42e03 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8278 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/afr/read-subvol-data.t4
-rw-r--r--tests/basic/afr/self-heal.t14
-rw-r--r--tests/basic/afr/sparse-file-self-heal.t12
-rwxr-xr-xtests/basic/cdc.t6
-rwxr-xr-xtests/basic/quota.t10
-rw-r--r--tests/basic/self-heald.t2
6 files changed, 24 insertions, 24 deletions
diff --git a/tests/basic/afr/read-subvol-data.t b/tests/basic/afr/read-subvol-data.t
index 2fa20a2c181..0c4b366331d 100644
--- a/tests/basic/afr/read-subvol-data.t
+++ b/tests/basic/afr/read-subvol-data.t
@@ -20,9 +20,9 @@ TEST $CLI volume set $V0 cluster.read-subvolume $V0-client-1
TEST $CLI volume set $V0 cluster.data-self-heal off
TEST $CLI volume set $V0 cluster.metadata-self-heal off
TEST $CLI volume set $V0 cluster.entry-self-heal off
-TEST dd if=/dev/urandom of=$M0/afr_success_5.txt bs=1M count=1
+TEST dd if=/dev/urandom of=$M0/afr_success_5.txt bs=1024k count=1
TEST kill_brick $V0 $H0 $B0/brick0
-TEST dd if=/dev/urandom of=$M0/afr_success_5.txt bs=1M count=10
+TEST dd if=/dev/urandom of=$M0/afr_success_5.txt bs=1024k count=10
TEST $CLI volume start $V0 force
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "10485760" echo `ls -l $M0/afr_success_5.txt | awk '{ print $5}'`
diff --git a/tests/basic/afr/self-heal.t b/tests/basic/afr/self-heal.t
index 575ed4c4f72..60e953b9996 100644
--- a/tests/basic/afr/self-heal.t
+++ b/tests/basic/afr/self-heal.t
@@ -21,10 +21,10 @@ TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 --entry-timeout=0 --att
#Test
TEST mkdir -p $M0/abc/def $M0/abc/ghi
-TEST dd if=/dev/urandom of=$M0/abc/file_abc.txt bs=1M count=2 2>/dev/null
-TEST dd if=/dev/urandom of=$M0/abc/def/file_abc_def_1.txt bs=1M count=2 2>/dev/null
-TEST dd if=/dev/urandom of=$M0/abc/def/file_abc_def_2.txt bs=1M count=3 2>/dev/null
-TEST dd if=/dev/urandom of=$M0/abc/ghi/file_abc_ghi.txt bs=1M count=4 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/abc/file_abc.txt bs=1024k count=2 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/abc/def/file_abc_def_1.txt bs=1024k count=2 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/abc/def/file_abc_def_2.txt bs=1024k count=3 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/abc/ghi/file_abc_ghi.txt bs=1024k count=4 2>/dev/null
TEST kill_brick $V0 $H0 $B0/brick0
TEST truncate -s 0 $M0/abc/def/file_abc_def_1.txt
@@ -33,9 +33,9 @@ NEW_GID=36
TEST chown $NEW_UID:$NEW_GID $M0/abc/def/file_abc_def_2.txt
TEST rm -rf $M0/abc/ghi
TEST mkdir -p $M0/def/ghi $M0/jkl/mno
-TEST dd if=/dev/urandom of=$M0/def/ghi/file1.txt bs=1M count=2 2>/dev/null
-TEST dd if=/dev/urandom of=$M0/def/ghi/file2.txt bs=1M count=3 2>/dev/null
-TEST dd if=/dev/urandom of=$M0/jkl/mno/file.txt bs=1M count=4 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/def/ghi/file1.txt bs=1024k count=2 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/def/ghi/file2.txt bs=1024k count=3 2>/dev/null
+TEST dd if=/dev/urandom of=$M0/jkl/mno/file.txt bs=1024k count=4 2>/dev/null
TEST chown $NEW_UID:$NEW_GID $M0/def/ghi/file2.txt
TEST $CLI volume start $V0 force
diff --git a/tests/basic/afr/sparse-file-self-heal.t b/tests/basic/afr/sparse-file-self-heal.t
index 01b676ea900..fa8375b1c8d 100644
--- a/tests/basic/afr/sparse-file-self-heal.t
+++ b/tests/basic/afr/sparse-file-self-heal.t
@@ -14,9 +14,9 @@ TEST $CLI volume set $V0 data-self-heal-algorithm full
TEST $CLI volume start $V0
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
-TEST dd if=/dev/urandom of=$M0/small count=1 bs=1M
-TEST dd if=/dev/urandom of=$M0/bigger2big count=1 bs=2M
-TEST dd if=/dev/urandom of=$M0/big2bigger count=1 bs=1M
+TEST dd if=/dev/urandom of=$M0/small count=1 bs=1024k
+TEST dd if=/dev/urandom of=$M0/bigger2big count=1 bs=2048k
+TEST dd if=/dev/urandom of=$M0/big2bigger count=1 bs=1024k
TEST kill_brick $V0 $H0 $B0/${V0}0
@@ -71,9 +71,9 @@ TEST rm -f $M0/*
#check the same tests with diff self-heal
TEST $CLI volume set $V0 data-self-heal-algorithm diff
-TEST dd if=/dev/urandom of=$M0/small count=1 bs=1M
-TEST dd if=/dev/urandom of=$M0/big2bigger count=1 bs=1M
-TEST dd if=/dev/urandom of=$M0/bigger2big count=1 bs=2M
+TEST dd if=/dev/urandom of=$M0/small count=1 bs=1024k
+TEST dd if=/dev/urandom of=$M0/big2bigger count=1 bs=1024k
+TEST dd if=/dev/urandom of=$M0/bigger2big count=1 bs=2048k
TEST kill_brick $V0 $H0 $B0/${V0}0
diff --git a/tests/basic/cdc.t b/tests/basic/cdc.t
index f7c117063f8..be7d9a4ad0b 100755
--- a/tests/basic/cdc.t
+++ b/tests/basic/cdc.t
@@ -51,11 +51,11 @@ TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $
####################
## Create a 1K file locally and find the md5sum
-TEST dd if=/dev/zero of=/tmp/cdc-orig count=1 bs=1K 2>/dev/null
+TEST dd if=/dev/zero of=/tmp/cdc-orig count=1 bs=1k 2>/dev/null
checksum[original-file]=`md5sum /tmp/cdc-orig | cut -d' ' -f1`
## Copy the file to mountpoint and find its md5sum on brick
-TEST dd if=/tmp/cdc-orig of=$M0/cdc-server count=1 bs=1K 2>/dev/null
+TEST dd if=/tmp/cdc-orig of=$M0/cdc-server count=1 bs=1k 2>/dev/null
checksum[brick-file]=`md5sum $B0/${V0}1/cdc-server | cut -d' ' -f1`
## Uncompress the gzip dump file and find its md5sum
@@ -75,7 +75,7 @@ TEST rm -f /tmp/cdcdump.gz
###################
## Copy file from mount point to client and find checksum
-TEST dd if=$M0/cdc-server of=/tmp/cdc-client count=1 bs=1K 2>/dev/null
+TEST dd if=$M0/cdc-server of=/tmp/cdc-client count=1 bs=1k 2>/dev/null
checksum[client-file]=`md5sum /tmp/cdc-client | cut -d' ' -f1`
## Uncompress the gzip dump file and find its md5sum
diff --git a/tests/basic/quota.t b/tests/basic/quota.t
index 1f6febd73a5..ae45a6357cd 100755
--- a/tests/basic/quota.t
+++ b/tests/basic/quota.t
@@ -70,19 +70,19 @@ TEST $CLI volume quota $V0 hard-timeout 0
## Verify quota enforcement
## -----------------------------
-TEST ! dd if=/dev/urandom of=$M0/test_dir/1.txt bs=1M count=12
+TEST ! dd if=/dev/urandom of=$M0/test_dir/1.txt bs=1024k count=12
TEST rm $M0/test_dir/1.txt
# wait for marker's accounting to complete
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test_dir"
-TEST dd if=/dev/urandom of=$M0/test_dir/2.txt bs=1M count=8
+TEST dd if=/dev/urandom of=$M0/test_dir/2.txt bs=1024k count=8
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir"
TEST rm $M0/test_dir/2.txt
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test_dir"
## rename tests
-TEST dd if=/dev/urandom of=$M0/test_dir/2 bs=1M count=8
+TEST dd if=/dev/urandom of=$M0/test_dir/2 bs=1024k count=8
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir"
TEST mv $M0/test_dir/2 $M0/test_dir/0
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir"
@@ -137,7 +137,7 @@ done
#53-62
for i in `seq 1 9`; do
TEST_IN_LOOP dd if=/dev/urandom of="$M0/$TESTDIR/dir1/10MBfile$i" \
- bs=1M count=10;
+ bs=1024k count=10;
done
# 63-64
@@ -159,7 +159,7 @@ done
## <Try creating data beyond limit>
## --------------------------------
for i in `seq 1 200`; do
- dd if=/dev/urandom of="$M0/$TESTDIR/dir1/1MBfile$i" bs=1M count=1 \
+ dd if=/dev/urandom of="$M0/$TESTDIR/dir1/1MBfile$i" bs=1024k count=1 \
&>/dev/null
done
diff --git a/tests/basic/self-heald.t b/tests/basic/self-heald.t
index 913cfc80599..b5815a6773f 100644
--- a/tests/basic/self-heald.t
+++ b/tests/basic/self-heald.t
@@ -19,7 +19,7 @@ cd $M0
HEAL_FILES=0
for i in {1..10}
do
- dd if=/dev/urandom of=f bs=1M count=10 2>/dev/null
+ dd if=/dev/urandom of=f bs=1024k count=10 2>/dev/null
HEAL_FILES=$(($HEAL_FILES+1))
mkdir a; cd a;
HEAL_FILES=$(($HEAL_FILES+3)) #As many times as distribute subvols