diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-03-11 01:36:12 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:35:09 -0700 |
commit | 35b38379bac87ebf4d0cc6884feff588ee859d5f (patch) | |
tree | dbc219e051505ba97d1be22d34ca4caa3051ad42 /test/udev-test.pl | |
parent | a3b37a073d52ff01d4ef023a10f13316da4c9966 (diff) |
[PATCH] cleanup callout fork
Here I change the callout fork logic.
The current cersion is unable to read a pipe which is not flushed at once,
Now we read until it's closed.
The maximum argument count is calculated by the strlen now. We have 100
chars for our result buffer so we can't have more than 50 parameters.
So it's much more clear what will happen now and not some magic boundary
where we use shell behind it.
Parameter can be combined to one by using apostrophes.
this on works now:
BUS="scsi", PROGRAM="/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed s/foo9/bar9/'", KERNEL="sda3", NAME="%c{7}"
Two new test are also added.
Diffstat (limited to 'test/udev-test.pl')
-rw-r--r-- | 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 38ea0181f6..dadec568ba 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -262,6 +262,24 @@ BUS="scsi", PROGRAM="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL="s EOF }, { + desc => "program with subshell", + subsys => "block", + devpath => "block/sda/sda3", + expected => "bar9" , + conf => <<EOF +BUS="scsi", PROGRAM="/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed s/foo9/bar9/'", KERNEL="sda3", NAME="%c{7}" +EOF + }, + { + desc => "program arguments combined with apostrophes", + subsys => "block", + devpath => "block/sda/sda3", + expected => "foo7" , + conf => <<EOF +BUS="scsi", PROGRAM="/bin/echo -n 'foo3 foo4' 'foo5 foo6 foo7 foo8'", KERNEL="sda3", NAME="%c{5}" +EOF + }, + { desc => "characters before the %c{N} substitution", subsys => "block", devpath => "block/sda/sda3", |