test: create /dev/null in test-udev.pl
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 22 Oct 2018 22:23:01 +0000 (07:23 +0900)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 25 Jan 2021 14:05:18 +0000 (15:05 +0100)
(cherry picked from commit a41ff38b0999fb83464309a29b8f39450b8d4b85)

Related: #1642728

test/udev-test.pl

index 0433629c7c9d7429a21a1b23588850fd9309b892..a1c24f49b47537f7a4277fa93b14225c59e10dc0 100755 (executable)
@@ -1537,13 +1537,14 @@ sub udev_setup {
         system("umount", $udev_tmpfs);
         rmdir($udev_tmpfs);
         mkdir($udev_tmpfs) || die "unable to create udev_tmpfs: $udev_tmpfs\n";
-        system("mount", "-o", "rw,mode=755,nosuid,noexec,nodev", "-t", "tmpfs", "tmpfs", $udev_tmpfs) && die "unable to mount tmpfs";
+        system("mount", "-o", "rw,mode=755,nosuid,noexec", "-t", "tmpfs", "tmpfs", $udev_tmpfs) && die "unable to mount tmpfs";
 
         mkdir($udev_dev) || die "unable to create udev_dev: $udev_dev\n";
         # setting group and mode of udev_dev ensures the tests work
         # even if the parent directory has setgid bit enabled.
         chown (0, 0, $udev_dev) || die "unable to chown $udev_dev\n";
         chmod (0755, $udev_dev) || die "unable to chmod $udev_dev\n";
+        system("mknod", $udev_dev . "/null", "c", "1", "3") && "unable to create $udev_dev/null";
 
         system("cp", "-r", "test/sys/", $udev_sys) && die "unable to copy test/sys";