chiark / gitweb /
[PATCH] udev add some ID tests
authorpatmans@us.ibm.com <patmans@us.ibm.com>
Tue, 17 Feb 2004 06:00:38 +0000 (22:00 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:32:28 +0000 (21:32 -0700)
Patch against current udev bk to add a few ID rule tests.

test/udev-test.pl

index 258d5c9..7459f8f 100644 (file)
@@ -386,6 +386,52 @@ EOF
 KERNEL="ttyUSB0", NAME="visor"
 EOF
        },
+       {
+               desc     => "ID rule",
+               subsys   => "block",
+               devpath  => "block/sda",
+               expected => "scsi-0:0:0:0",
+               conf     => <<EOF
+BUS="usb", ID="0:0:0:0", NAME="not-scsi"
+BUS="scsi", ID="0:0:0:1", NAME="no-match"
+BUS="scsi", ID=":0", NAME="short-id"
+BUS="scsi", ID="/0:0:0:0", NAME="no-match"
+BUS="scsi", ID="0:0:0:0", NAME="scsi-0:0:0:0"
+EOF
+       },
+       {
+               desc     => "ID wildcard all",
+               subsys   => "block",
+               devpath  => "block/sda",
+               expected => "scsi-0:0:0:0",
+               conf     => <<EOF
+BUS="scsi", ID="*:1", NAME="no-match"
+BUS="scsi", ID="*:0:1", NAME="no-match"
+BUS="scsi", ID="*:0:0:1", NAME="no-match"
+BUS="scsi", ID="*", NAME="scsi-0:0:0:0"
+BUS="scsi", ID="0:0:0:0", NAME="bad"
+EOF
+       },
+       {
+               desc     => "ID wildcard partial",
+               subsys   => "block",
+               devpath  => "block/sda",
+               expected => "scsi-0:0:0:0",
+               conf     => <<EOF
+BUS="scsi", ID="*:0", NAME="scsi-0:0:0:0"
+BUS="scsi", ID="0:0:0:0", NAME="bad"
+EOF
+       },
+       {
+               desc     => "ID wildcard partial 2",
+               subsys   => "block",
+               devpath  => "block/sda",
+               expected => "scsi-0:0:0:0",
+               conf     => <<EOF
+BUS="scsi", ID="*:0:0:0", NAME="scsi-0:0:0:0"
+BUS="scsi", ID="0:0:0:0", NAME="bad"
+EOF
+       },
 );
 
 # set env