From 68bb821e21d44e8dff86414fe0ae137ecdbc9934 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Apr 2021 10:34:53 +0200 Subject: [PATCH] TEST-46: simplify lossy diff invocation --- test/units/testsuite-46.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index 570780030be..d3f0f710434 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -9,17 +9,16 @@ if ! test -x /usr/bin/homectl ; then fi inspect() { - # As updating disk-size-related attributes can take some time on - # some filesystems, let's drop these fields before comparing the - # outputs to avoid unexpected fails. To see the full outputs of both - # homectl & userdbctl (for debugging purposes) drop the fields just - # before the comparison. - homectl inspect $1 | tee /tmp/a - userdbctl user $1 | tee /tmp/b - - local PATTERN='/^\s*Disk (Size|Free|Floor|Ceiling):/d' - diff <(sed -r "$PATTERN" /tmp/a) <(sed -r "$PATTERN" /tmp/b) - rm /tmp/a /tmp/b + # As updating disk-size-related attributes can take some time on some + # filesystems, let's drop these fields before comparing the outputs to + # avoid unexpected fails. To see the full outputs of both homectl & + # userdbctl (for debugging purposes) drop the fields just before the + # comparison. + homectl inspect $1 | tee /tmp/a + userdbctl user $1 | tee /tmp/b + + diff -I '/^\s*Disk (Size|Free|Floor|Ceiling):/' /tmp/{a,b} + rm /tmp/{a,b} } systemd-analyze log-level debug -- 2.47.3