diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-09-05 02:18:06 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-09-05 02:18:06 +0200 |
commit | eef5447934a07279bc76f3f65b0302ddea8556ab (patch) | |
tree | 83787f593db778e5471e03b441a5852e99618bca /test/udev-test.pl | |
parent | ac528431dd60c6b7f6b664ba430b937a11a32230 (diff) |
let $attr{symlink} return the last element of the path
Example for /block/sda:
SUBSYSTEMS="scsi", ENV{COMMENT}="$attr{driver}"
sets COMMENT=sd
SUBSYSTEMS="pci", ENV{COMMENT}="$attr{driver}"
sets COMMENT=ata_piix
Diffstat (limited to 'test/udev-test.pl')
-rwxr-xr-x | test/udev-test.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl index 464098fa65..54c3378392 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -582,6 +582,24 @@ SUBSYSTEMS=="scsi", KERNELS=="0:0:0:0", NAME="bad" EOF }, { + desc => "substitute attr with link target value (first match)", + subsys => "block", + devpath => "/block/sda", + exp_name => "driver-is-sd", + rules => <<EOF +SUBSYSTEMS=="scsi", NAME="driver-is-\$attr{driver}" +EOF + }, + { + desc => "substitute attr with link target value (currently selected device)", + subsys => "block", + devpath => "/block/sda", + exp_name => "driver-is-aic7xxx", + rules => <<EOF +SUBSYSTEMS=="pci", NAME="driver-is-\$attr{driver}" +EOF + }, + { desc => "ignore ATTRS attribute whitespace", subsys => "block", devpath => "/block/sda", |