From: Emoly Liu Date: Mon, 3 Mar 2014 04:19:05 +0000 (+0800) Subject: LU-4704 test: enable acl 974 and 2561 series test X-Git-Tag: 2.5.58~95 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1116d8a6233e307abab579e2ee0a63b450087413 LU-4704 test: enable acl 974 and 2561 series test 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 Change-Id: I11be072eb1954fff3b7a19231b82345b3073a534 Reviewed-on: http://review.whamcloud.com/9541 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Tested-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Jian Yu --- diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 909894b..8d1833e 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -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 diff --git a/lustre/tests/acl/2561.test b/lustre/tests/acl/2561.test index 67de760..073d1a0 100644 --- a/lustre/tests/acl/2561.test +++ b/lustre/tests/acl/2561.test @@ -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 index 0000000..8ab0657 --- /dev/null +++ b/lustre/tests/acl/2561_zfs.test @@ -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 + diff --git a/lustre/tests/acl/run b/lustre/tests/acl/run index 05437d6..6a86c22 100755 --- a/lustre/tests/acl/run +++ b/lustre/tests/acl/run @@ -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); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index c90d621..2e1d0b0 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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