"Fossies" - the Fresh Open Source Software Archive

Member "hitch-1.5.2/src/tests/test25-dynamic-backend-address.sh" (27 Aug 2019, 1146 Bytes) of package /linux/www/hitch-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 # NOTE: This test does not achieve as much as it was originally (see commentet out lines), as
    4 # - curl_hitch does not allow to parse the body. As Dridi is againts it.
    5 # - relying on the availability of hitch-tls.org and varnish-cache.org is not the best practice
    6 
    7 
    8 . hitch_test.sh
    9 
   10 echo "hitch_test hitch-tls.org" >hosts
   11 export HOSTALIASES=$PWD/hosts
   12 
   13 getent hosts hitch_test |
   14 grep -F hitch-tls.org ||
   15 skip "HOSTALIASES not supported"
   16 
   17 cat >hitch.cfg <<EOF
   18 pem-file = "${CERTSDIR}/default.example.com"
   19 frontend = "[localhost]:$LISTENPORT"
   20 backend = "[hitch_test]:80"
   21 backend-refresh = 1
   22 EOF
   23 
   24 start_hitch --config=hitch.cfg
   25 
   26 curl_hitch
   27 # TODO curl_hitch - cannot grep in output
   28 # curl --max-time 5  --insecure https://localhost:$LISTENPORT/ >backend_refresh1.dump 2>&1
   29 # run_cmd grep -q "<title>Hitch TLS proxy" backend_refresh1.dump
   30 
   31 echo "hitch_test varnish-cache.org" >hosts
   32 sleep 2
   33 
   34 CURL_STATUS=404
   35 curl_hitch
   36 # TODO curl_hitch - cannot grep in output
   37 # curl --max-time 5  --insecure https://localhost:$LISTENPORT/ >backend_refresh2.dump 2>&1
   38 # run_cmd grep -q "We moved the Varnish Project to a new server" backend_refresh2.dump
   39