| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | . $builddir/tests/test_common.sh |
| 3 | |
| 4 | set -e |
| 5 | set -o pipefail |
| 6 | |
| 7 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 8 | |
| 9 | result=$name.oval.xml-0.variables-0.xml |
| 10 | stderr=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 11 | |
| 12 | $OSCAP xccdf eval --profile test2 --export-variable $srcdir/${name}.xccdf.xml 2> $stderr |
| 13 | |
| 14 | echoscip-shell system . . echo. "Stderr file = $stderr" |
| 15 | echoscip-shell system . . echo. "Result file = $result" |
| 16 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ] |
| 17 | |
| 18 | assert_exists 1 '//variable[@id="oval:ssg:var:1"]/value[text()="600"]' |
| 19 | assert_exists 1 '//variable[@id="oval:ssg:var:2"]/value[text()="300"]' |
| 20 | assert_exists 1 '//variable[@id="oval:ssg:var:3"]/value[text()="600"]' |
| 21 | :> $result |
| 22 | |
| 23 | $OSCAP xccdf eval --profile test2_tailored --export-variables \ |
| 24 | --tailoring-file $srcdir/${name}.tailoring.xml $srcdir/${name}.xccdf.xml 2> $stderr |
| 25 | |
| 26 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr |
| 27 | assert_exists 1 '//variable[@id="oval:ssg:var:1"]/value[text()="600"]' |
| 28 | assert_exists 1 '//variable[@id="oval:ssg:var:2"]/value[text()="300"]' |
| 29 | assert_exists 1 '//variable[@id="oval:ssg:var:3"]/value[text()="600"]' |
| 30 | |
| 31 | rmscip-shell system . . rm. $result |
| 32 |