ryantimwilson / rpms / systemd

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