Debian Codegraph @

tests/API/XCCDF/unittests/test_report_without_xsl_fails_gracefully.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2 . $builddir/tests/test_common.sh
3
4 set -e
5 set -o pipefail
6
7 name=$(basename $0 .sh)
8
9 result=$(mktemp -t ${name}.output.XXXXXX)
10 stderr=$(mktemp -t ${name}.stderr.XXXXXX)
11 stdout=$(mktemp -t ${name}.stdout.XXXXXX)
12
13 # We cannot simply unset, because there still might be a non empty system wide location.
14 # We can set some nonsence instead.
15 OSCAP_XSLT_PATH=/blah
16 export OSCAP_XSLT_PATH
17 $OSCAP xccdf generate report --output $result $srcdir/test_report_check_with_empty_selector.xccdf.xml.result.xml 2> $stderr > $stdout || [ $? == 1 ]
18
19 echo "Stdout file = $stdout"
20 echo "Stderr file = $stderr"
21 echo "Result file = $result"
22 [ -f $stdout ]; [ ! -s $stdout ]; rm $stdout
23 [ -f $result ]; [ ! -s $result ]; rm $result
24 [ -f $stderr ]; grep "XSLT file 'xccdf-report.xsl' not found in path" $stderr; rm $stderr