bd1529
From 3f90eeef6a8469de6ad490efb62a5be80188f41f Mon Sep 17 00:00:00 2001
bd1529
From: Martin Wilck <mwilck@suse.com>
bd1529
Date: Fri, 20 Apr 2018 22:38:30 +0200
bd1529
Subject: [PATCH] test/udev-test.pl: allow multiple devices per test
bd1529
bd1529
Allow testing cases where multiple devices are added and removed.
bd1529
This implies a change of the data structure: every test allows
bd1529
for multiple devices to be added, and "exp_name" etc. are now properties
bd1529
of the device, not of the test.
bd1529
bd1529
(cherry picked from commit 255c05b72455dcad1b5552d12a813b31f68201a7)
bd1529
bd1529
Related: #1642728
bd1529
---
bd1529
 test/udev-test.pl | 1352 +++++++++++++++++++++++++++++++--------------
bd1529
 1 file changed, 929 insertions(+), 423 deletions(-)
bd1529
bd1529
diff --git a/test/udev-test.pl b/test/udev-test.pl
bd1529
index a4deffacb9..bd5401da75 100755
bd1529
--- a/test/udev-test.pl
bd1529
+++ b/test/udev-test.pl
bd1529
@@ -48,17 +48,28 @@ $rules_10k_tags_continuation .= "TAG+=\"test10000\"\\n";
bd1529
 my @tests = (
bd1529
         {
bd1529
                 desc            => "no rules",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "sda",
bd1529
-                exp_rem_error   => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "sda" ,
bd1529
+                                exp_rem_error   => "yes",
bd1529
+                        },
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "sda1" ,
bd1529
+                                exp_rem_error   => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 #
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of scsi disc",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "boot_disk",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "boot_disk" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", SYMLINK+="boot_disk%n"
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -66,8 +77,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of scsi disc",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "boot_disk",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "boot_disk" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", SYMLINK+="boot_disk%n"
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -75,8 +89,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of scsi disc",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "boot_disk",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "boot_disk" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", SYMLINK+="boot_disk%n"
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -84,16 +101,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of scsi partition",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "boot_disk1",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "boot_disk1" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", SYMLINK+="boot_disk%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of pattern match",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "boot_disk1",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "boot_disk1" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="?ATA", SYMLINK+="boot_disk%n-1"
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA?", SYMLINK+="boot_disk%n-2"
bd1529
@@ -103,8 +126,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of multiple sysfs files",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "boot_disk1",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "boot_disk1" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", ATTRS{model}=="ST910021AS X ", SYMLINK+="boot_diskX%n"
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", ATTRS{model}=="ST910021AS", SYMLINK+="boot_disk%n"
bd1529
@@ -112,8 +138,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "label test of max sysfs files (skip invalid rule)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "boot_disk1",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "boot_disk1" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", ATTRS{model}=="ST910021AS", ATTRS{scsi_level}=="6", ATTRS{rev}=="4.06", ATTRS{type}=="0", ATTRS{queue_depth}=="32", SYMLINK+="boot_diskXX%n"
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", ATTRS{model}=="ST910021AS", ATTRS{scsi_level}=="6", ATTRS{rev}=="4.06", ATTRS{type}=="0", SYMLINK+="boot_disk%n"
bd1529
@@ -121,16 +150,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "catch device by *",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem/0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem/0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM*", SYMLINK+="modem/%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "catch device by * - take 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem/0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem/0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="*ACM1", SYMLINK+="bad"
bd1529
 KERNEL=="*ACM0", SYMLINK+="modem/%n"
bd1529
@@ -138,8 +173,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "catch device by ?",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem/0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem/0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM??*", SYMLINK+="modem/%n-1"
bd1529
 KERNEL=="ttyACM??", SYMLINK+="modem/%n-2"
bd1529
@@ -148,8 +186,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "catch device by character class",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem/0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem/0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[A-Z]*", SYMLINK+="modem/%n-1"
bd1529
 KERNEL=="ttyACM?[0-9]", SYMLINK+="modem/%n-2"
bd1529
@@ -158,16 +199,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "replace kernel name",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "Handle comment lines in config file (and replace kernel name)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 # this is a comment
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -176,8 +223,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "Handle comment lines in config file with whitespace (and replace kernel name)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
  # this is a comment with whitespace before the comment
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -186,8 +236,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "Handle whitespace only lines (and replace kernel name)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "whitespace",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "whitespace" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 
bd1529
 
bd1529
@@ -201,8 +254,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "Handle empty lines in config file (and replace kernel name)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -211,8 +267,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "Handle backslashed multi lines in config file (and replace kernel name)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM0", \\
bd1529
 SYMLINK+="modem"
bd1529
@@ -221,16 +280,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "preserve backslashes, if they are not for a newline",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "aaa",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "aaa",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM0", PROGRAM=="/bin/echo -e \\101", RESULT=="A", SYMLINK+="aaa"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "Handle stupid backslashed multi lines in config file (and replace kernel name)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 
bd1529
 #
bd1529
@@ -247,41 +312,56 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "subdirectory handling",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "sub/direct/ory/modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "sub/direct/ory/modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM0", SYMLINK+="sub/direct/ory/modem"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "parent device name match of scsi partition",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "first_disk5",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "first_disk5" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", SYMLINK+="first_disk%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test substitution chars",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "Major:8:minor:5:kernelnumber:5:id:0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "Major:8:minor:5:kernelnumber:5:id:0:0:0:0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", SYMLINK+="Major:%M:minor:%m:kernelnumber:%n:id:%b"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "import of shell-value returned from program",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node12345678",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node12345678",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", IMPORT{program}="/bin/echo -e \' TEST_KEY=12345678\\n  TEST_key2=98765\'", SYMLINK+="node\$env{TEST_KEY}"
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
-                desc            => "sustitution of sysfs value (%s{file})",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "disk-ATA-sda",
bd1529
+                desc            => "substitution of sysfs value (%s{file})",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "disk-ATA-sda" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", SYMLINK+="disk-%s{vendor}-%k"
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
@@ -289,9 +369,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program result substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "special-device-5",
bd1529
-                not_exp_name    => "not",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "special-device-5" ,
bd1529
+                                not_exp_name    => "not" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n special-device", RESULT=="-special-*", SYMLINK+="not"
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n special-device", RESULT=="special-*", SYMLINK+="%c-%n"
bd1529
@@ -299,128 +382,176 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program result substitution (newline removal)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "newline_removed",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "newline_removed" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo test", RESULT=="test", SYMLINK+="newline_removed"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program result substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "test-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "test-0:0:0:0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n test-%b", RESULT=="test-0:0*", SYMLINK+="%c"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program with lots of arguments",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "foo9",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "foo9" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="%c{7}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program with subshell",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "bar9",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "bar9" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed  s/foo9/bar9/'", KERNEL=="sda5", SYMLINK+="%c{7}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program arguments combined with apostrophes",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "foo7",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "foo7" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n 'foo3 foo4'   'foo5   foo6   foo7 foo8'", KERNEL=="sda5", SYMLINK+="%c{5}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program arguments combined with escaped double quotes, part 1",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "foo2",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "foo2" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'printf %%s \\\"foo1 foo2\\\" | grep \\\"foo1 foo2\\\"'", KERNEL=="sda5", SYMLINK+="%c{2}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program arguments combined with escaped double quotes, part 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "foo2",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "foo2" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c \\\"printf %%s 'foo1 foo2' | grep 'foo1 foo2'\\\"", KERNEL=="sda5", SYMLINK+="%c{2}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program arguments combined with escaped double quotes, part 3",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "foo2",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "foo2" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'printf \\\"%%s %%s\\\" \\\"foo1 foo2\\\" \\\"foo3\\\"| grep \\\"foo1 foo2\\\"'", KERNEL=="sda5", SYMLINK+="%c{2}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "characters before the %c{N} substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "my-foo9",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "my-foo9" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="my-%c{7}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "substitute the second to last argument",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "my-foo8",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "my-foo8" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL=="sda5", SYMLINK+="my-%c{6}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test substitution by variable name",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "Major:8-minor:5-kernelnumber:5-id:0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "Major:8-minor:5-kernelnumber:5-id:0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", SYMLINK+="Major:\$major-minor:\$minor-kernelnumber:\$number-id:\$id"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test substitution by variable name 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "Major:8-minor:5-kernelnumber:5-id:0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "Major:8-minor:5-kernelnumber:5-id:0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", DEVPATH=="*/sda/*", SYMLINK+="Major:\$major-minor:%m-kernelnumber:\$number-id:\$id"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test substitution by variable name 3",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "850:0:0:05",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "850:0:0:05" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", DEVPATH=="*/sda/*", SYMLINK+="%M%m%b%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test substitution by variable name 4",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "855",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "855" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", DEVPATH=="*/sda/*", SYMLINK+="\$major\$minor\$number"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test substitution by variable name 5",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "8550:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "8550:0:0:0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", DEVPATH=="*/sda/*", SYMLINK+="\$major%m%n\$id"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "non matching SUBSYSTEMS for device with no parent",
bd1529
-                devpath         => "/devices/virtual/tty/console",
bd1529
-                exp_name        => "TTY",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/tty/console",
bd1529
+                                exp_name        => "TTY",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n foo", RESULT=="foo", SYMLINK+="foo"
bd1529
 KERNEL=="console", SYMLINK+="TTY"
bd1529
@@ -428,8 +559,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "non matching SUBSYSTEMS",
bd1529
-                devpath         => "/devices/virtual/tty/console",
bd1529
-                exp_name        => "TTY",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/tty/console",
bd1529
+                                exp_name        => "TTY" ,
bd1529
+                        }],
bd1529
                 rules                => <
bd1529
 SUBSYSTEMS=="foo", ATTRS{dev}=="5:1", SYMLINK+="foo"
bd1529
 KERNEL=="console", SYMLINK+="TTY"
bd1529
@@ -437,8 +571,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ATTRS match",
bd1529
-                devpath         => "/devices/virtual/tty/console",
bd1529
-                exp_name        => "foo",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/tty/console",
bd1529
+                                exp_name        => "foo" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="console", SYMLINK+="TTY"
bd1529
 ATTRS{dev}=="5:1", SYMLINK+="foo"
bd1529
@@ -446,8 +583,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ATTR (empty file)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "empty",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "empty" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", ATTR{test_empty_file}=="?*", SYMLINK+="something"
bd1529
 KERNEL=="sda", ATTR{test_empty_file}!="", SYMLINK+="not-empty"
bd1529
@@ -457,8 +597,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ATTR (non-existent file)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "non-existent",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "non-existent" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", ATTR{nofile}=="?*", SYMLINK+="something"
bd1529
 KERNEL=="sda", ATTR{nofile}!="", SYMLINK+="not-empty"
bd1529
@@ -470,8 +613,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program and bus type match",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "scsi-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "scsi-0:0:0:0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="usb", PROGRAM=="/bin/echo -n usb-%b", SYMLINK+="%c"
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n scsi-%b", SYMLINK+="%c"
bd1529
@@ -480,16 +626,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "sysfs parent hierarchy",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ATTRS{idProduct}=="007b", SYMLINK+="modem"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "name test with ! in the name",
bd1529
-                devpath         => "/devices/virtual/block/fake!blockdev0",
bd1529
-                exp_name        => "is/a/fake/blockdev0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/block/fake!blockdev0",
bd1529
+                                exp_name        => "is/a/fake/blockdev0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", SYMLINK+="is/not/a/%k"
bd1529
 SUBSYSTEM=="block", SYMLINK+="is/a/%k"
bd1529
@@ -498,17 +650,23 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "name test with ! in the name, but no matching rule",
bd1529
-                devpath         => "/devices/virtual/block/fake!blockdev0",
bd1529
-                exp_name        => "fake/blockdev0",
bd1529
-                exp_rem_error   => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/block/fake!blockdev0",
bd1529
+                                exp_name        => "fake/blockdev0" ,
bd1529
+                                exp_rem_error   => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM0", SYMLINK+="modem"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "KERNELS rule",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "scsi-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "scsi-0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="usb", KERNELS=="0:0:0:0", SYMLINK+="not-scsi"
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:1", SYMLINK+="no-match"
bd1529
@@ -519,8 +677,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "KERNELS wildcard all",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "scsi-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "scsi-0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="*:1", SYMLINK+="no-match"
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="*:0:1", SYMLINK+="no-match"
bd1529
@@ -531,8 +692,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "KERNELS wildcard partial",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "scsi-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "scsi-0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", SYMLINK+="before"
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="*:0", SYMLINK+="scsi-0:0:0:0"
bd1529
@@ -540,41 +704,56 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "KERNELS wildcard partial 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "scsi-0:0:0:0",
bd1529
-                rules           => <
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "scsi-0:0:0:0",
bd1529
+                        }],
bd1529
+                rules                => <
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", SYMLINK+="before"
bd1529
 SUBSYSTEMS=="scsi", KERNELS=="*:0:0:0", SYMLINK+="scsi-0:0:0:0"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "substitute attr with link target value (first match)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "driver-is-sd",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "driver-is-sd",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", SYMLINK+="driver-is-\$attr{driver}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "substitute attr with link target value (currently selected device)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "driver-is-ahci",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "driver-is-ahci",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="pci", SYMLINK+="driver-is-\$attr{driver}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ignore ATTRS attribute whitespace",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "ignored",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "ignored",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{whitespace_test}=="WHITE  SPACE", SYMLINK+="ignored"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "do not ignore ATTRS attribute whitespace",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "matched-with-space",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "matched-with-space",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{whitespace_test}=="WHITE  SPACE ", SYMLINK+="wrong-to-ignore"
bd1529
 SUBSYSTEMS=="scsi", ATTRS{whitespace_test}=="WHITE  SPACE   ", SYMLINK+="matched-with-space"
bd1529
@@ -582,117 +761,156 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions USER=bad GROUP=name",
bd1529
-                devpath         => "/devices/virtual/tty/tty33",
bd1529
-                exp_name        => "tty33",
bd1529
-                exp_perms       => "0:0:0600",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/tty/tty33",
bd1529
+                                exp_name        => "tty33",
bd1529
+                                exp_perms       => "0:0:0600",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="tty33", OWNER="bad", GROUP="name"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions OWNER=1",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => "1::0600",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => "1::0600",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="1"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions GROUP=1",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => ":1:0660",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => ":1:0660",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", GROUP="1"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "textual user id",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => "daemon::0600",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => "daemon::0600",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="daemon"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "textual group id",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => ":daemon:0660",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => ":daemon:0660",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", GROUP="daemon"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "textual user/group id",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => "root:audio:0660",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => "root:audio:0660",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="root", GROUP="audio"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions MODE=0777",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => "::0777",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => "::0777",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", MODE="0777"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions OWNER=1 GROUP=1 MODE=0777",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_perms       => "1:1:0777",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_perms       => "1:1:0777",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="1", GROUP="1", MODE="0777"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions OWNER to 1",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => "1::",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => "1::",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="1"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions GROUP to 1",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => ":1:0660",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => ":1:0660",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="1"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions MODE to 0060",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => "::0060",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => "::0060",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", MODE="0060"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions OWNER, GROUP, MODE",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => "1:1:0777",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => "1:1:0777",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="1", GROUP="1", MODE="0777"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions only rule",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => "1:1:0777",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => "1:1:0777",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", OWNER="1", GROUP="1", MODE="0777"
bd1529
 KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
bd1529
@@ -701,9 +919,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "multiple permissions only rule",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => "1:1:0777",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => "1:1:0777",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEM=="tty", OWNER="1"
bd1529
 SUBSYSTEM=="tty", GROUP="1"
bd1529
@@ -714,9 +935,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "permissions only rule with override at SYMLINK+ rule",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "ttyACM0",
bd1529
-                exp_perms       => "1:2:0777",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "ttyACM0",
bd1529
+                                exp_perms       => "1:2:0777",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEM=="tty", OWNER="1"
bd1529
 SUBSYSTEM=="tty", GROUP="1"
bd1529
@@ -727,53 +951,71 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "major/minor number test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
-                exp_majorminor  => "8:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_majorminor  => "8:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "big major number test",
bd1529
-                devpath         => "/devices/virtual/misc/misc-fake1",
bd1529
-                exp_name        => "node",
bd1529
-                exp_majorminor  => "4095:1",
bd1529
-                rules           => <
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/misc/misc-fake1",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_majorminor  => "4095:1",
bd1529
+                        }],
bd1529
+                rules                => <
bd1529
 KERNEL=="misc-fake1", SYMLINK+="node"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "big major and big minor number test",
bd1529
-                devpath         => "/devices/virtual/misc/misc-fake89999",
bd1529
-                exp_name        => "node",
bd1529
-                exp_majorminor  => "4095:89999",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/misc/misc-fake89999",
bd1529
+                                exp_name        => "node",
bd1529
+                                exp_majorminor  => "4095:89999",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="misc-fake89999", SYMLINK+="node"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "multiple symlinks with format char",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "symlink2-ttyACM0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "symlink2-ttyACM0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK="symlink1-%n symlink2-%k symlink3-%b"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "multiple symlinks with a lot of s p a c e s",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "one",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "one",
bd1529
+                                not_exp_name        => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK="  one     two        "
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with spaces in substituted variable",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "name-one_two_three-end",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "name-one_two_three-end",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="one two three"
bd1529
 SYMLINK="name-\$env{WITH_WS}-end"
bd1529
@@ -781,9 +1023,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with leading space in substituted variable",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "name-one_two_three-end",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "name-one_two_three-end",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="   one two three"
bd1529
 SYMLINK="name-\$env{WITH_WS}-end"
bd1529
@@ -791,9 +1036,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with trailing space in substituted variable",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "name-one_two_three-end",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "name-one_two_three-end",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="one two three   "
bd1529
 SYMLINK="name-\$env{WITH_WS}-end"
bd1529
@@ -801,9 +1049,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with lots of space in substituted variable",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "name-one_two_three-end",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "name-one_two_three-end",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="   one two three   "
bd1529
 SYMLINK="name-\$env{WITH_WS}-end"
bd1529
@@ -811,9 +1062,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with multiple spaces in substituted variable",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "name-one_two_three-end",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "name-one_two_three-end",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="   one  two  three   "
bd1529
 SYMLINK="name-\$env{WITH_WS}-end"
bd1529
@@ -821,9 +1075,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with space and var with space, part 1",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "first",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "first",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="   one  two  three   "
bd1529
 SYMLINK="  first  name-\$env{WITH_WS}-end another_symlink a b c "
bd1529
@@ -831,9 +1088,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with space and var with space, part 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "name-one_two_three-end",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "name-one_two_three-end",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="   one  two  three   "
bd1529
 SYMLINK="  first  name-\$env{WITH_WS}-end another_symlink a b c "
bd1529
@@ -841,9 +1101,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink with space and var with space, part 3",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "another_symlink",
bd1529
-                not_exp_name    => " ",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "another_symlink",
bd1529
+                                not_exp_name    => " ",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{WITH_WS}="   one  two  three   "
bd1529
 SYMLINK="  first  name-\$env{WITH_WS}-end another_symlink a b c "
bd1529
@@ -851,133 +1114,181 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink creation (same directory)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "modem0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "modem0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", SYMLINK="modem%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "multiple symlinks",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "second-0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "second-0" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM0", SYMLINK="first-%n second-%n third-%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink name '.'",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => ".",
bd1529
-                exp_add_error   => "yes",
bd1529
-                exp_rem_error   => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => ".",
bd1529
+                                exp_add_error        => "yes",
bd1529
+                                exp_rem_error        => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="."
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink node to itself",
bd1529
-                devpath         => "/devices/virtual/tty/tty0",
bd1529
-                exp_name        => "link",
bd1529
-                exp_add_error   => "yes",
bd1529
-                exp_rem_error   => "yes",
bd1529
-                option          => "clean",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/virtual/tty/tty0",
bd1529
+                                exp_name        => "link",
bd1529
+                                exp_add_error        => "yes",
bd1529
+                                exp_rem_error        => "yes",
bd1529
+                        }],
bd1529
+                option                => "clean",
bd1529
                 rules           => <
bd1529
 KERNEL=="tty0", SYMLINK+="tty0"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %n substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "symlink0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "symlink0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", SYMLINK+="symlink%n"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %k substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "symlink-ttyACM0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "symlink-ttyACM0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", SYMLINK+="symlink-%k"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %M:%m substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "major-166:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "major-166:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", SYMLINK+="major-%M:%m"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %b substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "symlink-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "symlink-0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="symlink-%b"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %c substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "test",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "test",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", PROGRAM=="/bin/echo test", SYMLINK+="%c"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %c{N} substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "test",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "test",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", PROGRAM=="/bin/echo symlink test this", SYMLINK+="%c{2}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %c{N+} substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "this",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "this",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", PROGRAM=="/bin/echo symlink test this", SYMLINK+="%c{2+}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink only rule with %c{N+}",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "test",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "test",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", PROGRAM=="/bin/echo link test this" SYMLINK+="%c{2+}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "symlink %s{filename} substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "166:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "166:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="%s{dev}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program result substitution (numbered part of)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "link1",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "link1",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2", RESULT=="node *", SYMLINK+="%c{2} %c{3}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "program result substitution (numbered part of+)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
-                exp_name        => "link4",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
bd1529
+                                exp_name        => "link4",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2 link3 link4", RESULT=="node *", SYMLINK+="%c{2+}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "SUBSYSTEM match test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="should_not_match", SUBSYSTEM=="vc"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", SUBSYSTEM=="block"
bd1529
@@ -986,8 +1297,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "DRIVERS match test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="should_not_match", DRIVERS=="sd-wrong"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", DRIVERS=="sd"
bd1529
@@ -995,32 +1309,44 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "devnode substitution test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda", PROGRAM=="/usr/bin/test -b %N" SYMLINK+="node"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "parent node name substitution test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "sda-part-1",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "sda-part-1",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="%P-part-1"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "udev_root substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "start-/dev-end",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "start-/dev-end",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="start-%r-end"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "last_rule option",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "last",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "last",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="last", OPTIONS="last_rule"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="very-last"
bd1529
@@ -1028,8 +1354,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "negation KERNEL!=",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "match",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "match",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL!="sda1", SYMLINK+="matches-but-is-negated"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="before"
bd1529
@@ -1038,8 +1367,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "negation SUBSYSTEM!=",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "not-anything",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "not-anything",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", SUBSYSTEM=="block", KERNEL!="sda1", SYMLINK+="matches-but-is-negated"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="before"
bd1529
@@ -1048,8 +1380,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "negation PROGRAM!= exit code",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "nonzero-program",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "nonzero-program",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="before"
bd1529
 KERNEL=="sda1", PROGRAM!="/bin/false", SYMLINK+="nonzero-program"
bd1529
@@ -1057,8 +1392,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ENV{} test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "true",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "true",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{ENV_KEY_TEST}="test"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="go", SYMLINK+="wrong"
bd1529
@@ -1068,8 +1406,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ENV{} test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "true",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "true",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ENV{ENV_KEY_TEST}="test"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="go", SYMLINK+="wrong"
bd1529
@@ -1080,8 +1421,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ENV{} test (assign)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "true",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "true",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="true"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="yes", SYMLINK+="no"
bd1529
@@ -1091,8 +1435,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ENV{} test (assign 2 times)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "true",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "true",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="true"
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="absolutely-\$env{ASSIGN}"
bd1529
@@ -1103,8 +1450,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "ENV{} test (assign2)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "part",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "part",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEM=="block", KERNEL=="*[0-9]", ENV{PARTITION}="true", ENV{MAINDEVICE}="false"
bd1529
 SUBSYSTEM=="block", KERNEL=="*[!0-9]", ENV{PARTITION}="false", ENV{MAINDEVICE}="true"
bd1529
@@ -1115,40 +1465,55 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "untrusted string sanitize",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "sane",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "sane",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e name; (/usr/bin/badprogram)", RESULT=="name_ _/usr/bin/badprogram_", SYMLINK+="sane"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "untrusted string sanitize (don't replace utf8)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "uber",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "uber",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e \\xc3\\xbcber" RESULT=="\xc3\xbcber", SYMLINK+="uber"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "untrusted string sanitize (replace invalid utf8)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "replaced",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "replaced",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e \\xef\\xe8garbage", RESULT=="__garbage", SYMLINK+="replaced"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "read sysfs value from parent device",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "serial-354172020305000",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "serial-354172020305000",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM*", ATTRS{serial}=="?*", SYMLINK+="serial-%s{serial}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "match against empty key string",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "ok",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "ok",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", ATTRS{nothing}!="", SYMLINK+="not-1-ok"
bd1529
 KERNEL=="sda", ATTRS{nothing}=="", SYMLINK+="not-2-ok"
bd1529
@@ -1158,8 +1523,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "check ACTION value",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "ok",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "ok",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 ACTION=="unknown", KERNEL=="sda", SYMLINK+="unknown-not-ok"
bd1529
 ACTION=="add", KERNEL=="sda", SYMLINK+="ok"
bd1529
@@ -1167,9 +1535,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "final assignment",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "ok",
bd1529
-                exp_perms       => "root:tty:0640",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "ok",
bd1529
+                                exp_perms       => "root:tty:0640",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", GROUP:="tty"
bd1529
 KERNEL=="sda", GROUP="not-ok", MODE="0640", SYMLINK+="ok"
bd1529
@@ -1177,9 +1548,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "final assignment 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "ok",
bd1529
-                exp_perms       => "root:tty:0640",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "ok",
bd1529
+                                exp_perms       => "root:tty:0640",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", GROUP:="tty"
bd1529
 SUBSYSTEM=="block", MODE:="640"
bd1529
@@ -1188,17 +1562,23 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "env substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "node-add-me",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "node-add-me",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", MODE="0666", SYMLINK+="node-\$env{ACTION}-me"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "reset list to current value",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "three",
bd1529
-                not_exp_name    => "two",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "three",
bd1529
+                                not_exp_name    => "two",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="one"
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="two"
bd1529
@@ -1207,9 +1587,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test empty SYMLINK+ (empty override)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "right",
bd1529
-                not_exp_name    => "wrong",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "right",
bd1529
+                                not_exp_name    => "wrong",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK+="wrong"
bd1529
 KERNEL=="ttyACM[0-9]*", SYMLINK=""
bd1529
@@ -1218,8 +1601,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "right",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="ttyACM*", SYMLINK+="before"
bd1529
 KERNEL=="ttyACM*|nothing", SYMLINK+="right"
bd1529
@@ -1227,8 +1613,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 2",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "right",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="dontknow*|*nothing", SYMLINK+="nomatch"
bd1529
 KERNEL=="ttyACM*", SYMLINK+="before"
bd1529
@@ -1237,8 +1626,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 3",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "right",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="dontknow|nothing", SYMLINK+="nomatch"
bd1529
 KERNEL=="dontknow|ttyACM0a|nothing|attyACM0", SYMLINK+="wrong1"
bd1529
@@ -1248,8 +1640,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 4",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
-                exp_name        => "right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
bd1529
+                                exp_name        => "right",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="dontknow|nothing", SYMLINK+="nomatch"
bd1529
 KERNEL=="dontknow|ttyACM0a|nothing|attyACM0", SYMLINK+="wrong1"
bd1529
@@ -1259,10 +1654,13 @@ KERNEL=="ttyACM0a|nothing", SYMLINK+="wrong3"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
-                desc            => "test multi matches 5",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+               desc            => "test multi matches 5",
bd1529
+               devices => [
bd1529
+                       {
bd1529
+                               devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                               exp_name        => "found",
bd1529
+                               not_exp_name    => "bad",
bd1529
+                       }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG="foo"
bd1529
 TAGS=="|foo", SYMLINK+="found"
bd1529
@@ -1271,9 +1669,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 6",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                       }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG=""
bd1529
 TAGS=="|foo", SYMLINK+="found"
bd1529
@@ -1282,9 +1683,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 7",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG="foo"
bd1529
 TAGS=="foo||bar", SYMLINK+="found"
bd1529
@@ -1293,9 +1697,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 8",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG=""
bd1529
 TAGS=="foo||bar", SYMLINK+="found"
bd1529
@@ -1304,9 +1711,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 9",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG="foo"
bd1529
 TAGS=="foo|", SYMLINK+="found"
bd1529
@@ -1315,9 +1725,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 10",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG=""
bd1529
 TAGS=="foo|", SYMLINK+="found"
bd1529
@@ -1326,9 +1739,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "test multi matches 11",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TAG="c"
bd1529
 TAGS=="foo||bar||c", SYMLINK+="found"
bd1529
@@ -1337,8 +1753,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "IMPORT parent test sequence 1/2 (keep)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "parent",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "parent",
bd1529
+                        }],
bd1529
                 option          => "keep",
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", IMPORT{program}="/bin/echo -e \'PARENT_KEY=parent_right\\nWRONG_PARENT_KEY=parent_wrong'"
bd1529
@@ -1347,8 +1766,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "IMPORT parent test sequence 2/2 (keep)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "parentenv-parent_right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "parentenv-parent_right",
bd1529
+                        }],
bd1529
                 option          => "clean",
bd1529
                 rules           => <
bd1529
 KERNEL=="sda1", IMPORT{parent}="PARENT*", SYMLINK+="parentenv-\$env{PARENT_KEY}\$env{WRONG_PARENT_KEY}"
bd1529
@@ -1356,8 +1778,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "GOTO test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "right",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda1", GOTO="TEST"
bd1529
 KERNEL=="sda1", SYMLINK+="wrong"
bd1529
@@ -1370,8 +1795,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "GOTO label does not exist",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "right",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "right",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda1", GOTO="does-not-exist"
bd1529
 KERNEL=="sda1", SYMLINK+="right",
bd1529
@@ -1380,9 +1808,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "SYMLINK+ compare test",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "right",
bd1529
-                not_exp_name    => "wrong",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "right",
bd1529
+                                not_exp_name    => "wrong",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda1", SYMLINK+="link"
bd1529
 KERNEL=="sda1", SYMLINK=="link*", SYMLINK+="right"
bd1529
@@ -1391,8 +1822,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "invalid key operation",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL="sda1", SYMLINK+="no"
bd1529
 KERNEL=="sda1", SYMLINK+="yes"
bd1529
@@ -1400,16 +1834,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "operator chars in attribute",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", ATTR{test:colon+plus}=="?*", SYMLINK+="yes"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "overlong comment line",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
-                exp_name        => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
bd1529
+                                exp_name        => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 # 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
bd1529
    # 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
bd1529
@@ -1419,16 +1859,22 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "magic subsys/kernel lookup",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "00:16:41:e2:8d:ff",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "00:16:41:e2:8d:ff",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", SYMLINK+="\$attr{[net/eth0]address}"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST absolute path",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "there",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "there",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 TEST=="/etc/machine-id", SYMLINK+="there"
bd1529
 TEST!="/etc/machine-id", SYMLINK+="notthere"
bd1529
@@ -1436,44 +1882,59 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST subsys/kernel lookup",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TEST=="[net/eth0]", SYMLINK+="yes"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST relative path",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "relative",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "relative",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TEST=="size", SYMLINK+="relative"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST wildcard substitution (find queue/nr_requests)",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found-subdir",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found-subdir",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", TEST=="*/nr_requests", SYMLINK+="found-subdir"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST MODE=0000",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "sda",
bd1529
-                exp_perms       => "0:0:0000",
bd1529
-                exp_rem_error   => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "sda",
bd1529
+                                exp_perms       => "0:0:0000",
bd1529
+                                exp_rem_error   => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", MODE="0000"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST PROGRAM feeds OWNER, GROUP, MODE",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "sda",
bd1529
-                exp_perms       => "1:1:0400",
bd1529
-                exp_rem_error   => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "sda",
bd1529
+                                exp_perms       => "1:1:0400",
bd1529
+                                exp_rem_error   => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", MODE="666"
bd1529
 KERNEL=="sda", PROGRAM=="/bin/echo 1 1 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
bd1529
@@ -1481,10 +1942,13 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "TEST PROGRAM feeds MODE with overflow",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "sda",
bd1529
-                exp_perms       => "0:0:0440",
bd1529
-                exp_rem_error   => "yes",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "sda",
bd1529
+                                exp_perms       => "0:0:0440",
bd1529
+                                exp_rem_error   => "yes",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", MODE="440"
bd1529
 KERNEL=="sda", PROGRAM=="/bin/echo 0 0 0400letsdoabuffferoverflow0123456789012345789012345678901234567890", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
bd1529
@@ -1492,9 +1956,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "magic [subsys/sysname] attribute substitution",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "sda-8741C4G-end",
bd1529
-                exp_perms       => "0:0:0600",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "sda-8741C4G-end",
bd1529
+                                exp_perms       => "0:0:0600",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", PROGRAM="/bin/true create-envp"
bd1529
 KERNEL=="sda", ENV{TESTENV}="change-envp"
bd1529
@@ -1503,8 +1970,11 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "builtin path_id",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 KERNEL=="sda", IMPORT{builtin}="path_id"
bd1529
 KERNEL=="sda", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/\$env{ID_PATH}"
bd1529
@@ -1512,9 +1982,12 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "add and match tag",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad" ,
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", TAG+="green"
bd1529
 TAGS=="green", SYMLINK+="found"
bd1529
@@ -1523,17 +1996,23 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "don't crash with lots of tags",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                        }],
bd1529
                 rules           => $rules_10k_tags . <
