Whamcloud - gitweb
LU-4704 test: enable acl 974 and 2561 series test 41/9541/4
authorEmoly Liu <emoly.liu@intel.com>
Mon, 3 Mar 2014 04:19:05 +0000 (12:19 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 21 Mar 2014 02:31:32 +0000 (02:31 +0000)
Add acl/{974,974_remote,2561,2561_zfs}.test to the
lustre/tests/Makefile.am nobase_noinst_DATA list, and fix acl/run
test to fail if the test scripts are missing.
acl/2561_zfs.test is a newly created test file for zfs. Since zfs
allocates a 512 byte dnode for empty file, its "ls -s" result is
different from ldiskfs'.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I11be072eb1954fff3b7a19231b82345b3073a534
Reviewed-on: http://review.whamcloud.com/9541
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
lustre/tests/Makefile.am
lustre/tests/acl/2561.test
lustre/tests/acl/2561_zfs.test [new file with mode: 0644]
lustre/tests/acl/run
lustre/tests/sanity.sh

index 909894b..8d1833e 100644 (file)
@@ -49,6 +49,7 @@ nobase_noinst_SCRIPTS += rmtacl/make-tree rmtacl/run
 nobase_noinst_SCRIPTS += posix/posix.cfg
 nobase_noinst_DATA = acl/cp.test acl/getfacl-noacl.test acl/inheritance.test
 nobase_noinst_DATA += acl/misc.test acl/permissions.test acl/setfacl.test
+nobase_noinst_DATA += acl/974.test acl/974_remote.test acl/2561.test acl/2561_zfs.test
 nobase_noinst_DATA += rmtacl/misc.test rmtacl/permissions.test
 nobase_noinst_DATA += rmtacl/setfacl.test rmtacl/cp.test
 nobase_noinst_DATA += rmtacl/getfacl-noacl.test rmtacl/inheritance.test
index 67de760..073d1a0 100644 (file)
@@ -6,5 +6,6 @@ LU-2561 newly created file is same size as directory
        $ touch f1
        $ ls -s f1
        > 0 f1
+       $ cd ..
        $ rm -rf 2561
 
diff --git a/lustre/tests/acl/2561_zfs.test b/lustre/tests/acl/2561_zfs.test
new file mode 100644 (file)
index 0000000..8ab0657
--- /dev/null
@@ -0,0 +1,11 @@
+LU-2561 newly created file is same size as directory
+
+       $ mkdir -p 2561
+       $ cd 2561
+       $ getfacl --access . | setfacl -d -M- .
+       $ touch f1
+       $ ls -s f1
+       > 1 f1
+       $ cd ..
+       $ rm -rf 2561
+
index 05437d6..6a86c22 100755 (executable)
@@ -32,9 +32,16 @@ my ($prog, $in, $out) = ([], [], []);
 my $line_number = 0;
 my $prog_line;
 my ($tests, $failed) = (0,0);
+my $testfile;
 
+if (!defined($ARGV[0])) {
+       print "No test file specified\n";
+       exit 1;
+}
+
+open($testfile, $ARGV[0]) or die "Can't open file $ARGV[0]: $!";
 for (;;) {
-  my $line = <>; $line_number++;
+  my $line = <$testfile>; $line_number++;
   if (defined $line) {
     # Substitute %VAR and %{VAR} with environment variables.
     $line =~ s[%(?:(\w+)|\{(\w+)\})][$ENV{"$1$2"}]eg;
@@ -62,6 +69,7 @@ for (;;) {
     last;
   }
 }
+close($testfile);
 
 my $status = sprintf("%d commands (%d passed, %d failed)",
        $tests, $tests-$failed, $failed);
index c90d621..2e1d0b0 100644 (file)
@@ -6619,7 +6619,11 @@ test_103 () {
        fi
 
        echo "LU-2561 newly created file is same size as directory..."
-       run_acl_subtest 2561 || error "LU-2561 test failed"
+       if [ $(facet_fstype $SINGLEMDS) != "zfs" ]; then
+               run_acl_subtest 2561 || error "LU-2561 test failed"
+       else
+               run_acl_subtest 2561_zfs || error "LU-2561 zfs test failed"
+       fi
 
        cd $SAVE_PWD
        umask $SAVE_UMASK