* Re: [udev] udev-test.pl - automatic testing script
2003-11-23 3:54 [udev] udev-test.pl - automatic testing script Kay Sievers
@ 2003-11-23 5:49 ` Greg KH
2003-11-24 1:33 ` Kay Sievers
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2003-11-23 5:49 UTC (permalink / raw)
To: linux-hotplug
On Sun, Nov 23, 2003 at 04:54:09AM +0100, Kay Sievers wrote:
> On Sat, Nov 22, 2003 at 03:41:10PM +0100, Kay Sievers wrote:
> > here is a automatic udev test script. To test place it in the test/
> > directory of the current tree to find the sysfs tree copy and run it.
> >
> > The whole test is self contained, it only needs a matching sysfs tree.
> > To extend the test add a hash to the @tests array inside the script.
> > The script checks the created node and prints a summary of all tests.
> >
> > Please don't change $udev_root to something useful, its a temorary
> > directory and will be removed after the test run.
>
> Here is a slightly better version that runs 'tree' on error
> and prints a description for every test.
Sweet, this blows away my mess of shell scripts. I've added this script
to the test/ directory, thanks a lot for this.
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [udev] udev-test.pl - automatic testing script
2003-11-23 3:54 [udev] udev-test.pl - automatic testing script Kay Sievers
2003-11-23 5:49 ` Greg KH
@ 2003-11-24 1:33 ` Kay Sievers
2003-11-24 1:39 ` Greg KH
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2003-11-24 1:33 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]
On Sat, Nov 22, 2003 at 09:49:18PM -0800, Greg KH wrote:
> On Sun, Nov 23, 2003 at 04:54:09AM +0100, Kay Sievers wrote:
> > On Sat, Nov 22, 2003 at 03:41:10PM +0100, Kay Sievers wrote:
> > > here is a automatic udev test script. To test place it in the test/
> > > directory of the current tree to find the sysfs tree copy and run it.
> > >
> > > The whole test is self contained, it only needs a matching sysfs tree.
> > > To extend the test add a hash to the @tests array inside the script.
> > > The script checks the created node and prints a summary of all tests.
> > >
> > > Please don't change $udev_root to something useful, its a temorary
> > > directory and will be removed after the test run.
> >
> > Here is a slightly better version that runs 'tree' on error
> > and prints a description for every test.
>
> Sweet, this blows away my mess of shell scripts. I've added this script
> to the test/ directory, thanks a lot for this.
We don't want to test the "remove" if "add" fails.
thanks,
Kay
[-- Attachment #2: 14-udev-test.pl-dont-test-remove-on-error.diff --]
[-- Type: text/plain, Size: 300 bytes --]
--- ../../udev/test/udev-test.pl 2003-11-24 01:23:25.000000000 +0100
+++ udev-test.pl 2003-11-24 02:17:01.000000000 +0100
@@ -151,7 +151,7 @@
system("tree $udev_root");
print "\n";
$error++;
-# next;
+ next;
}
udev("remove", $config->{subsys}, $config->{devpath}, \$config->{conf});
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [udev] udev-test.pl - automatic testing script
2003-11-23 3:54 [udev] udev-test.pl - automatic testing script Kay Sievers
2003-11-23 5:49 ` Greg KH
2003-11-24 1:33 ` Kay Sievers
@ 2003-11-24 1:39 ` Greg KH
2003-11-24 3:04 ` Kay Sievers
2003-11-24 5:45 ` Greg KH
4 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2003-11-24 1:39 UTC (permalink / raw)
To: linux-hotplug
On Mon, Nov 24, 2003 at 02:33:42AM +0100, Kay Sievers wrote:
> On Sat, Nov 22, 2003 at 09:49:18PM -0800, Greg KH wrote:
> > On Sun, Nov 23, 2003 at 04:54:09AM +0100, Kay Sievers wrote:
> > > On Sat, Nov 22, 2003 at 03:41:10PM +0100, Kay Sievers wrote:
> > > > here is a automatic udev test script. To test place it in the test/
> > > > directory of the current tree to find the sysfs tree copy and run it.
> > > >
> > > > The whole test is self contained, it only needs a matching sysfs tree.
> > > > To extend the test add a hash to the @tests array inside the script.
> > > > The script checks the created node and prints a summary of all tests.
> > > >
> > > > Please don't change $udev_root to something useful, its a temorary
> > > > directory and will be removed after the test run.
> > >
> > > Here is a slightly better version that runs 'tree' on error
> > > and prints a description for every test.
> >
> > Sweet, this blows away my mess of shell scripts. I've added this script
> > to the test/ directory, thanks a lot for this.
>
> We don't want to test the "remove" if "add" fails.
Why not? We should remove the same device, right? That way we end up
with a clean directory :)
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [udev] udev-test.pl - automatic testing script
2003-11-23 3:54 [udev] udev-test.pl - automatic testing script Kay Sievers
` (2 preceding siblings ...)
2003-11-24 1:39 ` Greg KH
@ 2003-11-24 3:04 ` Kay Sievers
2003-11-24 5:45 ` Greg KH
4 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2003-11-24 3:04 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]
On Sun, Nov 23, 2003 at 05:39:23PM -0800, Greg KH wrote:
> On Mon, Nov 24, 2003 at 02:33:42AM +0100, Kay Sievers wrote:
> > On Sat, Nov 22, 2003 at 09:49:18PM -0800, Greg KH wrote:
> > > On Sun, Nov 23, 2003 at 04:54:09AM +0100, Kay Sievers wrote:
> > > > On Sat, Nov 22, 2003 at 03:41:10PM +0100, Kay Sievers wrote:
> > > > > here is a automatic udev test script. To test place it in the test/
> > > > > directory of the current tree to find the sysfs tree copy and run it.
> > > > >
> > > > > The whole test is self contained, it only needs a matching sysfs tree.
> > > > > To extend the test add a hash to the @tests array inside the script.
> > > > > The script checks the created node and prints a summary of all tests.
> > > > >
> > > > > Please don't change $udev_root to something useful, its a temorary
> > > > > directory and will be removed after the test run.
> > > >
> > > > Here is a slightly better version that runs 'tree' on error
> > > > and prints a description for every test.
> > >
> > > Sweet, this blows away my mess of shell scripts. I've added this script
> > > to the test/ directory, thanks a lot for this.
> >
> > We don't want to test the "remove" if "add" fails.
>
> Why not? We should remove the same device, right? That way we end up
> with a clean directory :)
Yes, you are right. If we have two errors we don't want to list
at the second error the node from the first.
But I found two missing characters and optimized $PWD.
You see my queue is empty now :)
thanks,
Kay
[-- Attachment #2: 14-udev-test.pl-i-have-nothing-better-to-do.diff --]
[-- Type: text/plain, Size: 993 bytes --]
--- ../../udev/test/udev-test.pl 2003-11-24 01:23:25.000000000 +0100
+++ udev-test.pl 2003-11-24 03:46:19.000000000 +0100
@@ -21,9 +21,7 @@
use warnings;
use strict;
-my $PWD = `pwd`;
-chomp($PWD);
-
+my $PWD = $ENV{PWD};
my $sysfs = "sys/";
my $udev_bin = "../udev";
my $udev_root = "udev-root/"; # !!! directory will be removed !!!
@@ -80,7 +78,7 @@
EOF
},
{
- desc => "callout result subtitution, only last should match",
+ desc => "callout result substitution, only last should match",
subsys => "block",
devpath => "block/sda/sda3",
expected => "special-device-3" ,
@@ -93,7 +91,7 @@
EOF
},
{
- desc => "callout program subtitution",
+ desc => "callout program substitution",
subsys => "block",
devpath => "block/sda/sda3",
expected => "test-0:0:0:0" ,
@@ -151,7 +149,6 @@
system("tree $udev_root");
print "\n";
$error++;
-# next;
}
udev("remove", $config->{subsys}, $config->{devpath}, \$config->{conf});
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [udev] udev-test.pl - automatic testing script
2003-11-23 3:54 [udev] udev-test.pl - automatic testing script Kay Sievers
` (3 preceding siblings ...)
2003-11-24 3:04 ` Kay Sievers
@ 2003-11-24 5:45 ` Greg KH
4 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2003-11-24 5:45 UTC (permalink / raw)
To: linux-hotplug
On Mon, Nov 24, 2003 at 04:04:05AM +0100, Kay Sievers wrote:
>
> But I found two missing characters and optimized $PWD.
> You see my queue is empty now :)
Thanks, I've applied this.
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 7+ messages in thread