bd1529
 TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test10000", SYMLINK+="found"
bd1529
 EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "continuations",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => $rules_10k_tags_continuation . <
bd1529
 TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test10000", SYMLINK+="bad"
bd1529
 KERNEL=="sda",\\
bd1529
@@ -1551,9 +2030,13 @@ EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "continuations with empty line",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 # empty line finishes continuation
bd1529
 KERNEL=="sda", TAG+="foo" \\
bd1529
@@ -1563,13 +2046,16 @@ KERNEL=="sda", TAG+="aaa" \\
bd1529
 KERNEL=="sdb", TAG+="bbb"
bd1529
 TAGS=="foo", SYMLINK+="found"
bd1529
 TAGS=="aaa", SYMLINK+="bad"
bd1529
-EOF
bd1529
+                    EOF
bd1529
         },
bd1529
         {
bd1529
                 desc            => "continuations with white only line",
bd1529
-                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
-                exp_name        => "found",
bd1529
-                not_exp_name    => "bad",
bd1529
+                devices => [
bd1529
+                        {
bd1529
+                                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
bd1529
+                                exp_name        => "found",
bd1529
+                                not_exp_name    => "bad",
bd1529
+                        }],
bd1529
                 rules           => <
bd1529
 # space only line finishes continuation
bd1529
 KERNEL=="sda", TAG+="foo" \\
bd1529
@@ -1709,43 +2195,33 @@ sub udev_setup {
bd1529
         return 1;
bd1529
 }
bd1529
 
bd1529
-sub run_test {
bd1529
-        my ($rules, $number) = @_;
bd1529
-        my $rc;
bd1529
-
bd1529
-        print "TEST $number: $rules->{desc}\n";
bd1529
-        print "device \'$rules->{devpath}\' expecting node/link \'$rules->{exp_name}\'\n";
bd1529
+sub check_add {
bd1529
+        my ($device) = @_;
bd1529
 
bd1529
-        $rc = udev("add", $rules->{devpath}, \$rules->{rules});
bd1529
-        if ($rc != 0) {
bd1529
-                print "$udev_bin add failed with code $rc\n";
bd1529
-                $error++;
bd1529
-        }
bd1529
-        if (defined($rules->{not_exp_name})) {
bd1529
-                if ((-e "$udev_dev/$rules->{not_exp_name}") ||
bd1529
-                    (-l "$udev_dev/$rules->{not_exp_name}")) {
bd1529
-                        print "nonexistent: error \'$rules->{not_exp_name}\' not expected to be there\n";
bd1529
+        if (defined($device->{not_exp_name})) {
bd1529
+                if ((-e "$udev_dev/$device->{not_exp_name}") ||
bd1529
+                    (-l "$udev_dev/$device->{not_exp_name}")) {
bd1529
+                        print "nonexistent: error \'$device->{not_exp_name}\' not expected to be there\n";
bd1529
                         $error++;
bd1529
                         sleep(1);
bd1529
                 }
bd1529
         }
bd1529
-
bd1529
-        if ((-e "$udev_dev/$rules->{exp_name}") ||
bd1529
-            (-l "$udev_dev/$rules->{exp_name}")) {
bd1529
+        if ((-e "$udev_dev/$device->{exp_name}") ||
bd1529
+            (-l "$udev_dev/$device->{exp_name}")) {
bd1529
 
bd1529
                 my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
bd1529
-                    $atime, $mtime, $ctime, $blksize, $blocks) = stat("$udev_dev/$rules->{exp_name}");
bd1529
+                    $atime, $mtime, $ctime, $blksize, $blocks) = stat("$udev_dev/$device->{exp_name}");
bd1529
 
bd1529
-                if (defined($rules->{exp_perms})) {
bd1529
-                        permissions_test($rules, $uid, $gid, $mode);
bd1529
+                if (defined($device->{exp_perms})) {
bd1529
+                        permissions_test($device, $uid, $gid, $mode);
bd1529
                 }
bd1529
-                if (defined($rules->{exp_majorminor})) {
bd1529
-                        major_minor_test($rules, $rdev);
bd1529
+                if (defined($device->{exp_majorminor})) {
bd1529
+                        major_minor_test($device, $rdev);
bd1529
                 }
bd1529
-                print "add:         ok\n";
bd1529
+                print "add $device->{devpath}:         ok\n";
bd1529
         } else {
bd1529
-                print "add:         error";
bd1529
-                if ($rules->{exp_add_error}) {
bd1529
+                print "add  $device->{devpath}:         error";
bd1529
+                if ($device->{exp_add_error}) {
bd1529
                         print " as expected\n";
bd1529
                 } else {
bd1529
                         print "\n";
bd1529
@@ -1755,21 +2231,15 @@ sub run_test {
bd1529
                         sleep(1);
bd1529
                 }
bd1529
         }
bd1529
+}
bd1529
 
bd1529
-        if (defined($rules->{option}) && $rules->{option} eq "keep") {
bd1529
-                print "\n\n";
bd1529
-                return;
bd1529
-        }
bd1529
+sub check_remove {
bd1529
+        my ($device) = @_;
bd1529
 
bd1529
-        $rc = udev("remove", $rules->{devpath}, \$rules->{rules});
bd1529
-        if ($rc != 0) {
bd1529
-                print "$udev_bin remove failed with code $rc\n";
bd1529
-                $error++;
bd1529
-        }
bd1529
-        if ((-e "$udev_dev/$rules->{exp_name}") ||
bd1529
-            (-l "$udev_dev/$rules->{exp_name}")) {
bd1529
-                print "remove:      error";
bd1529
-                if ($rules->{exp_rem_error}) {
bd1529
+        if ((-e "$udev_dev/$device->{exp_name}") ||
bd1529
+            (-l "$udev_dev/$device->{exp_name}")) {
bd1529
+                print "remove  $device->{devpath}:      error";
bd1529
+                if ($device->{exp_rem_error}) {
bd1529
                         print " as expected\n";
bd1529
                 } else {
bd1529
                         print "\n";
bd1529
@@ -1779,7 +2249,43 @@ sub run_test {
bd1529
                         sleep(1);
bd1529
                 }
bd1529
         } else {
bd1529
-                print "remove:      ok\n";
bd1529
+                print "remove  $device->{devpath}:      ok\n";
bd1529
+        }
bd1529
+}
bd1529
+
bd1529
+sub run_test {
bd1529
+        my ($rules, $number) = @_;
bd1529
+        my $rc;
bd1529
+        my @devices = @{$rules->{devices}};
bd1529
+
bd1529
+        print "TEST $number: $rules->{desc}\n";
bd1529
+        foreach my $dev (@devices) {
bd1529
+                print "device \'$dev->{devpath}\' expecting node/link \'$dev->{exp_name}\'\n";
bd1529
+                $rc = udev("add", $dev->{devpath}, \$rules->{rules});
bd1529
+                if ($rc != 0) {
bd1529
+                        print "$udev_bin add failed with code $rc\n";
bd1529
+                        $error++;
bd1529
+                }
bd1529
+        }
bd1529
+
bd1529
+        foreach my $dev (@devices) {
bd1529
+                check_add($dev);
bd1529
+        }
bd1529
+
bd1529
+        if (defined($rules->{option}) && $rules->{option} eq "keep") {
bd1529
+                print "\n\n";
bd1529
+                return;
bd1529
+        }
bd1529
+
bd1529
+        foreach my $dev (@devices) {
bd1529
+                $rc = udev("remove", $dev->{devpath}, \$rules->{rules});
bd1529
+                if ($rc != 0) {
bd1529
+                        print "$udev_bin remove failed with code $rc\n";
bd1529
+                        $error++;
bd1529
+                }
bd1529
+        }
bd1529
+        foreach my $dev (@devices) {
bd1529
+                check_remove($dev);
bd1529
         }
bd1529
 
bd1529
         print "\n";