teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0513-udev-test-fix-test-skip-condition.patch

bd1529
From f44fcdde656036f0388fc8244b8960c1873a3a08 Mon Sep 17 00:00:00 2001
bd1529
From: Alexey Bogdanenko <alexey@bogdanenko.com>
bd1529
Date: Sat, 8 Dec 2018 11:02:30 +0300
bd1529
Subject: [PATCH] udev-test: fix test skip condition
bd1529
bd1529
When there is a failure to setup the environment, the following happens:
bd1529
bd1529
1. Command "./test-udev check" exits with non-zero code.
bd1529
2. Perl function "system" returns the code.
bd1529
3. The code is evaluated as true by Perl.
bd1529
bd1529
Then we stop the test.
bd1529
bd1529
(cherry picked from commit 7935dae547caf164d807237f1009a9e9fa510337)
bd1529
bd1529
Related: #1642728
bd1529
---
bd1529
 test/udev-test.pl | 2 +-
bd1529
 1 file changed, 1 insertion(+), 1 deletion(-)
bd1529
bd1529
diff --git a/test/udev-test.pl b/test/udev-test.pl
bd1529
index aa38bae0b1..3517feab15 100755
bd1529
--- a/test/udev-test.pl
bd1529
+++ b/test/udev-test.pl
bd1529
@@ -1661,7 +1661,7 @@ if (!udev_setup()) {
bd1529
         exit($EXIT_TEST_SKIP);
bd1529
 }
bd1529
 
bd1529
-if (!system($udev_bin, "check")) {
bd1529
+if (system($udev_bin, "check")) {
bd1529
         warn "$udev_bin failed to set up the environment, skipping the test";
bd1529
         exit($EXIT_TEST_SKIP);
bd1529
 }