KERNEL="ttyUSB0", \\
NAME="visor"
+EOF
+ },
+ {
+ desc => "preserve backslashes, if they are not for a newline",
+ subsys => "tty",
+ devpath => "/class/tty/ttyUSB0",
+ exp_name => "aaa",
+ conf => <<EOF
+KERNEL="ttyUSB0", PROGRAM="/bin/echo -e \\101", RESULT="A", NAME="aaa"
EOF
},
{
BUS="scsi", KERNEL="sda", SYMLINK="symlink-only1"
BUS="scsi", KERNEL="sda", SYMLINK="symlink-only2"
BUS="scsi", KERNEL="sda", NAME="link", SYMLINK="symlink0"
-EOF
- },
- {
- desc => "symlink name empty",
- subsys => "block",
- devpath => "/block/sda",
- exp_name => "",
- exp_target => "link",
- exp_error => "yes",
- conf => <<EOF
-BUS="scsi", KERNEL="sda", NAME="link", SYMLINK=""
EOF
},
{
devpath => "/block/sda",
exp_name => ".",
exp_target => "link",
- exp_error => "yes",
+ exp_add_error => "yes",
+ exp_rem_error => "yes",
conf => <<EOF
BUS="scsi", KERNEL="sda", NAME="link", SYMLINK="."
EOF
devpath => "/block/sda",
exp_name => "symlink",
exp_target => "",
- exp_error => "yes",
+ exp_add_error => "yes",
conf => <<EOF
BUS="scsi", KERNEL="sda", NAME="", SYMLINK="symlink"
EOF
devpath => "/block/sda",
exp_name => "",
exp_target => "",
- exp_error => "yes",
+ exp_add_error => "yes",
+ exp_rem_error => "yes",
conf => <<EOF
BUS="scsi", KERNEL="sda", NAME="", SYMLINK=""
EOF
devpath => "/class/tty/tty0",
exp_name => "link",
exp_target => "link",
+ exp_rem_error => "yes",
+ option => "clear",
conf => <<EOF
KERNEL="tty0", NAME="link", SYMLINK="link"
EOF
exp_name => "cdrom",
conf => <<EOF
KERNEL="sda", NAME="cdrom%e"
+EOF
+ },
+ {
+ desc => "ignore rule test",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "node",
+ exp_add_error => "yes",
+ conf => <<EOF
+BUS="scsi", KERNEL="sda", NAME="node", OPTIONS="ignore"
+EOF
+ },
+ {
+ desc => "all_partitions, option-only rule",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "node6",
+ conf => <<EOF
+SUBSYSTEM="block", OPTIONS="all_partitions"
+BUS="scsi", KERNEL="sda", NAME="node"
+EOF
+ },
+ {
+ desc => "all_partitions, option-only rule (fail on partition)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "node6",
+ exp_add_error => "yes",
+ conf => <<EOF
+SUBSYSTEM="block", OPTIONS="all_partitions"
+BUS="scsi", KERNEL="sda", NAME="node"
EOF
},
{
subsys => "block",
devpath => "/block/sda",
exp_name => "node",
- exp_error => "yes",
+ exp_rem_error => "yes",
conf => <<EOF
-BUS="scsi", KERNEL="sda", NAME{ignore_remove}="node"
+BUS="scsi", KERNEL="sda", NAME="node", OPTIONS="ignore_remove"
EOF
},
{
subsys => "block",
devpath => "/block/sda",
exp_name => "node14",
- exp_error => "yes",
+ exp_rem_error => "yes",
option => "clear",
conf => <<EOF
-BUS="scsi", KERNEL="sda", NAME{ignore_remove, all_partitions}="node"
+BUS="scsi", KERNEL="sda", NAME="node", OPTIONS="ignore_remove, all_partitions"
EOF
},
{
} else {
print "expected symlink from: \'$config->{exp_name}\' to \'$config->{exp_target}\'\n";
print "created symlink from: \'$config->{exp_name}\' to \'$2\'\n";
- if ($config->{exp_error}) {
+ if ($config->{exp_add_error}) {
print "as expected ";
} else {
$error++;
} else {
print "expected symlink from: \'$config->{exp_name}\' to \'$config->{exp_target}\'\n";
print "symlink: not created ";
- if ($config->{exp_error}) {
+ if ($config->{exp_add_error}) {
print "as expected ";
} else {
$error++;
print "add: ok ";
} else {
print "add: error ";
- if ($config->{exp_error}) {
+ if ($config->{exp_add_error}) {
print "as expected ";
} else {
print "\n\n";
if ((-e "$PWD/$udev_root$config->{exp_name}") ||
(-l "$PWD/$udev_root$config->{exp_name}")) {
print "remove: error ";
- if ($config->{exp_error}) {
+ if ($config->{exp_rem_error}) {
print "as expected\n\n";
} else {
print "\n\n";