HomeClusterLabs Projects

Test: cts-cli: Check xmllint error code in _test_assert()

Description

Test: cts-cli: Check xmllint error code in _test_assert()

Currently, sed hides any nonzero error code that xmllint may return in
_test_assert(). For example:

$ xmllint --noout --relaxng xml/api/asdf.rng /tmp/test1.out
warning: failed to load external entity "xml/api/asdf.rng"
Relax-NG parser error : xmlRelaxNGParse: could not load xml/api/asdf.rng
Relax-NG schema xml/api/asdf.rng failed to compile

$ echo $?
5

$ xmllint --noout --relaxng xml/api/asdf.rng /tmp/test1.out | sed -n '/validates$/ !p'
warning: failed to load external entity "xml/api/asdf.rng"
Relax-NG parser error : xmlRelaxNGParse: could not load xml/api/asdf.rng
Relax-NG schema xml/api/asdf.rng failed to compile

$ echo $?
0

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Sep 15 2022, 3:25 AM
Parents
rP08d32b36fd9a: Test: cts-cli: Use temp file for test_assert stdout
Branches
Unknown
Tags
Unknown