Skip to contentSkip to conversation

attr: test/ improvements and integrate with make

PATCH In review [email protected] 3 participants 15 messages Jan 8, 2009 – Feb 10, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

cover attr: test/ improvements and integrate with make

Hello-

NOTE: Timothy Shimmin's email ([email protected]) seems to be gone. Who should I send patches like this to in the future?

This series makes some improvements to the attr tests to integrate them into make and add a few testing features to the harness.

The most useful feature is being able to run make test from the root of the source tree to build the tree to run a generic set of tests.

Cheers,

Brandon

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH 1/4 attr: move ext2/3 tests into seperate test file.

Some of these tests are fs specific and don't work under newer ext3 disks. Move into a seperate directory and file.

---
 test/attr.test   |   91 +++++++++++++++++++++++++------------------------------
 test/ext/fs.test |   68 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+), 48 deletions(-)
test/attr.test +1 -9
Index: attr-2.4.43/test/attr.test
===================================================================
@@ -1,8 +1,4 @@
-Tests for extended attributes on ext2/ext3 file systems. The initial
-size checks and the file size checks are ext2/ext3 specific. The
-other setfattr/getfattr operations are designed to cover all special
-cases in the ext27ext3 kernel patches, but they should work on other
-filesystems as well.
+Tests for extended attributes on file systems.
 
 Execute this test using the `run' script in this directory:
 
@@ -29,14 +25,6 @@ Try various valid and invalid names
 	$ setfattr -n user.n -v value f
 	$ rm f
 
-Size checks, for an ext2/ext3 file system with a block size of 4K
-
-	$ touch f
-	$ setfattr -n user.name -v 4040+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
- $ setfattr -n user.name -v 4041+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
- > setfattr: f: No space left on device
-
- $ rm f

Editing values

@@ -147,17 +135,30 @@ Test extended attribute block sharing

 	$ touch f g h
 	$ setfattr -n user.novalue f g h
-	$ ls -s f g h
-	> 4 f
-	> 4 g
-	> 4 h
-	
+	$ getfattr f g h
+	> # file: f
+	> user.novalue
+	>
+	> # file: g
+	> user.novalue
+	>
+	> # file: h
+	> user.novalue
+	>
+
 	$ setfattr -n user.name -v value f
-	$ ls -s f g h
-	> 4 f
-	> 4 g
-	> 4 h
-	
+	$ getfattr f g h
+	> # file: f
+	> user.name
+	> user.novalue
+	>
+	> # file: g
+	> user.novalue
+	>
+	> # file: h
+	> user.novalue
+	>
+
 	$ getfattr -d f g h
 	> # file: f
 	> user.name="value"
@@ -169,38 +170,32 @@ Test extended attribute block sharing
 	> # file: h
 	> user.novalue
 	> 
-	
+
 	$ setfattr -n user.name -v value g
-	$ ls -s f g h
-	> 4 f
-	> 4 g
-	> 4 h
-	
-	$ setfattr -x user.novalue h
-	$ ls -s f g h
-	> 4 f
-	> 4 g
-	> 0 h
-	
-	$ getfattr -d f g h
+	$ getfattr f g h
 	> # file: f
-	> user.name="value"
+	> user.name
 	> user.novalue
 	> 
 	> # file: g
-	> user.name="value"
+	> user.name
 	> user.novalue
 	> 
-	
-	$ setfattr -n user.name -v other-value g
-	$ setfattr -n user.name -v value g
-	$ setfattr -x user.name f g
-	$ setfattr -x user.novalue f g
-	$ ls -s f g h
-	> 0 f
-	> 0 g
-	> 0 h
-	
+	> # file: h
+	> user.novalue
+	>
+
+	$ setfattr -x user.novalue h
+	$ getfattr f g h
+	> # file: f
+	> user.name
+	> user.novalue
+	>
+	> # file: g
+	> user.name
+	> user.novalue
+	>
+
 	$ rm f g h

Attributes of symlinks vs. the files pointed to

test/ext/fs.test new file +10 -0
Index: attr-2.4.43/test/ext/fs.test
===================================================================
@@ -0,0 +1,68 @@
+Tests for extended attributes on ext2/ext3 file systems. The initial
+size checks and the file size checks are ext2/ext3 specific. The
+other setfattr/getfattr operations are designed to cover all special
+cases in the ext27ext3 kernel patches, but they should work on other
+filesystems as well.
+
+Size checks, for an ext2/ext3 file system with a block size of 4K
+
+	$ touch f
+	$ setfattr -n user.name -v 4040+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
+ $ setfattr -n user.name -v 4041+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
+ > setfattr: f: No space left on device
+
+ $ rm f
+
+
+Test extended attribute block sharing
+
+ $ touch f g h
+ $ setfattr -n user.novalue f g h
+ $ ls -s f g h
+ > 4 f
+ > 4 g
+ > 4 h
+
+ $ setfattr -n user.name -v value f
+ $ ls -s f g h
+ > 4 f
+ > 4 g
+ > 4 h
+
+ $ getfattr -d f g h
+ > # file: f
+ > user.name="value"
+ > user.novalue
+ >
+ > # file: g
+ > user.novalue
+ >
+ > # file: h
+ > user.novalue
+ >
+
+ $ setfattr -n user.name -v value g
+ $ ls -s f g h
+ > 4 f
+ > 4 g
+ > 4 h
+
+ $ setfattr -x user.novalue h
+ $ ls -s f g h
+ > 4 f
+ > 4 g
+ > 0 h
+
+ $ setfattr -n user.name -v other-value g
+ $ setfattr -n user.name -v value g
+ $ setfattr -x user.name f g
+ $ setfattr -x user.novalue f g
+ $ ls -s f g h
+ > 0 f
+ > 0 g
+ > 0 h
+
+ $ rm f g h
+
+
+

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

PATCH 2/4 attr: various improvements for test/run

In reply to [email protected]

First move process_test to avoid a warning:

main::process_test() called too early to check prototype at ./run line 47. main::process_test() called too early to check prototype at ./run line 60.

Create two ENV variables TUSER and TGROUP to get the user/group running the test.

Add a | test line that is similar to > but is interpreted as a regular expression.

---
 test/run |   99 ++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 51 insertions(+), 48 deletions(-)
test/run +49 -38
Index: acl-2.2.47/test/run
===================================================================
@@ -25,26 +25,69 @@ if (isatty(fileno(STDOUT))) {
 	$FAILED = "\033[31m\033[1m" . $FAILED . "\033[m";
 }
 
+$ENV{"TUSER"} = getpwuid($>);
+$ENV{"TGROUP"} = getgrgid($));
+
 sub exec_test($$);
 
-my ($prog, $in, $out) = ([], [], []);
+my ($prog, $in, $out, $outmatch) = ([], [], [], []);
 my $line_number = 0;
 my $prog_line;
 my ($tests, $failed) = (0,0);
 
+sub process_test($$$$$) {
+  my ($prog, $prog_line, $in, $out, $outmatch) = @_;
+
+  return unless @$prog;
+
+       my $p = [ @$prog ];
+       print "[$prog_line] \$ ", join(' ',
+             map { s/\s/\\$&/g; $_ } @$p), " -- ";
+       my $result = exec_test($prog, $in);
+       my $good = 1;
+       my $nmax = (@$outmatch > @$result) ? @$outmatch : @$result;
+       for (my $n=0; $n < $nmax; $n++) {
+	 if (!defined($outmatch->[$n]) || !defined($result->[$n]) ||
+	      $result->[$n] !~ /($outmatch->[$n])/) {
+		 $good = 0;
+	 }
+       }
+       $tests++;
+       $failed++ unless $good;
+       print $good ? $OK : $FAILED, "\n";
+       if (!$good) {
+         for (my $n=0; $n < $nmax; $n++) {
+	   my $l = defined($out->[$n]) ? $out->[$n] : "~";
+	   chomp $l;
+	   my $r = defined($result->[$n]) ? $result->[$n] : "~";
+	   chomp $r;
+	   print sprintf("%-37s %s %-39s\n", $l, $l eq $r ? "|" : "?", $r);
+         }
+       } elsif ($opt_v) {
+	 print join('', @$result);
+       }
+}
+
+
+
 for (;;) {
   my $line = <>; $line_number++;
   if (defined $line) {
     # Substitute %VAR and %{VAR} with environment variables.
-    $line =~ s[%(?:(\w+)|\{(\w+)\})][$ENV{"$1$2"}]eg;
+    $line =~ s[%\{(\w+)\}][$ENV{"$1"}]eg;
+    $line =~ s[%(\w+)][$ENV{"$1"}]eg;
   }
   if (defined $line) {
     if ($line =~ s/^\s*< ?//) {
       push @$in, $line;
-    } elsif ($line =~ s/^\s*> ?//) {
+    } elsif ($line =~ s/^\s*> ?//) { # explicit matching
+      push @$outmatch, "^(\Q$line\E)\$";
+      push @$out, $line;
+    } elsif ($line =~ s/^\s*\| ?//) { # regex case
+      push @$outmatch, $line;
       push @$out, $line;
     } else {
-      process_test($prog, $prog_line, $in, $out);
+      process_test($prog, $prog_line, $in, $out, $outmatch);
 
       $prog = [];
       $prog_line = 0;
@@ -55,9 +98,10 @@ for (;;) {
       $prog_line = $line_number;
       $in = [];
       $out = [];
+      $outmatch = [];
     }
   } else {
-    process_test($prog, $prog_line, $in, $out);
+    process_test($prog, $prog_line, $in, $out, $outmatch);
     last;
   }
 }
@@ -75,39 +119,6 @@ print $status, "\n";
 exit $failed ? 1 : 0;
 
 
-sub process_test($$$$) {
-  my ($prog, $prog_line, $in, $out) = @_;
-
-  return unless @$prog;
-
-       my $p = [ @$prog ];
-       print "[$prog_line] \$ ", join(' ',
-             map { s/\s/\\$&/g; $_ } @$p), " -- ";
-       my $result = exec_test($prog, $in);
-       my $good = 1;
-       my $nmax = (@$out > @$result) ? @$out : @$result;
-       for (my $n=0; $n < $nmax; $n++) {
-	 if (!defined($out->[$n]) || !defined($result->[$n]) ||
-	     $out->[$n] ne $result->[$n]) {
-		 $good = 0;
-	 }
-       }
-       $tests++;
-       $failed++ unless $good;
-       print $good ? $OK : $FAILED, "\n";
-       if (!$good) {
-         for (my $n=0; $n < $nmax; $n++) {
-	   my $l = defined($out->[$n]) ? $out->[$n] : "~";
-	   chomp $l;
-	   my $r = defined($result->[$n]) ? $result->[$n] : "~";
-	   chomp $r;
-	   print sprintf("%-37s %s %-39s\n", $l, $l eq $r ? "|" : "?", $r);
-         }
-       } elsif ($opt_v) {
-	 print join('', @$result);
-       }
-}
-
 
 sub su($) {
   my ($user) = @_;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH 3/4 attr: add make test target and use make to run tests

In reply to [email protected]

The tests are difficult to run. So, this patch adds a Make target that sets up the path and runs *.test files in the test/ directory.

ext specific tests can be ran from the test directory by running make ext

---
 Makefile      |    6 +++++-
 test/Makefile |   22 +++++++++++++---------
 test/README   |    4 ++++
 3 files changed, 22 insertions(+), 10 deletions(-)
test/README +4 -0
Index: attr-2.4.43/test/README
===================================================================
@@ -1,3 +1,7 @@
+Run `make test` in the root source tree to build the tree and run
+FS-independent tests.
+
+Run `cd test; make ext` to run ext specific tests.
 
 Andreas Gruenbacher's tests for the ext2 filesystem extended attributes
 support.  Most of these tests should work for any filesystem type, and
test/Makefile +13 -9
Index: attr-2.4.43/test/Makefile
===================================================================
@@ -1,16 +1,20 @@
 #
-# Copyright (c) 2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) 2008 Novell, Inc.
 #
 
-TOPDIR = ..
-include $(TOPDIR)/include/builddefs
+TEST = $(wildcard *.test)
+EXT = $(wildcard ext/*.test)
 
-# ensure we pick these up in the source tarball
-LSRCFILES = attr.test run README
+PATH := $(abspath ../getfattr/):$(abspath ../setfattr):$(abspath ../chattr):$(PATH)
 
-default:
+all: $(TEST)
+ext: $(EXT)
 
-include $(BUILDRULES)
+$(TEST):
+	@echo "*** $@ ***"; perl run $@
 
-install:
-install-dev install-lib:
+$(EXT):
+	@echo "EXT specific tests"; @echo "*** $@ ***"; perl run $@
+
+.PHONY: $(TEST) $(EXT) default
+.NOTPARALLEL:
Makefile +5 -1
Index: attr-2.4.43/Makefile
===================================================================
@@ -17,7 +17,7 @@ LDIRT = config.log .dep config.status co
 	Logs/* built .census install.* install-dev.* install-lib.* *.gz
 
 SUBDIRS = include libmisc libattr attr getfattr setfattr \
-	  examples test m4 man doc po debian build
+	  examples m4 man doc po debian build
 
 default: $(CONFIGURE)
 ifeq ($(HAVE_BUILDDEFS), no)
@@ -62,3 +62,7 @@ install-dev install-lib: default
 realclean distclean: clean
 	rm -f $(LDIRT) $(CONFIGURE)
 	rm -rf autom4te.cache Logs
+
+.PHONY: test
+test: default
+	$(MAKE) -C test/

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw

PATCH 4/4 attr: Tests for path recursion with -L -P -R

In reply to [email protected]

Add tests against patches from Andreas to fix up walk_tree.c.

---
 test/attr.test |  116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 116 insertions(+)
test/attr.test +116 -0
Index: attr-2.4.43/test/attr.test
===================================================================
@@ -253,3 +253,119 @@ Tests for attribute names that contains
 
 	$ cd ..
 	$ rm -rf d
+
+Tests for proper path recursion reported by Tony Ernst <[email protected]> bnc#457660
+
+	$ mkdir -p 1/2/3
+	$ setfattr -n "user.9" 1
+	$ setfattr -n "user.a" 1
+	$ setfattr -n "user.9" 1/2
+	$ setfattr -n "user.a" 1/2
+	$ setfattr -n "user.9" 1/2/3
+	$ setfattr -n "user.a" 1/2/3
+
+	$ getfattr -h -L -R -m '.' -e hex 1
+	> # file: 1
+	> user.9
+	> user.a
+	>
+	> # file: 1/2
+	> user.9
+	> user.a
+	>
+	> # file: 1/2/3
+	> user.9
+	> user.a
+	>
+
+	$ getfattr -h -P -R -m '.' -e hex 1/2
+	> # file: 1/2
+	> user.9
+	> user.a
+	>
+	> # file: 1/2/3
+	> user.9
+	> user.a
+	>
+
+	$ rm -R 1
+
+Test for proper recursion of directory structures with -L -P -R
+
+	$ mkdir -p 1/sub
+	$ mkdir 1/link
+	$ touch 1/link/link-file
+	$ touch 1/sub/sub-file
+	$ ln -s `pwd`/1/link 1/sub/link
+	$ setfattr -n "user.a" 1
+	$ setfattr -n "user.a" 1/link/link-file
+	$ setfattr -n "user.a" 1/link
+	$ setfattr -n "user.a" 1/sub/sub-file
+	$ setfattr -n "user.a" 1/sub
+	$ getfattr -P -R 1
+	> # file: 1
+	> user.a
+	>
+	> # file: 1/sub
+	> user.a
+	>
+	> # file: 1/sub/link
+	> user.a
+	>
+	> # file: 1/sub/sub-file
+	> user.a
+	>
+	> # file: 1/link
+	> user.a
+	>
+	> # file: 1/link/link-file
+	> user.a
+	>
+	$ getfattr -R -P 1/sub
+	> # file: 1/sub
+	> user.a
+	>
+	> # file: 1/sub/link
+	> user.a
+	>
+	> # file: 1/sub/sub-file
+	> user.a
+	>
+	$ getfattr -L -R 1
+	> # file: 1
+	> user.a
+	>
+	> # file: 1/sub
+	> user.a
+	>
+	> # file: 1/sub/link
+	> user.a
+	>
+	> # file: 1/sub/link/link-file
+	> user.a
+	>
+	> # file: 1/sub/sub-file
+	> user.a
+	>
+	> # file: 1/link
+	> user.a
+	>
+	> # file: 1/link/link-file
+	> user.a
+	>
+	$ getfattr -R 1/sub/link
+	> # file: 1/sub/link
+	> user.a
+	>
+	> # file: 1/sub/link/link-file
+	> user.a
+	>
+	$ getfattr -L -R 1/sub/link
+	> # file: 1/sub/link
+	> user.a
+	>
+	> # file: 1/sub/link/link-file
+	> user.a
+	>
+
+	$ rm -R 1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw
In reply to [email protected]
Quoted 4 lines · On Wed, Jan 07, 2009 at 06:19:47PM -0800, [email protected] wrote:

Hello-

NOTE: Timothy Shimmin's email ([email protected]) seems to be gone. Who should I send patches like this to in the future?

That's not quite sorted out. For now send them to Andreas Gruenbacher and the xfs list.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · On Wed, Jan 07, 2009 at 06:19:47PM -0800, [email protected] wrote:

Hello-

NOTE: Timothy Shimmin's email ([email protected]) seems to be gone. Who should I send patches like this to in the future?

That's not quite sorted out. For now send them to Andreas Gruenbacher and the xfs list.

Ok, thanks.

Andreas, please review these patches if you can:
http://oss.sgi.com/archives/xfs/2009-01/msg00136.html
http://oss.sgi.com/archives/xfs/2009-01/msg00146.html

Cheers,

Brandon

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#7 lore raw
Quoted 5 lines · Brandon Philips
Quoted 4 lines · Christoph Hellwig
Quoted 2 lines · On Wed, Jan 07, 2009 at 06:19:47PM -0800, [email protected] wrote:

NOTE: Timothy Shimmin's email ([email protected]) seems to be gone. Who should I send patches like this to in the future?

Quoted 8 lines
Quoted 2 lines

That's not quite sorted out. For now send them to Andreas Gruenbacher and the xfs list.

Ok, thanks.

Andreas, please review these patches if you can:
http://oss.sgi.com/archives/xfs/2009-01/msg00136.html
http://oss.sgi.com/archives/xfs/2009-01/msg00146.html

I noticed that Christoph put acl-dev.git and attr-dev.git on git.kernel.org. Great news! The process with CVS and TAKEs was a bit confusing.

But, can I suggest that we merge the attr-dev and acl-dev tree into one git repo and share libmisc? I have done it over here:

http://ifup.org/git/?p=acl-attr-dev.git;a=summary
git clone git://ifup.org/philips/acl-attr-dev.git

What do you think?

Also, my test/ patchset hasn't gotten any feedback. I will merge them into either {acl,attr}-dev.git or my acl-attr-dev.git if they seem acceptable and send you a pull request.

http://oss.sgi.com/pipermail/xfs/2009-January/039600.html
http://oss.sgi.com/pipermail/xfs/2009-January/039610.html

Cheers, Brandon

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw
Quoted 9 lines · On Saturday 07 February 2009 10:10:33 Brandon Philips wrote:
Quoted 8 lines · Brandon Philips
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · On Wed, Jan 07, 2009 at 06:19:47PM -0800, [email protected] wrote:

NOTE: Timothy Shimmin's email ([email protected]) seems to be gone. Who should I send patches like this to in the future?

That's not quite sorted out. For now send them to Andreas Gruenbacher and the xfs list.

Quoted 8 lines
Quoted 5 lines

Ok, thanks.

Andreas, please review these patches if you can:
http://oss.sgi.com/archives/xfs/2009-01/msg00136.html
http://oss.sgi.com/archives/xfs/2009-01/msg00146.html

I noticed that Christoph put acl-dev.git and attr-dev.git on git.kernel.org. Great news!

Yes, and the trees have nice histories as well, which is great.

Quoted 7 lines

But, can I suggest that we merge the attr-dev and acl-dev tree into one git repo and share libmisc? I have done it over here:

http://ifup.org/git/?p=acl-attr-dev.git;a=summary
git clone git://ifup.org/philips/acl-attr-dev.git

What do you think?

I believe it's a good start; we probably want to merge the trees eventually. The way how you have moved libmisc breaks the tarballs though; I have fixed it. Also, I was surprised that your repository has all the history rewritten instead of merging Christoph's trees, so I redid the merge.

http://www.kernel.org/pub/scm/linux/kernel/git/agruen/xattr-tools.git
git://git.kernel.org/pub/scm/linux/kernel/git/agruen/xattr-tools.git

Are you fine with this tree?

Quoted 6 lines

Also, my test/ patchset hasn't gotten any feedback. I will merge them into either {acl,attr}-dev.git or my acl-attr-dev.git if they seem acceptable and send you a pull request.

http://oss.sgi.com/pipermail/xfs/2009-January/039600.html
http://oss.sgi.com/pipermail/xfs/2009-January/039610.html

Sorry for being slow. I will first add the other acked distro patches, then look at your changes.

Andreas

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#9 lore raw
Quoted 4 lines · Andreas Grünbacher

On Saturday 07 February 2009 10:10:33 Brandon Philips wrote:
I believe it's a good start; we probably want to merge the trees eventually. The way how you have moved libmisc breaks the tarballs though; I have fixed it.

Thanks. But, what do you mean by break the tarballs?

Quoted 2 lines

Also, I was surprised that your repository has all the history rewritten instead of merging Christoph's trees, so I redid the merge.

I used git-stitch-repo[1] to rewrite the history as if they had been in the same tree. This has the advantage that you can go:
git log acl/setfacl/setfacl.c

and have the whole history. Either way is fine with me though.

[1] http://ifup.org/2009/02/07/the-right-tool-for-the-job-git-stitch-repo

Quoted 4 lines

http://www.kernel.org/pub/scm/linux/kernel/git/agruen/xattr-tools.git
git://git.kernel.org/pub/scm/linux/kernel/git/agruen/xattr-tools.git

Are you fine with this tree?

They look good to me.

Quoted 2 lines

Sorry for being slow. I will first add the other acked distro patches, then look at your changes.

Great. Can we set a precedent that as patches get merged an email gets sent to [email protected] still? If not I will just rss2email the git tree.

Thanks,

Brandon

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#10 lore raw
Quoted 7 lines · On Monday, 9 February 2009 0:38:37 Brandon Philips wrote:
Quoted 4 lines · Andreas Grünbacher

On Saturday 07 February 2009 10:10:33 Brandon Philips wrote:
I believe it's a good start; we probably want to merge the trees eventually. The way how you have moved libmisc breaks the tarballs though; I have fixed it.

Thanks. But, what do you mean by break the tarballs?

Here's what I got after ./Makepkgs:

	$ tar tfz build/attr-2.4.43.src.tar.gz
	attr-2.4.43/...
	libmisc/...
	attr-2.4.43/...
Quoted 6 lines
Quoted 2 lines

Sorry for being slow. I will first add the other acked distro patches, then look at your changes.

Great. Can we set a precedent that as patches get merged an email gets sent to [email protected] still? If not I will just rss2email the git tree.

I haven't managed to set that up, yet.

Andreas

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#11 lore raw
In reply to Andreas Gruenbacher
Quoted 10 lines · Andreas Gruenbacher
Quoted 5 lines

http://ifup.org/git/?p=acl-attr-dev.git;a=summary
git clone git://ifup.org/philips/acl-attr-dev.git

What do you think?

I believe it's a good start; we probably want to merge the trees eventually. The way how you have moved libmisc breaks the tarballs though; I have fixed it. Also, I was surprised that your repository has all the history rewritten instead of merging Christoph's trees, so I redid the merge.

I think the merge is a bad idea. attr and acl serve quite different purposes and have been different source and binary packages in distros forever. I'd rather keep it as it was for now and maybe find some way libacl could pick up libmisc from libattr.

There's a reason we split up xfs-cmds into more manageable repositories.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#13 lore raw

merging acl-dev and attr-dev [was: Re: [patch 0/4] attr: test/ improvements and integrate with make]

In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines · Andreas Gruenbacher
Quoted 5 lines

http://ifup.org/git/?p=acl-attr-dev.git;a=summary
git clone git://ifup.org/philips/acl-attr-dev.git

What do you think?

Quoted 8 lines
Quoted 4 lines

I believe it's a good start; we probably want to merge the trees eventually. The way how you have moved libmisc breaks the tarballs though; I have fixed it. Also, I was surprised that your repository has all the history rewritten instead of merging Christoph's trees, so I redid the merge.

I think the merge is a bad idea. attr and acl serve quite different purposes and have been different source and binary packages in distros forever.

They can remain different binary packages after merging the source code repos to share libmisc.

Quoted 5 lines

I'd rather keep it as it was for now and maybe find some way libacl could pick up libmisc from libattr.

There's a reason we split up xfs-cmds into more manageable repositories.

What was the reason for splitting these two packages from each other?

Quoted 1 line

From looking at the shortlogs it looks like a lot of the bug fixes are

made against attr then copied over to acl:

http://ifup.org/git/?p=acl-attr-dev.git;a=shortlog

Quoted 2 lines

I'd rather keep it as it was for now and maybe find some way libacl could pick up libmisc from libattr.

Perhaps. Although, it doesn't seem right making walk_tree or the quoting code available to applications through libacl.

Cheers,

Brandon

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#14 lore raw

Re: merging acl-dev and attr-dev [was: Re: [patch 0/4] attr: test/ improvements and integrate with make]

Quoted 4 lines · Brandon Philips
Quoted 2 lines

There's a reason we split up xfs-cmds into more manageable repositories.

What was the reason for splitting these two packages from each other?

That they are not related to each other.

Quoted 4 lines
Quoted 1 line

From looking at the shortlogs it looks like a lot of the bug fixes are

made against attr then copied over to acl:

http://ifup.org/git/?p=acl-attr-dev.git;a=shortlog

The only copies bugfixes are the nasty buildsystem which I think Andreas wants to get rid of mid-term and libmisc.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs