-ACTION=="unknown", KERNEL=="sda", NAME="unknown-not-ok"
-ACTION=="add", KERNEL=="sda", NAME="ok"
-EOF
- },
- {
- desc => "apply NAME final",
- subsys => "block",
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
- exp_name => "link",
- exp_target => "ok",
- rules => <<EOF
-KERNEL=="sda", NAME:="ok"
-KERNEL=="sda", NAME="not-ok"
-KERNEL=="sda", SYMLINK+="link"
-EOF
- },
- {
- desc => "test RUN key",
- subsys => "block",
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
- exp_name => "testsymlink",
- exp_target => "ok",
- exp_rem_error => "yes",
- option => "clean",
- rules => <<EOF
-KERNEL=="sda", NAME="ok", RUN+="/bin/ln -s ok %r/testsymlink"
-KERNEL=="sda", NAME="not-ok"
-EOF
- },
- {
- desc => "test RUN key and DEVNAME",
- subsys => "block",
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
- exp_name => "testsymlink",
- exp_target => "ok",
- exp_rem_error => "yes",
- option => "clean",
- rules => <<EOF
-KERNEL=="sda", NAME="not-ok"
-KERNEL=="sda", NAME="ok", RUN+="/bin/sh -c 'ln -s `basename \$\$DEVNAME` %r/testsymlink'"