From 7935dae547caf164d807237f1009a9e9fa510337 Mon Sep 17 00:00:00 2001 From: Alexey Bogdanenko Date: Sat, 8 Dec 2018 11:02:30 +0300 Subject: [PATCH 1/2] udev-test: fix test skip condition When there is a failure to setup the environment, the following happens: 1. Command "./test-udev check" exits with non-zero code. 2. Perl function "system" returns the code. 3. The code is evaluated as true by Perl. Then we stop the test. --- test/udev-test.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/udev-test.pl b/test/udev-test.pl index aa38bae0b1..3517feab15 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1661,7 +1661,7 @@ if (!udev_setup()) { exit($EXIT_TEST_SKIP); } -if (!system($udev_bin, "check")) { +if (system($udev_bin, "check")) { warn "$udev_bin failed to set up the environment, skipping the test"; exit($EXIT_TEST_SKIP); } From 1e5548c0e0962424b6ca5fdfd35c866b70760c8f Mon Sep 17 00:00:00 2001 From: Alexey Bogdanenko Date: Sat, 8 Dec 2018 15:35:30 +0300 Subject: [PATCH 2/2] udev-test: fix missing directory test/run Fixes the following error: Failed to mount test /run: No such file or directory By the time command "./test-udev check" calls function "fake_filesystems", directory "test/run" must be present. --- test/udev-test.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/udev-test.pl b/test/udev-test.pl index 3517feab15..eb76ebd72e 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1558,6 +1558,11 @@ sub udev_setup { system("rm", "-rf", "$udev_run"); + if (!mkdir($udev_run)) { + warn "unable to create directory $udev_run"; + return 0; + } + return 1; }