diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-04-02 17:45:35 +0200 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:55:00 -0700 |
commit | 821d0ec803a72841f173739f5b713fe847edab75 (patch) | |
tree | 4866ffc8b8c367cd6e62fd0616fffde01757e3e7 /test/udev-test.pl | |
parent | e03a196a0d0680868ea230ab8f8d100ee90d0fa4 (diff) |
[PATCH] add RUN key to be able to run rule based notification
SUBSYSTEM=="block", RUN="/sbin/program"
will execute the program only for block device events.
ACTION="remove", SUBSYSTEM=="block", RUN"/sbin/program"
will execute the program, if a block device is removed.
Diffstat (limited to 'test/udev-test.pl')
-rw-r--r-- | test/udev-test.pl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl index 27ca37115c..91e91bb2ae 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1245,6 +1245,53 @@ KERNEL=="sda", SYSFS{vendor}!="", NAME="ok" KERNEL=="sda", SYSFS{vendor}=="", NAME="not-3-ok" EOF }, + { + desc => "check ACTION value", + subsys => "block", + devpath => "/block/sda", + exp_name => "ok", + rules => <<EOF +ACTION=="unknown", KERNEL=="sda", NAME="unknown-not-ok" +ACTION=="add", KERNEL=="sda", NAME="ok" +EOF + }, + { + desc => "apply NAME only once", + subsys => "block", + devpath => "/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 => "/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 remove", + subsys => "block", + devpath => "/block/sda", + exp_name => "testsymlink2", + exp_target => "ok2", + rules => <<EOF +KERNEL=="sda", NAME="ok2", RUN+="/bin/ln -s ok2 %r/testsymlink2" +KERNEL=="sda", ACTION=="remove", RUN+="/bin/rm -f %r/testsymlink2" +KERNEL=="sda", NAME="not-ok2" +EOF + }, ); # set env |