richardphibel / rpms / systemd

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