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 !!!
expected => "visor" ,
conf => <<EOF
REPLACE, KERNEL="ttyUSB0", NAME="visor"
+EOF
+ },
+ {
+ desc => "subdirectory handling",
+ subsys => "tty",
+ devpath => "class/tty/ttyUSB0",
+ expected => "sub/direct/ory/visor" ,
+ conf => <<EOF
+REPLACE, KERNEL="ttyUSB0", NAME="sub/direct/ory/visor"
EOF
},
{
EOF
},
{
- desc => "callout result subtitution, only last should match",
+ desc => "callout result substitution, only last should match",
subsys => "block",
devpath => "block/sda/sda3",
expected => "special-device-3" ,
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 => <<EOF
+CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n test-%b", ID="test-*", NAME="%c"
EOF
},
);
system("tree $udev_root");
print "\n";
$error++;
-# next;
}
udev("remove", $config->{subsys}, $config->{devpath}, \$config->{conf});