X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=test%2Fudev-test.pl;h=f442b162ec31cf5ff314480b269284ec5ff30e13;hp=fa1e4affc6d4dbb90f7432a991394699dd7515ea;hb=77313cd0d13ed3682f25c745f71f648292b28215;hpb=c1ab046124ebef3c82950b91ccfd1678d9f7fe5b diff --git a/test/udev-test.pl b/test/udev-test.pl index fa1e4affc..f442b162e 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -14,14 +14,8 @@ # After creation and removal the result is checked against the # expected value and the result is printed. # -# happy testing, # Kay Sievers , 2003 -# -# Modified April 9, 2004 by Leann Ogasawara -# - expanded @tests array to add more symlinks and permissions tests -# - some of the symlinks tests also test lack of node creation -# - added symlink_test() function -# - moved permissions and major_minor tests into their own functions +# Leann Ogasawara , 2004 use warnings; use strict; @@ -198,6 +192,15 @@ EOF 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 => < "symlink name empty", - subsys => "block", - devpath => "/block/sda", - exp_name => "", - exp_target => "link", - exp_error => "yes", - conf => < "/block/sda", exp_name => ".", exp_target => "link", - exp_error => "yes", + exp_add_error => "yes", + exp_rem_error => "yes", conf => < "/block/sda", exp_name => "symlink", exp_target => "", - exp_error => "yes", + exp_add_error => "yes", conf => < "/block/sda", exp_name => "", exp_target => "", - exp_error => "yes", + exp_add_error => "yes", + exp_rem_error => "yes", conf => < "/class/tty/tty0", exp_name => "link", exp_target => "link", + exp_rem_error => "yes", + option => "clear", conf => < "enumeration char test sequence (1/5 keep)", + desc => "enumeration char test sequence 1/5 (keep)", subsys => "block", devpath => "/block/sda", exp_name => "cdrom", @@ -1024,6 +1020,37 @@ EOF exp_name => "cdrom", conf => < "ignore rule test", + subsys => "block", + devpath => "/block/sda", + exp_name => "node", + exp_add_error => "yes", + conf => < "all_partitions, option-only rule", + subsys => "block", + devpath => "/block/sda", + exp_name => "node6", + conf => < "all_partitions, option-only rule (fail on partition)", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "node6", + exp_add_error => "yes", + conf => < "block", devpath => "/block/sda", exp_name => "node", - exp_error => "yes", + exp_rem_error => "yes", conf => < "block", devpath => "/block/sda", exp_name => "node14", - exp_error => "yes", + exp_rem_error => "yes", option => "clear", conf => < "temporary node creation test", subsys => "block", devpath => "/block/sda", - exp_name => "sda", + exp_name => "node", conf => < "sda", conf => < "parent node name substitution test sequence 1/2 (keep)", + subsys => "block", + devpath => "/block/sda", + exp_name => "main_device", + option => "keep", + conf => < "parent node name substitution test sequence 2/2 (clean)", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "main_device-part-1", + option => "clean", + conf => < "udev_root substitution", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "start-udev-root-end", + option => "clean", + conf => <{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++; @@ -1179,7 +1236,7 @@ sub symlink_test { } 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++; @@ -1218,7 +1275,7 @@ sub run_test { print "add: ok "; } else { print "add: error "; - if ($config->{exp_error}) { + if ($config->{exp_add_error}) { print "as expected "; } else { print "\n\n"; @@ -1237,7 +1294,7 @@ sub run_test { 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";