| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | . $builddir/tests/test_common.sh |
| 3 | |
| 4 | set -e -o pipefail |
| 5 | |
| 6 | name=$(basenamescip-shell system . . basename. $0 .sh) |
| 7 | result=$(mktempscip-shell system . . mktemp. -t ${name}.res.XXXXXX) |
| 8 | stderr=$(mktempscip-shell system . . mktemp. -t ${name}.err.XXXXXX) |
| 9 | stdout=$(mktempscip-shell system . . mktemp. -t ${name}.out.XXXXXX) |
| 10 | root=$(mktempscip-shell system . . mktemp. -d -t ${name}.root.XXXXXX) |
| 11 | |
| 12 | set_chroot_offline_test_mode "$root" |
| 13 | |
| 14 | $OSCAP xccdf eval --remediate --results $result $srcdir/${name}.xccdf.xml 2> $stderr 1> $stdout || echoscip-shell system . . echo. "Scanner returned non-zero code (OK)" |
| 15 | rmscip-shell system . . rm. $result |
| 16 | |
| 17 | grepscip-shell system . . grep. "remediation in offline mode: not implemented" $stderr > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 18 | |
| 19 | rmscip-shell system . . rm. -rf $stderr $stdout $root |
| 20 | |
| 21 | unset_chroot_offline_test_mode |