]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/udev-test.pl
test-execute: Add tests for new PassEnvironment= directive
[thirdparty/systemd.git] / test / udev-test.pl
index d9b7967004414210bc5e11cefb20632b201c3f33..0a8930357005749ad209654596dab3ea8617e7b7 100755 (executable)
@@ -22,7 +22,9 @@ use strict;
 
 my $udev_bin            = "./test-udev";
 my $valgrind            = 0;
-my $udev_bin_valgrind   = "valgrind --tool=memcheck --leak-check=yes --quiet $udev_bin";
+my $gdb                 = 0;
+my $udev_bin_valgrind   = "valgrind --tool=memcheck --leak-check=yes --track-origins=yes --quiet $udev_bin";
+my $udev_bin_gdb        = "gdb --args $udev_bin";
 my $udev_dev            = "test/dev";
 my $udev_run            = "test/run";
 my $udev_rules_dir      = "$udev_run/udev/rules.d";
@@ -1326,6 +1328,8 @@ sub udev {
 
         if ($valgrind > 0) {
                 system("$udev_bin_valgrind $action $devpath");
+        } elsif ($gdb > 0) {
+                system("$udev_bin_gdb $action $devpath");
         } else {
                 system("$udev_bin", "$action", "$devpath");
         }
@@ -1483,7 +1487,7 @@ sub run_test {
 # due to mknod restrictions
 if (!($<==0)) {
         print "Must have root permissions to run properly.\n";
-        exit;
+        exit($EXIT_TEST_SKIP);
 }
 
 # skip the test when running in a container
@@ -1502,6 +1506,9 @@ foreach my $arg (@ARGV) {
         if ($arg =~ m/--valgrind/) {
                 $valgrind = 1;
                 printf("using valgrind\n");
+        } elsif ($arg =~ m/--gdb/) {
+                $gdb = 1;
+                printf("using gdb\n");
         } else {
                 push(@list, $arg);
         }