Skip to content

Commit

Permalink
LU-9663 tests: replace “ls -s” with “stat -c '%s'” to get file size
Browse files Browse the repository at this point in the history
This patch improves acl/2561{,_zfs}.test to use “stat -c '%s'” to
get file size instead of using “ls -s”, which prints the allocated
size of the file in blocks.

Test-Parameters: trivial \
envdefinitions=ONLY=103 \
mdtfilesystemtype=zfs ostfilesystemtype=zfs \
testlist=sanity

Change-Id: I8bfea5197102baeece244e20731c90172c5cc2f1
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: https://review.whamcloud.com/27961
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
  • Loading branch information
Jian Yu authored and Oleg Drokin committed Jul 19, 2017
1 parent c245e87 commit 45b8c6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lustre/tests/acl/2561.test
Expand Up @@ -4,8 +4,8 @@ LU-2561 newly created file is same size as directory
$ cd 2561
$ getfacl --access . | setfacl -d -M- .
$ touch f1
$ ls -s f1
> 0 f1
$ stat -c '%s' f1
> 0
$ cd ..
$ rm -rf 2561

4 changes: 2 additions & 2 deletions lustre/tests/acl/2561_zfs.test
Expand Up @@ -4,8 +4,8 @@ LU-2561 newly created file is same size as directory
$ cd 2561
$ getfacl --access . | setfacl -d -M- .
$ touch f1
$ ls -s f1
> 1 f1
$ stat -c '%s' f1
> 0
$ cd ..
$ rm -rf 2561

2 changes: 1 addition & 1 deletion lustre/tests/acl/run
Expand Up @@ -42,7 +42,7 @@ if (!defined($ARGV[0])) {
open($testfile, $ARGV[0]) or die "Can't open file $ARGV[0]: $!";
for (;;) {
my $line = <$testfile>; $line_number++;
if (defined $line) {
if (defined $line && $line !~ /\%s/) {
# Substitute %VAR and %{VAR} with environment variables.
$line =~ s[%(?:(\w+)|\{(\w+)\})][$ENV{"$1$2"}]eg;
}
Expand Down

0 comments on commit 45b8c6c

Please sign in to comment.