Files
snapd/tests/main/interfaces-libvirt
Maciej Borzecki 84aac46c55 tests: fix use of MATCH -v
MATCH is a wrapper around grep -E -q, thus MATCH -v ends up being grep -E -q -v.
However, grep -v is peculiar as far as exit codes are concerned, and returns 0
when lines not matching the pattern were found in the input.

For example, this command returns 1:

$ cat <<EOF | grep -E -v foo
foo
foo
foo
EOF

but this one returns 0, even though the pattern we don't want is in the input:

cat <<EOF | grep -E -v foo; echo $?
foo
bar
baz
EOF

In the tests, MATCH -v is used to check that the pattern does not appear in the
input, which is incorrect.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2019-12-17 12:11:57 +01:00
..
2019-12-17 12:11:57 +01:00