diff options
Diffstat (limited to 'debian/tests/metadata')
-rwxr-xr-x | debian/tests/metadata | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/tests/metadata b/debian/tests/metadata new file mode 100755 index 0000000..21c1ece --- /dev/null +++ b/debian/tests/metadata @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +TMPXML=$AUTOPKGTEST_TMP/xml + +for agent in /usr/sbin/fence_*; do + [ "$agent" = "/usr/sbin/fence_ack_manual" ] && continue + + printf '\nTesting %s...\n' "$agent" + $agent -o metadata > "$TMPXML" 2> /dev/null + cat "$TMPXML" + + TESTXML=tests/data/metadata/${agent##*/}.xml + if [ -f "$TESTXML" ]; then + gawk 'BEGIN {store=-1} /name=".*_path"/ || /name=".*_file"/ {store=2} {if (store!=0) {print}; store--}' "$TMPXML" \ + | diff -u "$TESTXML" - + fi + + xsltproc lib/fence2rng.xsl "$TMPXML" \ + | sed -e 's/ rha:description=/ description=/g' -e 's/ rha:name=/ name=/g' \ + | xmllint --nsclean --noout - +done |