diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2014-08-07 17:01:18 +0200 |
---|---|---|
committer | Harshavardhana <harsha@harshavardhana.net> | 2014-08-18 01:09:39 -0700 |
commit | ba0f31b2a5c8bd35f99b1ba2a74c81a2c2ded200 (patch) | |
tree | 572eb19fb9cba596469fc529556c4708d1e0788c /tests/basic | |
parent | c80b5b915a6bf2c6506d789f8ab6f0dcbf3dc617 (diff) |
Regression test portability: stat
Linux uses stat -c, stat --printf= or stat --printf
NetBSD uses stat -f with different format strings. This change set
changes all stat usage to stat -c and introduce a shell stat()
fonction to perform the format string translation.
BUG: 764655
Change-Id: I024fca7c1b736b053f5888cbf21da0a72489ef63
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8424
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Diffstat (limited to 'tests/basic')
-rw-r--r-- | tests/basic/afr/self-heal.t | 8 | ||||
-rwxr-xr-x | tests/basic/rpc-coverage.sh | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/basic/afr/self-heal.t b/tests/basic/afr/self-heal.t index 731bd8fbc20..acdd6b73ca0 100644 --- a/tests/basic/afr/self-heal.t +++ b/tests/basic/afr/self-heal.t @@ -58,7 +58,7 @@ TEST ls $B0/brick0/def/ghi/file1.txt TEST ls $B0/brick0/def/ghi/file2.txt TEST ls $B0/brick0/jkl/mno/file.txt TEST ! ls $B0/brick0/abc/ghi -EXPECT "$NEW_UID$NEW_GID" stat --printf=%u%g $B0/brick0/abc/def/file_abc_def_2.txt +EXPECT "$NEW_UID$NEW_GID" stat -c %u%g $B0/brick0/abc/def/file_abc_def_2.txt TEST diff <($AREQUAL_PATH/arequal-checksum -p $B0/brick0 -i .glusterfs) <($AREQUAL_PATH/arequal-checksum -p $B0/brick1 -i .glusterfs) #Cleanup @@ -105,7 +105,7 @@ TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "0" afr_get_pending_heal_count $V0 #check heal has happened in the correct direction -EXPECT "777" stat --printf=%a $B0/brick0/file +EXPECT "777" stat -c %a $B0/brick0/file TEST diff <($AREQUAL_PATH/arequal-checksum -p $B0/brick0 -i .glusterfs) <($AREQUAL_PATH/arequal-checksum -p $B0/brick1 -i .glusterfs) #Cleanup @@ -129,7 +129,7 @@ TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "0" afr_get_pending_heal_count $V0 #check heal has happened in the correct direction -EXPECT "$NEW_UID$NEW_GID" stat --printf=%u%g $B0/brick0/file +EXPECT "$NEW_UID$NEW_GID" stat -c %u%g $B0/brick0/file TEST diff <($AREQUAL_PATH/arequal-checksum -p $B0/brick0 -i .glusterfs) <($AREQUAL_PATH/arequal-checksum -p $B0/brick1 -i .glusterfs) #Cleanup @@ -160,7 +160,7 @@ TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "0" afr_get_pending_heal_count $V0 #check heal has happened in the correct direction -EXPECT 0 stat --printf=%s $B0/brick1/file +EXPECT 0 stat -c %s $B0/brick1/file TEST diff <($AREQUAL_PATH/arequal-checksum -p $B0/brick0 -i .glusterfs) <($AREQUAL_PATH/arequal-checksum -p $B0/brick1 -i .glusterfs) #Cleanup diff --git a/tests/basic/rpc-coverage.sh b/tests/basic/rpc-coverage.sh index dc66969d045..1fae111d04b 100755 --- a/tests/basic/rpc-coverage.sh +++ b/tests/basic/rpc-coverage.sh @@ -71,7 +71,7 @@ function test_statfs() { local size; - size=$(stat -f -c '%s' $PFX/dir/file); + size=$(stat -c -c '%s' $PFX/dir/file); test "x$size" != "x0" || fail "statfs" } |