summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-03-04 18:59:13 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:08 -0700
commitd5f91372dd3241f8b4bbe2a99aaaeda541a76bad (patch)
tree196ca6a32c2c9ba4b6fb4b2cedfe4abb309e8aa5 /test
parentebc39fefd5cb8249cd09d4b3d1b8c72c9e48bab1 (diff)
[PATCH] conditional remove of trailing sysfs whitespace
Hey, it may never happen, that one wants to distinguish attributes by trailing spaces, but we should not lose the control over it, just for being lazy :) Here we remove the trailing spaces of the sysfs attribute only if the configured value to match doesn't have any trailing spaces by itself. So if you put a attribute in a rule with spaces at the end, the sysfs attribute _must_ match exactly. Is that cool for everyone? As usual, 2 tests are added for it with a artificial sysfs file and a few words to the man page.
Diffstat (limited to 'test')
-rw-r--r--test/sys/devices/pci0000:00/0000:00:1e.0/0000:02:05.0/host0/0:0:0:0/whitespace_test1
-rw-r--r--test/udev-test.pl19
2 files changed, 20 insertions, 0 deletions
diff --git a/test/sys/devices/pci0000:00/0000:00:1e.0/0000:02:05.0/host0/0:0:0:0/whitespace_test b/test/sys/devices/pci0000:00/0000:00:1e.0/0000:02:05.0/host0/0:0:0:0/whitespace_test
new file mode 100644
index 0000000000..e3d48f0fe0
--- /dev/null
+++ b/test/sys/devices/pci0000:00/0000:00:1e.0/0000:02:05.0/host0/0:0:0:0/whitespace_test
@@ -0,0 +1 @@
+WHITE SPACE
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 60cf16901c..38ea0181f6 100644
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -467,6 +467,25 @@ BUS="scsi", ID="*:0:0:0", NAME="scsi-0:0:0:0"
BUS="scsi", ID="0:0:0:0", NAME="bad"
EOF
},
+ {
+ desc => "ignore SYSFS attribute whitespace",
+ subsys => "block",
+ devpath => "block/sda",
+ expected => "ignored",
+ conf => <<EOF
+BUS="scsi", SYSFS{whitespace_test}="WHITE SPACE", NAME="ignored"
+EOF
+ },
+ {
+ desc => "do not ignore SYSFS attribute whitespace",
+ subsys => "block",
+ devpath => "block/sda",
+ expected => "matched-with-space",
+ conf => <<EOF
+BUS="scsi", SYSFS{whitespace_test}="WHITE SPACE ", NAME="wrong-to-ignore"
+BUS="scsi", SYSFS{whitespace_test}="WHITE SPACE ", NAME="matched-with-space"
+EOF
+ },
);
# set env