summaryrefslogtreecommitdiffstats
path: root/test/udev-test.pl
diff options
context:
space:
mode:
authorAlexey Bogdanenko <alexey@bogdanenko.com>2018-12-11 14:55:34 +0100
committerAlexey Bogdanenko <alexey@bogdanenko.com>2018-12-11 14:55:34 +0100
commitdbfbc6c4e34366033cb340e8b0c3cbca683ff6f5 (patch)
treec82747c59f06206370cce5378f79757221742695 /test/udev-test.pl
parentudev-test: add message to show why test-udev failed (diff)
downloadsystemd-dbfbc6c4e34366033cb340e8b0c3cbca683ff6f5.tar.xz
systemd-dbfbc6c4e34366033cb340e8b0c3cbca683ff6f5.zip
udev-test: check if permitted to create block device nodes
Diffstat (limited to '')
-rwxr-xr-xtest/udev-test.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index eb76ebd72e..957cda541c 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -1554,6 +1554,14 @@ sub udev_setup {
return 0;
}
+ # check if we are permitted to create block device nodes
+ my $block_device_filename = $udev_dev . "/sda";
+ if (system("mknod", $block_device_filename, "b", "8", "0")) {
+ warn "unable to create $block_device_filename";
+ return 0;
+ }
+ unlink $block_device_filename;
+
system("cp", "-r", "test/sys/", $udev_sys) && die "unable to copy test/sys";
system("rm", "-rf", "$udev_run");