chiark / gitweb /
[PATCH] added ability to put format specifiers in the CALLOUT program string.
[elogind.git] / test / udev-test.pl
index 9a54b6192aa286a0b65d693f9d4a889abe437558..02f8ff6319218f1c9c5e464d537b994b96af81d2 100644 (file)
@@ -90,6 +90,15 @@ 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 subtitution",
+               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
        },
 );
@@ -124,7 +133,7 @@ system("rm -rf $udev_root");
 mkdir($udev_root) || die "unable to create udev_root: $udev_root\n";
 
 # test
-my $error;
+my $error = 0;
 print "\nudev-test will run ".($#tests + 1)." tests:\n\n";
 
 foreach my $config (@tests) {