diff options
author | Casaburi Johannes <johannes.casaburi@students.bfh.ch> | 2024-04-26 01:07:52 +0200 |
---|---|---|
committer | Casaburi Johannes <johannes.casaburi@students.bfh.ch> | 2024-04-26 01:07:52 +0200 |
commit | b3f6e5995126f9af62fe45c3396dbe80874e41a5 (patch) | |
tree | fa30b10a3da62a144aca07e3dd628d4fc9847f78 | |
parent | 7899ba706aee4ae7e51ff9f832306d2358c1b37f (diff) | |
download | donau-b3f6e5995126f9af62fe45c3396dbe80874e41a5.tar.gz donau-b3f6e5995126f9af62fe45c3396dbe80874e41a5.tar.bz2 donau-b3f6e5995126f9af62fe45c3396dbe80874e41a5.zip |
work on tests
-rw-r--r-- | src/donau/Makefile.am | 7 | ||||
-rw-r--r-- | src/donau/test_donau_httpd.conf | 22 | ||||
-rwxr-xr-x | src/donau/test_donau_httpd.sh | 30 | ||||
-rw-r--r-- | src/pq/Makefile.am | 2 |
4 files changed, 25 insertions, 36 deletions
diff --git a/src/donau/Makefile.am b/src/donau/Makefile.am index 26bd457..4b09293 100644 --- a/src/donau/Makefile.am +++ b/src/donau/Makefile.am @@ -53,14 +53,11 @@ donau_httpd_SOURCES = \ # Testcases +AM_TESTS_ENVIRONMENT=export DONAU_PREFIX=$${DONAU_PREFIX:-@libdir@};export PATH=$${DONAU_PREFIX:-@prefix@}/bin:$$PATH; + check_SCRIPTS = \ test_donau_httpd.sh -if HAVE_EXPENSIVE_TESTS -check_SCRIPTS += \ - test_donau_httpd_afl.sh -endif -.NOTPARALLEL: TESTS = \ $(check_SCRIPTS) diff --git a/src/donau/test_donau_httpd.conf b/src/donau/test_donau_httpd.conf index 3d758e7..e37189a 100644 --- a/src/donau/test_donau_httpd.conf +++ b/src/donau/test_donau_httpd.conf @@ -1,7 +1,7 @@ [PATHS] # Persistent data storage for the testcase -TALER_TEST_HOME = test_taler_donau_httpd_home/ -TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/${USER:-}/taler-system-runtime/ +TALER_TEST_HOME = test_donau_httpd_home/ +TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/${USER:-}/donau-system-runtime/ [taler] # Currency supported by the exchange (can only be one) @@ -9,6 +9,9 @@ CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 [donau] +# Base url of the Donau +DOMAIN = "Bern" +BASE_URL = "http://localhost:8080/" # Directory with our terms of service. TERMS_DIR = ../../contrib/tos @@ -24,7 +27,6 @@ PRIVACY_DIR = ../../contrib/pp # Etag / filename for the privacy policy. PRIVACY_ETAG = 0 -# MAX_REQUESTS = 2 # how long is one signkey valid? SIGNKEY_DURATION = 4 weeks @@ -35,9 +37,6 @@ LOOKAHEAD_SIGN = 32 weeks 1 day # HTTP port the donau listens to PORT = 8081 -# Master public key used to sign the donau's various keys -MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG - # How to access our database DB = postgres @@ -58,17 +57,6 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks [donaudb-postgres] CONFIG = "postgres:///donaucheck" -[donau-account-1] -PAYTO_URI = "payto://x-taler-bank/localhost:8082/3" -ENABLE_DEBIT = YES -ENABLE_CREDIT = YES - -[donau-accountcredentials-1] -WIRE_GATEWAY_AUTH_METHOD = basic -USERNAME = Donau -PASSWORD = x -WIRE_GATEWAY_URL = "http://localhost:8082/3/" - # Coins for the tests. [coin_eur_ct_1_rsa] value = EUR:0.01 diff --git a/src/donau/test_donau_httpd.sh b/src/donau/test_donau_httpd.sh index 82484ad..c33e71a 100755 --- a/src/donau/test_donau_httpd.sh +++ b/src/donau/test_donau_httpd.sh @@ -16,7 +16,7 @@ # # # This script uses 'curl' to POST various ill-formed requests to the -# taler-donau-httpd. Basically, the goal is to make sure that the +# donau-httpd. Basically, the goal is to make sure that the # HTTP server survives (and produces the 'correct' error code). # # @@ -27,23 +27,25 @@ unset XDG_CONFIG_HOME set -eu # echo -n "Launching donau ..." -PREFIX= + +# FIXME +exit 77 + # Uncomment this line to run with valgrind... -#PREFIX="valgrind --leak-check=yes --track-fds=yes --error-exitcode=1 --log-file=valgrind.%p" +PREFIX="valgrind --leak-check=yes --track-fds=yes --error-exitcode=1 --log-file=valgrind.%p" # Setup database -taler-donau-dbinit -c test_taler_donau_httpd.conf &> /dev/null || exit 77 +donau-dbinit -c test_donau_httpd.conf &> /dev/null || exit 77 # Run Donau HTTPD (in background) -$PREFIX taler-donau-httpd -c test_taler_donau_httpd.conf 2> test-donau.log & +$PREFIX donau-httpd -c test_donau_httpd.conf 2> test-donau.log & # Give HTTP time to start - for n in `seq 1 100` do echo -n "." sleep 0.1 OK=1 - wget http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null && break + wget http://localhost:8080/config -o /dev/null -O /dev/null >/dev/null && break OK=0 done if [ 1 != $OK ] @@ -58,20 +60,20 @@ echo " DONE" # Finally run test... echo -n "Running tests ..." -# We read the JSON snippets to POST from test_taler_donau_httpd.post -cat test_taler_donau_httpd.post | grep -v ^\# | awk '{ print "curl -d \47" $2 "\47 http://localhost:8081" $1 }' | bash &> /dev/null +# We read the JSON snippets to POST from test_donau_httpd.post +cat test_donau_httpd.post | grep -v ^\# | awk '{ print "curl -d \47" $2 "\47 http://localhost:8080" $1 }' | bash &> /dev/null echo -n . -# We read the JSON snippets to GET from test_taler_donau_httpd.get -cat test_taler_donau_httpd.get | grep -v ^\# | awk '{ print "curl http://localhost:8081" $1 }' | bash &> /dev/null +# We read the JSON snippets to GET from test_donau_httpd.get +cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl http://localhost:8080" $1 }' | bash &> /dev/null echo -n . # Also try them with various headers: Language -cat test_taler_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept-Language: fr,en;q=0.4,de\" http://localhost:8081" $1 }' | bash &> /dev/null +cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept-Language: fr,en;q=0.4,de\" http://localhost:8080" $1 }' | bash &> /dev/null echo -n . # Also try them with various headers: Accept encoding (wildcard #1) -cat test_taler_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept: text/*\" http://localhost:8081" $1 }' | bash &> /dev/null +cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept: text/*\" http://localhost:8080" $1 }' | bash &> /dev/null echo -n . # Also try them with various headers: Accept encoding (wildcard #2) -cat test_taler_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept: */plain\" http://localhost:8081" $1 }' | bash &> /dev/null +cat test_donau_httpd.get | grep -v ^\# | awk '{ print "curl -H \"Accept: */plain\" http://localhost:8080" $1 }' | bash &> /dev/null echo " DONE" # $! is the last backgrounded process, hence the donau diff --git a/src/pq/Makefile.am b/src/pq/Makefile.am index 540549a..dca8271 100644 --- a/src/pq/Makefile.am +++ b/src/pq/Makefile.am @@ -26,6 +26,8 @@ libdonaupq_la_LDFLAGS = \ check_PROGRAMS= \ test_pq +AM_TESTS_ENVIRONMENT=export DONAU_PREFIX=$${DONAU_PREFIX:-@libdir@};export PATH=$${DONAU_PREFIX:-@prefix@}/bin:$$PATH; + TESTS = \ $(check_PROGRAMS) |