donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

test_donau_httpd.sh (2032B)


      1 #!/bin/bash
      2 #
      3 # This file is part of TALER
      4 # Copyright (C) 2015-2020, 2023 Taler Systems SA
      5 #
      6 #  TALER is free software; you can redistribute it and/or modify it under the
      7 #  terms of the GNU Affero General Public License as published by the Free Software
      8 #  Foundation; either version 3, or (at your option) any later version.
      9 #
     10 #  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     11 #  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     12 #  A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
     13 #
     14 #  You should have received a copy of the GNU Affero General Public License along with
     15 #  TALER; see the file COPYING.  If not, If not, see <http://www.gnu.org/licenses/>
     16 #
     17 #
     18 # This script uses 'curl' to POST various ill-formed requests to the
     19 # donau-httpd.  Basically, the goal is to make sure that the
     20 # HTTP server survives (and produces the 'correct' error code).
     21 #
     22 #
     23 # Clear environment from variables that override config.
     24 unset XDG_DATA_HOME
     25 unset XDG_CONFIG_HOME
     26 
     27 set -eu
     28 #
     29 echo -n "Launching donau ..."
     30 
     31 . setup.sh
     32 
     33 # Setup database
     34 setup -c "test_donau_httpd.conf" \
     35       -D \
     36  
     37 # Finally run test...
     38 echo -n "Running tests ..."
     39 # We read the JSON snippets to GET from test_donau_httpd.get
     40 cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl http://localhost:8089" $1 }' | bash &> /dev/null
     41 echo -n .
     42 # Also try them with various headers: Language
     43 cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept-Language: fr,en;q=0.4,de\" http://localhost:8089" $1 }' | bash &> /dev/null
     44 echo -n .
     45 # Also try them with various headers: Accept encoding (wildcard #1)
     46 cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept: text/*\" http://localhost:8089" $1 }' | bash &> /dev/null
     47 echo -n .
     48 # Also try them with various headers: Accept encoding (wildcard #2)
     49 cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept: */plain\" http://localhost:8089" $1 }' | bash &> /dev/null
     50 
     51 echo " DONE"
     52 exit 0
     53