mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
TEST-46: simplify lossy diff invocation
This commit is contained in:
parent
b9bfa250f2
commit
68bb821e21
@ -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
|
||||
# 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
|
||||
diff -I '/^\s*Disk (Size|Free|Floor|Ceiling):/' /tmp/{a,b}
|
||||
rm /tmp/{a,b}
|
||||
}
|
||||
|
||||
systemd-analyze log-level debug
|
||||
|
Loading…
x
Reference in New Issue
Block a user