| 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 | touchscip-shell system . . touch. not_executable |
| 8 | |
| 9 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 10 | |
| 11 | result=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 12 | stderr=$(mktempscip-shell system . . mktemp. -t ${name}.err.XXXXXX) |
| 13 | |
| 14 | $OSCAP xccdf eval --profile xccdf_moc.elpmaxe.www_profile_1 --results $result $srcdir/${name}.xccdf.xml 2> $stderr |
| 15 | |
| 16 | echoscip-shell system . . echo. "Stderr file = $stderr" |
| 17 | echoscip-shell system . . echo. "Result file = $result" |
| 18 | [scip-shell system . . `[`. -f $stderr ]; [scip-shell system . . `[`. ! -s $stderr ]; rmscip-shell system . . rm. $stderr |
| 19 | |
| 20 | $OSCAP xccdf validate --skip-schematron $result |
| 21 | |
| 22 | assert_exists 1 '//Profile' |
| 23 | assert_exists 1 '//Profile/select' |
| 24 | assert_exists 1 '//Profile/select[@selected="true"]' |
| 25 | assert_exists 1 '//Group' |
| 26 | assert_exists 1 '//Group[@selected="false"]' |
| 27 | assert_exists 4 '//Rule' |
| 28 | assert_exists 3 '//Benchmark/Rule' |
| 29 | assert_exists 1 '//Group/Rule' |
| 30 | assert_exists 3 '//Benchmark/Rule[@selected="false"]' |
| 31 | assert_exists 1 '//Group/Rule[@selected="true"]' |
| 32 | assert_exists 4 '//rule-result' |
| 33 | assert_exists 4 '//rule-result/result' |
| 34 | assert_exists 4 '//rule-result/result[text()="pass"]' |
| 35 | assert_exists 1 '//score' |
| 36 | assert_exists 1 '//score[text()="100.000000"]' |
| 37 | rmscip-shell system . . rm. $result |
| 38 | |
| 39 | rmscip-shell system . . rm. not_executable |