| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | set -e -o pipefail |
| 4 | |
| 5 | . $builddir/tests/test_common.sh |
| 6 | |
| 7 | function curl_accept_encodingscip-shell shell shell-project 0.0.0 curl_accept_encoding(). { |
| 8 | # --fetch-remote-resources uses internet |
| 9 | require_internet || return 255 |
| 10 | |
| 11 | local DF="${srcdir}/ds.xml" |
| 12 | local RF="results.xml" |
| 13 | local LOG="verbose.log" |
| 14 | |
| 15 | $OSCAP xccdf --verbose=DEVEL eval --fetch-remote-resources --results $RF $DF 2>$LOG || echoscip-shell system . . echo. "OK" |
| 16 | |
| 17 | case $(unamescip-shell system . . uname.) in |
| 18 | FreeBSD) |
| 19 | grepscip-shell system . . grep. -iE "Accept-Encoding.*gzip" "$LOG" |
| 20 | ;; |
| 21 | *) |
| 22 | grepscip-shell system . . grep. -iP "Accept-Encoding.*gzip" "$LOG" |
| 23 | ;; |
| 24 | esac || die "Couldn't assert gzip encoding in the log: $(grep -i 'curl header' $LOG)" |
| 25 | |
| 26 | return 0 |
| 27 | } |
| 28 | |
| 29 | test_init |
| 30 | |
| 31 | test_run "cURL: Accept-Encoding" curl_accept_encoding |
| 32 | |
| 33 | test_exit |