diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:40:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:40:13 +0000 |
commit | e9be59e1502a41bab9891d96d753102a7dafef0b (patch) | |
tree | c3b2da87c414881f4b53d0964f407c83492d813e /lrm/test/testcases/xmllint.sh | |
parent | Initial commit. (diff) | |
download | cluster-glue-e9be59e1502a41bab9891d96d753102a7dafef0b.tar.xz cluster-glue-e9be59e1502a41bab9891d96d753102a7dafef0b.zip |
Adding upstream version 1.0.12.upstream/1.0.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lrm/test/testcases/xmllint.sh')
-rwxr-xr-x | lrm/test/testcases/xmllint.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lrm/test/testcases/xmllint.sh b/lrm/test/testcases/xmllint.sh new file mode 100755 index 0000000..f61288c --- /dev/null +++ b/lrm/test/testcases/xmllint.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +gawk -v many="$1" ' +BEGIN{XMLLINT="xmllint --noout -";} +function chkoutput(ra) { + if( ra=="" ) return; + if( close(XMLLINT) ) # we need gawk for this + print "xmllint reported error in RA:",ra; +} +many=="many" && /^[a-zA-Z][^:]*:[a-zA-Z0-9]+$/ { + chkoutput(ra); + ra=$0; + next; +} +{ print | XMLLINT } +END{ + if( many!="many" ) + chkoutput("noname"); +} +' |