commit a93db26de5a8f5a2b756f3790cca61385787005f
parent 9edc884e360e3363ed6dff6bfe13f037f879432e
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 4 May 2016 13:47:08 +0200
Fixing config setup
Diffstat:
10 files changed, 141 insertions(+), 249 deletions(-)
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
@@ -52,4 +52,7 @@ test_merchant_api_LDADD = \
-ljansson
EXTRA_DIST = \
- test_merchant.conf
+ test_merchant_api.conf \
+ test_merchant_api_home/.local/share/taler/exchange/offline-keys/master.priv \
+ test_merchant_api_home/.config/taler/merchant/wire/test.json \
+ test_merchant.priv
diff --git a/src/lib/test-exchange-home/config/exchange-common.conf b/src/lib/test-exchange-home/config/exchange-common.conf
@@ -1,30 +0,0 @@
-[exchange]
-# Currency supported by the exchange (can only be one)
-CURRENCY = EUR
-
-# Wire format supported by the exchange
-# We use 'test' for testing of the actual
-# coin operations, and 'sepa' to test SEPA-specific routines.
-WIREFORMAT = test sepa
-
-# HTTP port the exchange listens to
-PORT = 8081
-
-# Master public key used to sign the exchange's various keys
-MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
-
-# How to access our database
-DB = postgres
-
-# Is this is a testcase, use transient DB actions?
-TESTRUN = YES
-
-[exchangedb-postgres]
-
-DB_CONN_STR = "postgres:///talercheck"
-
-[exchange-wire-sepa]
-SEPA_RESPONSE_FILE = "test-exchange-home/sepa.json"
-
-[exchange-wire-test]
-REDIRECT_URL = "http://www.taler.net/"
diff --git a/src/lib/test-exchange-home/config/exchange-keyup.conf b/src/lib/test-exchange-home/config/exchange-keyup.conf
@@ -1,86 +0,0 @@
-[exchange_keys]
-
-# how long is one signkey valid?
-signkey_duration = 4 weeks
-
-# how long are the signatures with the signkey valid?
-legal_duration = 2 years
-
-# how long do we generate denomination and signing keys
-# ahead of time?
-lookahead_sign = 32 weeks 1 day
-
-# how long do we provide to clients denomination and signing keys
-# ahead of time?
-lookahead_provide = 4 weeks 1 day
-
-
-# Coin definitions are detected because the section
-# name begins with "coin_". The rest of the
-# name is free, but of course following the convention
-# of "coin_$CURRENCY[_$SUBUNIT]_$VALUE" make sense.
-[coin_eur_ct_1]
-value = EUR:0.01
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.00
-fee_deposit = EUR:0.00
-fee_refresh = EUR:0.01
-rsa_keysize = 1024
-
-[coin_eur_ct_10]
-value = EUR:0.10
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_1]
-value = EUR:1
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_5]
-value = EUR:5
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_10]
-value = EUR:10
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 1024
-
-[coin_eur_1000]
-value = EUR:1000
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-rsa_keysize = 2048
diff --git a/src/lib/test-exchange-home/master.priv b/src/lib/test-exchange-home/master.priv
@@ -1 +0,0 @@
-p^-33XX!\0qmU_
-\ No newline at end of file
diff --git a/src/lib/test-exchange-home/sepa.json b/src/lib/test-exchange-home/sepa.json
@@ -1,6 +0,0 @@
-{
- "receiver_name": "Max Mustermann",
- "iban": "DE89370400440532013000",
- "bic": "COBADEFF370",
- "sig": "8M5YJXM68PRAXKH76HYEBCJW657B23JA0RFGNDMZK2379YZMT626H1BN89KC0M1KJBWGYEN5Z763Q0Y7MCTZQ6BPPT7D9KFCTW60C10"
-}
-\ No newline at end of file
diff --git a/src/lib/test_merchant.conf b/src/lib/test_merchant.conf
@@ -1,118 +0,0 @@
-# This file is in the public domain.
-#
-[PATHS]
-# Persistant data storage for the testcase
-TALER_TEST_HOME = test_exchange_api_home/
-
-[merchant]
-
-# Which port do we run the backend on? (HTTP server)
-PORT = 8082
-
-# FIXME: is this one used?
-HOSTNAME = localhost
-
-# Where is our private key?
-KEYFILE = test_merchant.priv
-
-# What currency does this backend accept?
-CURRENCY = EUR
-
-# How quickly do we want the exchange to send us our money?
-# Used only if the frontend does not specify a value.
-# FIXME: EDATE is a bit short, 'execution_delay'?
-EDATE = 3 week
-
-# Which plugin (backend) do we use for the DB.
-DB = postgres
-
-[exchange-taler]
-URI = http://localhost:8081/
-MASTER_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
-
-# Auditors must be in sections "auditor-", the rest of the section
-# name could be anything.
-[auditor-ezb]
-# Informal name of the auditor. Just for the user.
-NAME = European Central Bank
-
-# URI of the auditor (especially for in the future, when the
-# auditor offers an automated issue reporting system).
-# Not really used today.
-URI = http://taler.ezb.eu/
-
-# This is the important bit: the signing key of the auditor.
-PUBLIC_KEY = 9QXF7XY7E9VPV47B5Z806NDFSX2VJ79SVHHD29QEQ3BG31ANHZ60
-
-# This specifies which database we use.
-[merchantdb-postgres]
-CONFIG = postgres:///talercheck
-
-# "wire-" sections include wire details, here for SEPA.
-[wire-sepa]
-IBAN = DE67830654080004822650
-NAME = GNUNET E.V
-BIC = GENODEF1SRL
-SALT = 17919252168512238964
-ADDRESS = "Garching"
-
-
-[exchange]
-# How to access our database
-DB = postgres
-# HTTP port the exchange listens to
-PORT = 8081
-# Wire format supported by the exchange
-WIREFORMAT = test
-
-
-
-[exchangedb-postgres]
-DB_CONN_STR = "postgres:///talercheck"
-
-[exchange-wire-incoming-test]
-# This is the response we give out for the /wire request. It provides
-# wallets with the bank information for transfers to the exchange.
-TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/test.json
-
-[exchange-wire-outgoing-test]
-# What is the main website of the bank?
-BANK_URI = "http://localhost:8082/"
-# Into which account at the 'bank' should (incoming) wire transfers be made?
-BANK_ACCOUNT_NUMBER = 2
-
-[coin_eur_ct_1]
-value = EUR:0.01
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.00
-fee_deposit = EUR:0.00
-fee_refresh = EUR:0.01
-fee_refund = EUR:0.01
-rsa_keysize = 1024
-
-[coin_eur_ct_10]
-value = EUR:0.10
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-fee_refund = EUR:0.01
-rsa_keysize = 1024
-
-[coin_eur_1]
-value = EUR:1
-duration_overlap = 5 minutes
-duration_withdraw = 7 days
-duration_spend = 2 years
-duration_legal = 3 years
-fee_withdraw = EUR:0.01
-fee_deposit = EUR:0.01
-fee_refresh = EUR:0.03
-fee_refund = EUR:0.01
-rsa_keysize = 1024
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
@@ -1320,7 +1320,7 @@ run (void *cls)
{ .oc = OC_ADMIN_ADD_INCOMING,
.label = "create-reserve-1",
.expected_response_code = MHD_HTTP_OK,
- .details.admin_add_incoming.wire = "{ \"type\":\"TEST\", \"bank\":\"source bank\", \"account\":42 }",
+ .details.pay.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account\":62 }",
.details.admin_add_incoming.amount = "EUR:5.01" },
/* Withdraw a 5 EUR coin, at fee of 1 ct */
{ .oc = OC_WITHDRAW_SIGN,
@@ -1344,7 +1344,7 @@ run (void *cls)
.details.pay.coin_ref = "withdraw-coin-1",
.details.pay.amount_with_fee = "EUR:5",
.details.pay.amount_without_fee = "EUR:4.99",
- .details.pay.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.pay.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account\":62 }",
.details.pay.contract = "{ \"items\":[ {\"name\":\"ice cream\", \"value\":1} ] }",
.details.pay.transaction_id = 1 },
@@ -1357,7 +1357,7 @@ run (void *cls)
.details.pay.coin_ref = "withdraw-coin-1",
.details.pay.amount_with_fee = "EUR:5",
.details.pay.amount_without_fee = "EUR:4.99",
- .details.pay.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":43 }",
+ .details.pay.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account\":62 }",
.details.pay.contract = "{ \"items\":[{ \"name\":\"ice cream\", \"value\":1} ] }",
.details.pay.transaction_id = 1 },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
@@ -1370,7 +1370,7 @@ run (void *cls)
.details.pay.coin_ref = "withdraw-coin-1",
.details.pay.amount_with_fee = "EUR:5",
.details.pay.amount_without_fee = "EUR:4.99",
- .details.pay.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.pay.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account\":62 }",
.details.pay.contract = "{ \"items\":[ {\"name\":\"ice cream\", \"value\":1} ] }",
.details.pay.transaction_id = 2 },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
@@ -1383,7 +1383,7 @@ run (void *cls)
.details.pay.coin_ref = "withdraw-coin-1",
.details.pay.amount_with_fee = "EUR:5",
.details.pay.amount_without_fee = "EUR:4.99",
- .details.pay.wire_details = "{ \"type\":\"TEST\", \"bank\":\"dest bank\", \"account\":42 }",
+ .details.pay.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost/\", \"account\":62 }",
.details.pay.contract = "{ \"items\":[ {\"name\":\"ice cream\", \"value\":2} ] }",
.details.pay.transaction_id = 1 },
@@ -1429,6 +1429,8 @@ main (int argc,
struct GNUNET_OS_Process *exchanged;
struct GNUNET_OS_Process *merchantd;
+ unsetenv ("XDG_DATA_HOME");
+ unsetenv ("XDG_CONFIG_HOME");
GNUNET_log_setup ("test-merchant-api",
"WARNING",
NULL);
diff --git a/src/lib/test_merchant_api.conf b/src/lib/test_merchant_api.conf
@@ -0,0 +1,123 @@
+# This file is in the public domain.
+#
+[PATHS]
+# Persistant data storage for the testcase
+TALER_TEST_HOME = test_merchant_api_home/
+
+[merchant]
+
+# Which port do we run the backend on? (HTTP server)
+PORT = 8082
+
+# FIXME: is this one used?
+HOSTNAME = localhost
+
+# Where is our private key?
+KEYFILE = test_merchant.priv
+
+# What currency does this backend accept?
+CURRENCY = EUR
+
+# How quickly do we want the exchange to send us our money?
+# Used only if the frontend does not specify a value.
+# FIXME: EDATE is a bit short, 'execution_delay'?
+EDATE = 3 week
+
+# Which plugin (backend) do we use for the DB.
+DB = postgres
+
+# Which wireformat do we use?
+WIREFORMAT = test
+
+[exchange-taler]
+URI = http://localhost:8081/
+MASTER_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+
+
+
+# Auditors must be in sections "auditor-", the rest of the section
+# name could be anything.
+[auditor-ezb]
+# Informal name of the auditor. Just for the user.
+NAME = European Central Bank
+
+# URI of the auditor (especially for in the future, when the
+# auditor offers an automated issue reporting system).
+# Not really used today.
+URI = http://taler.ezb.eu/
+
+# This is the important bit: the signing key of the auditor.
+PUBLIC_KEY = 9QXF7XY7E9VPV47B5Z806NDFSX2VJ79SVHHD29QEQ3BG31ANHZ60
+
+# This specifies which database we use.
+[merchantdb-postgres]
+CONFIG = postgres:///talercheck
+
+# "wire-" sections include wire details, here for SEPA.
+[wire-sepa]
+IBAN = DE67830654080004822650
+NAME = GNUNET E.V
+BIC = GENODEF1SRL
+SALT = 17919252168512238964
+ADDRESS = "Garching"
+
+
+[exchange]
+# How to access our database
+DB = postgres
+# HTTP port the exchange listens to
+PORT = 8081
+# Wire format supported by the exchange
+WIREFORMAT = test
+# Our public key
+MASTER_PUBLIC_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG
+
+[exchangedb-postgres]
+DB_CONN_STR = "postgres:///talercheck"
+
+[exchange-wire-incoming-test]
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+TEST_RESPONSE_FILE = ${TALER_CONFIG_HOME}/test.json
+
+[exchange-wire-outgoing-test]
+# What is the main website of the bank?
+BANK_URI = "http://localhost:8082/"
+# Into which account at the 'bank' should (incoming) wire transfers be made?
+BANK_ACCOUNT_NUMBER = 2
+
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 1024
diff --git a/src/lib/test_merchant_api_home/.config/taler/merchant/wire/test.json b/src/lib/test_merchant_api_home/.config/taler/merchant/wire/test.json
@@ -0,0 +1,5 @@
+{
+ "type":"test",
+ "bank_uri":"http://localhost/",
+ "account_number":62
+}
diff --git a/src/lib/test_merchant_api_home/.local/share/taler/exchange/offline-keys/master.priv b/src/lib/test_merchant_api_home/.local/share/taler/exchange/offline-keys/master.priv
@@ -0,0 +1 @@
+k;d_U}A.w"!Gv_m"_
+\ No newline at end of file