gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: add more tests


From: gnunet
Subject: [taler-exchange] branch master updated: add more tests
Date: Mon, 20 Jan 2020 11:38:55 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 92080dc8 add more tests
92080dc8 is described below

commit 92080dc8a481446737afe953cbd1c4f31c1bcb43
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 20 11:38:53 2020 +0100

    add more tests
---
 src/exchange/Makefile.am                           |  2 ++
 src/exchange/test_taler_exchange_httpd.get         | 27 ++++++++++++++++++++++
 ...e_httpd.data => test_taler_exchange_httpd.post} |  5 ++--
 src/exchange/test_taler_exchange_httpd.sh          | 15 ++++++++----
 4 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am
index dcaa1174..50eb545b 100644
--- a/src/exchange/Makefile.am
+++ b/src/exchange/Makefile.am
@@ -97,5 +97,7 @@ TESTS = \
 EXTRA_DIST = \
   
test_taler_exchange_httpd_home/.local/share/taler/exchange/offline-keys/master.priv
 \
   test_taler_exchange_httpd.conf \
+  test_taler_exchange_httpd.get \
+  test_taler_exchange_httpd.post \
   exchange.conf \
   $(check_SCRIPTS)
diff --git a/src/exchange/test_taler_exchange_httpd.get 
b/src/exchange/test_taler_exchange_httpd.get
new file mode 100644
index 00000000..28a9e9bc
--- /dev/null
+++ b/src/exchange/test_taler_exchange_httpd.get
@@ -0,0 +1,27 @@
+# This file is part of TALER
+# Copyright (C) 2020 Taler Systems SA
+#
+#  TALER is free software; you can redistribute it and/or modify it under the
+#  terms of the GNU Affero General Public License as published by the Free 
Software
+#  Foundation; either version 3, or (at your option) any later version.
+#
+#  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+#  A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more 
details.
+#
+#  You should have received a copy of the GNU Affero General Public License 
along with
+#  TALER; see the file COPYING.  If not, If not, see 
<http://www.gnu.org/licenses/>
+#
+#
+# This is a resource file for test_taler_exchange_httpd.sh.
+# Lines starting with '#' (must be first character in line) are comments.
+#
+# Each non-comment line must contain the URL on the HTTP server.
+#
+/
+/agpl
+/keys
+/robots.txt
+/terms
+/privacy
+/wire
diff --git a/src/exchange/test_taler_exchange_httpd.data 
b/src/exchange/test_taler_exchange_httpd.post
similarity index 60%
rename from src/exchange/test_taler_exchange_httpd.data
rename to src/exchange/test_taler_exchange_httpd.post
index a2ef959a..3b702d9d 100644
--- a/src/exchange/test_taler_exchange_httpd.data
+++ b/src/exchange/test_taler_exchange_httpd.post
@@ -27,7 +27,8 @@
 /deposit 
{"f":{"currency":"EUR","value":5,"fraction":0},"h_contract_terms":"NRT9E07FYT147V4VCDG0102P0YX0FZ11ZRG90F4X1HDV95M0J64ZVE4XQGNN9MJ3B5K3JX6TJ181KNGRYSZSTYZ5PQHBM1F9QKQ5B50","wire":{"bank":"dest_bank","type":"TEST","account":42},"timestamp":{"t_ms":1436823947},"coin_pub":"2KCPBGZ77VGJT4DG99EZAY0GQ5TJ89DF53FWYR5RFRTK0CCXRMFG","denom_pub":"51B7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8
 [...]
 #
 # missing coin_ev argument
-/withdraw/sign 
{"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH35452081
 [...]
+/reserve/withdraw 
{"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH35452
 [...]
 #
 # malformed coin_ev argument
-/withdraw/sign 
{"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH35452081
 [...]
+/reserve/withdraw 
{"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH35452
 [...]
+#
diff --git a/src/exchange/test_taler_exchange_httpd.sh 
b/src/exchange/test_taler_exchange_httpd.sh
index f25a634f..a6de7787 100755
--- a/src/exchange/test_taler_exchange_httpd.sh
+++ b/src/exchange/test_taler_exchange_httpd.sh
@@ -25,13 +25,16 @@ unset XDG_DATA_HOME
 unset XDG_CONFIG_HOME
 #
 echo -n "Launching exchange ..."
+PREFIX=
+# Uncomment this line to run with valgrind...
+#PREFIX="valgrind --leak-check=yes --track-fds=yes --error-exitcode=1 
--log-file=valgrind.%p"
 
 # Setup keys.
 taler-exchange-keyup -c test_taler_exchange_httpd.conf || exit 1
 # Setup wire accounts.
 taler-exchange-wire -c test_taler_exchange_httpd.conf > /dev/null || exit 1
 # Run Exchange HTTPD (in background)
-taler-exchange-httpd -c test_taler_exchange_httpd.conf -i 2> test-exchange.log 
&
+$PREFIX taler-exchange-httpd -c test_taler_exchange_httpd.conf -i 2> 
test-exchange.log &
 
 # Give HTTP time to start
 
@@ -51,10 +54,14 @@ fi
 echo " DONE"
 
 # Finally run test...
-# We read the JSON snippets to POST from test_taler_exchange_httpd.data
-cat test_taler_exchange_httpd.data | grep -v ^\# | awk '{ print "curl -d \47"  
$2 "\47 http://localhost:8081"; $1 }' | bash &> /dev/null
+echo -n "Running tests ..."
+# We read the JSON snippets to POST from test_taler_exchange_httpd.post
+cat test_taler_exchange_httpd.post | grep -v ^\# | awk '{ print "curl -d \47"  
$2 "\47 http://localhost:8081"; $1 }' | bash &> /dev/null
 
-echo "Terminating exchange"
+# We read the JSON snippets to GET from test_taler_exchange_httpd.get
+cat test_taler_exchange_httpd.get | grep -v ^\# | awk '{ print "curl 
http://localhost:8081"; $1 }' | bash &> /dev/null
+
+echo " DONE"
 # $! is the last backgrounded process, hence the exchange
 kill -TERM $!
 wait $!

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]