From: Richard D. <ric...@us...> - 2008-07-19 09:55:10
|
Update of /cvsroot/file-extattr/File-ExtAttr/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22738/t Modified Files: 18list.t 20tie-basic.t 22tie-nonuser.t 30nsbasic.t 31nsmultiple.t Added Files: 81closed.t Log Message: Update Solaris layer to use new error reporting convention. Ignore SUNWattr_r[ow] system extensible attributes on (Open)Solaris. Added doc ref to Solaris system extensible attributes. Test listfattr() on a closed file. Index: 18list.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/18list.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 18list.t 6 Apr 2008 09:12:48 -0000 1.5 --- 18list.t 19 Jul 2008 09:55:15 -0000 1.6 *************** *** 64,68 **** # Check that the list contains all the attributes. my @attrs = listfattr($_); ! @attrs = sort @attrs; my @ks = sort keys %vals; --- 64,68 ---- # Check that the list contains all the attributes. my @attrs = listfattr($_); ! @attrs = sort(t::Support::filter_system_attrs(@attrs)); my @ks = sort keys %vals; *************** *** 105,109 **** # Check that the list contains all the attributes. my @attrs = listfattr($fh); ! @attrs = sort @attrs; my @ks = sort keys %vals; --- 105,109 ---- # Check that the list contains all the attributes. my @attrs = listfattr($fh); ! @attrs = sort(t::Support::filter_system_attrs(@attrs)); my @ks = sort keys %vals; Index: 31nsmultiple.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/31nsmultiple.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 31nsmultiple.t 6 Apr 2008 09:12:48 -0000 1.5 --- 31nsmultiple.t 19 Jul 2008 09:55:15 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- use strict; use Test::More; + use Data::Dumper; BEGIN { *************** *** 21,25 **** plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 40; } --- 22,26 ---- plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 42; } *************** *** 97,102 **** #check user namespace doesn't exist now ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); #} } --- 98,108 ---- #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($_); ! ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); ! } #} } *************** *** 145,152 **** #check that it's gone is (getfattr($fh, "$key", { namespace => 'user' }), undef); #check user namespace doesn't exist now ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); #} #print STDERR "done\n"; --- 151,165 ---- #check that it's gone is (getfattr($fh, "$key", { namespace => 'user' }), undef); + is (getfattr($fh, "$key2", { namespace => 'user' }), undef); + is (getfattr($fh, "$key3", { namespace => 'user' }), undef); #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($fh); ! ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); ! } #} #print STDERR "done\n"; Index: 30nsbasic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/30nsbasic.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 30nsbasic.t 6 Apr 2008 09:12:48 -0000 1.7 --- 30nsbasic.t 19 Jul 2008 09:55:15 -0000 1.8 *************** *** 79,84 **** #check user namespace doesn't exist now ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); #} } --- 79,89 ---- #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($_); ! ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); ! } #} } *************** *** 116,121 **** #check user namespace doesn't exist now ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); #} #print STDERR "done\n"; --- 121,131 ---- #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($fh); ! ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); ! } #} #print STDERR "done\n"; --- NEW FILE: 81closed.t --- #!perl -w # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Linux-xattr.t' ########################## # change 'tests => 2' to 'tests => last_test_to_print'; use strict; use Test::More; use Data::Dumper; BEGIN { my $tlib = $0; $tlib =~ s|/[^/]*$|/lib|; push(@INC, $tlib); } use t::Support; if (t::Support::should_skip()) { plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { plan tests => 1; } use File::Temp qw(tempfile); use File::Path; use File::ExtAttr qw(setfattr getfattr delfattr listfattrns); use IO::File; my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); close $fh or die "can't close $filename $!"; # This shouldn't crash. my @ns = listfattrns($fh); ok 1; END { unlink $filename if $filename; }; Index: 20tie-basic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/20tie-basic.t,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** 20tie-basic.t 6 Apr 2008 09:12:48 -0000 1.10 --- 20tie-basic.t 19 Jul 2008 09:55:15 -0000 1.11 *************** *** 44,47 **** --- 44,48 ---- # Check there are no user extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == 0); *************** *** 83,86 **** --- 84,88 ---- # Check there are only our extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == scalar(keys(%test_attrs))); print '# '.join(' ', @ks)."\n"; Index: 22tie-nonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/22tie-nonuser.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 22tie-nonuser.t 6 Apr 2008 09:21:27 -0000 1.7 --- 22tie-nonuser.t 19 Jul 2008 09:55:15 -0000 1.8 *************** *** 44,47 **** --- 44,48 ---- # Check there are no user extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == 0); *************** *** 92,95 **** --- 93,97 ---- # Check there are only our extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == 0); print '# '.join(' ', @ks)."\n"; |