Debian Codegraph @

tests/curl/test_curl_encoding.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2
3 set -e -o pipefail
4
5 . $builddir/tests/test_common.sh
6
7 function 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 || echo "OK"
16
17 case $(uname) in
18 FreeBSD)
19 grep -iE "Accept-Encoding.*gzip" "$LOG"
20 ;;
21 *)
22 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