X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=test%2Fudev-test.pl;h=8b967c353c6e5c0364433dc786ffd702498e75dd;hp=613aa792d433f8bbf6cb29ff608e9de5245eaa17;hb=0db6d4cc61523ee7f3f627f807c01f86ee2d36ab;hpb=e5fbfe0a13e11c08ed72b67fa4e72a93bcd5de37 diff --git a/test/udev-test.pl b/test/udev-test.pl index 613aa792d..8b967c353 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -21,13 +21,11 @@ use warnings; use strict; -my $PWD = `pwd`; -chomp($PWD); - +my $PWD = $ENV{PWD}; my $sysfs = "sys/"; my $udev_bin = "../udev"; my $udev_root = "udev-root/"; # !!! directory will be removed !!! -my $udev_db = "udev.tdb"; +my $udev_db = ".udev.tdb"; my $perm = "udev.permissions"; my $conf_tmp = "udev-test.config"; @@ -50,6 +48,15 @@ EOF expected => "boot_disk1" , conf => < "catch device by wildcard", + subsys => "tty", + devpath => "class/tty/ttyUSB0", + expected => "visor/0" , + conf => < "visor" , conf => < "subdirectory handling", + subsys => "tty", + devpath => "class/tty/ttyUSB0", + expected => "sub/direct/ory/visor" , + conf => < "callout result substitution, only last should match", subsys => "block", devpath => "block/sda/sda3", expected => "special-device-3" , @@ -90,6 +106,44 @@ CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n special-device", ID="special--*", NAM CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n special-device", ID="special-device-", NAME="%c-3-%n" CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n special-device", ID="special-devic", NAME="%c-4-%n" CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n special-device", ID="special-*", NAME="%c-%n" +EOF + }, + { + desc => "callout program substitution", + subsys => "block", + devpath => "block/sda/sda3", + expected => "test-0:0:0:0" , + conf => < "devfs disk naming substitution", + subsys => "block", + devpath => "block/sda", + expected => "lun0/disk" , + conf => < "devfs disk naming substitution", + subsys => "block", + devpath => "block/sda/sda2", + expected => "lun0/part2" , + conf => < "callout bus type", + subsys => "block", + devpath => "block/sda", + expected => "scsi-0:0:0:0" , + conf => <{subsys}, $config->{devpath}, \$config->{conf}); @@ -158,7 +211,7 @@ foreach my $config (@tests) { print "$error errors occured\n\n"; # cleanup +unlink($udev_db); system("rm -rf $udev_root"); unlink($conf_tmp); -unlink($udev_db);