Whamcloud - gitweb
LU-4704 test: enable acl 974 and 2561 series test 12/10512/3
authorEmoly Liu <emoly.liu@intel.com>
Mon, 3 Mar 2014 04:19:05 +0000 (12:19 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 1 Jun 2014 06:19:33 +0000 (06:19 +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'.

Lustre-change: http://review.whamcloud.com/9541
Lustre-commit: 1116d8a6233e307abab579e2ee0a63b450087413

Signed-off-by: Emoly Liu <emoly.liu@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>
Change-Id: Ifba5b76fa7302f8b129b979aeccf3844f4fe334d
Reviewed-on: http://review.whamcloud.com/10512
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@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 06ef9ee..6a7685a 100644 (file)
@@ -49,7 +49,7 @@ 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
-nobase_noinst_DATA += acl/2561.test acl/4924.test
+nobase_noinst_DATA += acl/2561.test acl/2561_zfs.test acl/4924.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 3ba6551..0e08e96 100644 (file)
@@ -6606,7 +6606,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
 
        run_acl_subtest 4924 || error "LU-4924 test failed"