+ exp_name => "main_device",
+ option => "keep",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda", NAME="main_device"
+EOF
+ },
+ {
+ desc => "parent node name substitution test sequence 2/2 (clean)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "main_device-part-1",
+ option => "clean",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="%P-part-1"
+EOF
+ },
+ {
+ desc => "udev_root substitution",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "start-udev-root-end",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="start-%r-end"
+EOF
+ },
+ {
+ desc => "last_rule option",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "last",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", SYMLINK+="last", OPTIONS="last_rule"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="very-last"
+EOF
+ },
+ {
+ desc => "negation KERNEL!=",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "match",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL!="sda1", NAME="matches-but-is-negated"
+SUBSYSTEMS=="scsi", KERNEL!="xsda1", NAME="match"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="wrong"
+EOF
+ },
+ {
+ desc => "negation SUBSYSTEM!=",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "not-anything",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", SUBSYSTEM=="block", KERNEL!="sda1", NAME="matches-but-is-negated"
+SUBSYSTEMS=="scsi", SUBSYSTEM!="anything", NAME="not-anything"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="wrong"
+EOF
+ },
+ {
+ desc => "negation PROGRAM!= exit code",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "nonzero-program",
+ rules => <<EOF
+KERNEL=="sda1", PROGRAM!="/bin/false", NAME="nonzero-program"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="wrong"
+EOF
+ },
+ {
+ desc => "test for whitespace between the operator",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "true",
+ rules => <<EOF
+KERNEL == "sda1" , NAME = "true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="wrong"
+EOF
+ },
+ {
+ desc => "ENV{} test",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "true",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="go", NAME="wrong"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="test", NAME="true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="bad", NAME="bad"
+EOF
+ },
+ {
+ desc => "ENV{} test",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "true",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="go", NAME="wrong"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="yes", ENV{ACTION}=="add", ENV{DEVPATH}=="/block/sda/sdax1", NAME="no"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="test", ENV{ACTION}=="add", ENV{DEVPATH}=="/block/sda/sda1", NAME="true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ENV_KEY_TEST}=="bad", NAME="bad"
+EOF
+ },
+ {
+ desc => "ENV{} test (assign)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "true",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="yes", NAME="no"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="true", NAME="true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="bad"
+EOF
+ },
+ {
+ desc => "ENV{} test (assign 2 times)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "true",
+ rules => <<EOF
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}="absolutely-\$env{ASSIGN}"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="yes", NAME="no"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", ENV{ASSIGN}=="absolutely-true", NAME="true"
+SUBSYSTEMS=="scsi", KERNEL=="sda1", NAME="bad"