common/rc: fix false positives due to leaked mkfs output to stderr
authorVladimir Zapolskiy <vladimir@tuxera.com>
Fri, 10 Jul 2020 14:13:50 +0000 (17:13 +0300)
committerEryu Guan <guaneryu@gmail.com>
Sun, 19 Jul 2020 16:51:42 +0000 (00:51 +0800)
The change fixes false positives reported by a few generic tests under
circumstances, when an mkfs utility prints its output to stderr and then it
appears in produced *.out files. The change is intended to fix such issues
in the tests, which utilize _require_scratch_swapfile().

Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index f17b19f2d4cbe1ae59d90cab2a078c31115715a3..1b7b25758d2592f979f8b4fe3f877205ddfe24da 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2311,7 +2311,7 @@ _require_scratch_swapfile()
        _require_scratch
        _require_command "$MKSWAP_PROG" "mkswap"
 
-       _scratch_mkfs >/dev/null
+       _scratch_mkfs >/dev/null 2>&1
 
        # With mounting SELinux context(e.g. system_u:object_r:root_t:s0),
        # standard mkswap tried to reset the type of default context to