diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-06-11 18:49:45 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-06-11 18:49:45 +0200 |
commit | 9e39308104794e7f1df4941db3d3e527b47ba15c (patch) | |
tree | b42318ba78f0c57e48032d55bd9f871934cd76cd | |
parent | 1701d4f86a39edc390f172da6f8e72c94b6a8e97 (diff) | |
download | anastasis-9e39308104794e7f1df4941db3d3e527b47ba15c.tar.gz anastasis-9e39308104794e7f1df4941db3d3e527b47ba15c.zip |
-get anastasis tests to pass again
-rw-r--r-- | src/testing/test_anastasis.c | 27 | ||||
-rw-r--r-- | src/testing/test_anastasis_api.c | 27 | ||||
-rw-r--r-- | src/testing/test_anastasis_api.conf | 144 | ||||
-rw-r--r-- | src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv | 1 | ||||
-rw-r--r-- | src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv | 1 | ||||
-rw-r--r-- | src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub | bin | 0 -> 96 bytes | |||
-rw-r--r-- | src/testing/testing_cmd_secret_share.c | 2 |
7 files changed, 38 insertions, 164 deletions
diff --git a/src/testing/test_anastasis.c b/src/testing/test_anastasis.c index bf3662d..f9e8531 100644 --- a/src/testing/test_anastasis.c +++ b/src/testing/test_anastasis.c | |||
@@ -318,19 +318,18 @@ run (void *cls, | |||
318 | 318 | ||
319 | struct TALER_TESTING_Command commands[] = { | 319 | struct TALER_TESTING_Command commands[] = { |
320 | /* general setup */ | 320 | /* general setup */ |
321 | TALER_TESTING_cmd_auditor_add ("add-auditor-OK", | 321 | TALER_TESTING_cmd_run_fakebank ("run-fakebank", |
322 | MHD_HTTP_NO_CONTENT, | 322 | cred.cfg, |
323 | false), | 323 | "exchange-account-exchange"), |
324 | TALER_TESTING_cmd_wire_add ("add-wire-account", | 324 | TALER_TESTING_cmd_system_start ("start-taler", |
325 | "payto://x-taler-bank/localhost/2", | 325 | CONFIG_FILE, |
326 | MHD_HTTP_NO_CONTENT, | 326 | "-em", |
327 | false), | 327 | "-u", "exchange-account-exchange", |
328 | TALER_TESTING_cmd_exec_offline_sign_keys ("offline-sign-future-keys", | 328 | NULL), |
329 | CONFIG_FILE), | 329 | TALER_TESTING_cmd_get_exchange ("get-exchange", |
330 | TALER_TESTING_cmd_exec_offline_sign_fees ("offline-sign-fees", | 330 | cred.cfg, |
331 | CONFIG_FILE, | 331 | true, |
332 | "EUR:0.01", | 332 | true), |
333 | "EUR:0.01"), | ||
334 | TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys"), | 333 | TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys"), |
335 | TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", | 334 | TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", |
336 | merchant_url, | 335 | merchant_url, |
@@ -388,7 +387,7 @@ main (int argc, | |||
388 | ret = TALER_TESTING_main (argv, | 387 | ret = TALER_TESTING_main (argv, |
389 | "INFO", | 388 | "INFO", |
390 | CONFIG_FILE, | 389 | CONFIG_FILE, |
391 | "exchange-account-2", | 390 | "exchange-account-exchange", |
392 | TALER_TESTING_BS_FAKEBANK, | 391 | TALER_TESTING_BS_FAKEBANK, |
393 | &cred, | 392 | &cred, |
394 | &run, | 393 | &run, |
diff --git a/src/testing/test_anastasis_api.c b/src/testing/test_anastasis_api.c index d365dd9..04071c9 100644 --- a/src/testing/test_anastasis_api.c +++ b/src/testing/test_anastasis_api.c | |||
@@ -266,19 +266,18 @@ run (void *cls, | |||
266 | 266 | ||
267 | struct TALER_TESTING_Command commands[] = { | 267 | struct TALER_TESTING_Command commands[] = { |
268 | /* general setup */ | 268 | /* general setup */ |
269 | TALER_TESTING_cmd_auditor_add ("add-auditor-OK", | 269 | TALER_TESTING_cmd_run_fakebank ("run-fakebank", |
270 | MHD_HTTP_NO_CONTENT, | 270 | cred.cfg, |
271 | false), | 271 | "exchange-account-exchange"), |
272 | TALER_TESTING_cmd_wire_add ("add-wire-account", | 272 | TALER_TESTING_cmd_system_start ("start-taler", |
273 | "payto://x-taler-bank/localhost/2", | 273 | CONFIG_FILE, |
274 | MHD_HTTP_NO_CONTENT, | 274 | "-em", |
275 | false), | 275 | "-u", "exchange-account-exchange", |
276 | TALER_TESTING_cmd_exec_offline_sign_keys ("offline-sign-future-keys", | 276 | NULL), |
277 | CONFIG_FILE), | 277 | TALER_TESTING_cmd_get_exchange ("get-exchange", |
278 | TALER_TESTING_cmd_exec_offline_sign_fees ("offline-sign-fees", | 278 | cred.cfg, |
279 | CONFIG_FILE, | 279 | true, |
280 | "EUR:0.01", | 280 | true), |
281 | "EUR:0.01"), | ||
282 | TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys"), | 281 | TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys"), |
283 | TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", | 282 | TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", |
284 | merchant_url, | 283 | merchant_url, |
@@ -341,7 +340,7 @@ main (int argc, | |||
341 | ret = TALER_TESTING_main (argv, | 340 | ret = TALER_TESTING_main (argv, |
342 | "INFO", | 341 | "INFO", |
343 | CONFIG_FILE, | 342 | CONFIG_FILE, |
344 | "exchange-account-2", | 343 | "exchange-account-exchange", |
345 | TALER_TESTING_BS_FAKEBANK, | 344 | TALER_TESTING_BS_FAKEBANK, |
346 | &cred, | 345 | &cred, |
347 | &run, | 346 | &run, |
diff --git a/src/testing/test_anastasis_api.conf b/src/testing/test_anastasis_api.conf index afd7aad..3b2f976 100644 --- a/src/testing/test_anastasis_api.conf +++ b/src/testing/test_anastasis_api.conf | |||
@@ -1,223 +1,99 @@ | |||
1 | # This file is in the public domain. | 1 | # This file is in the public domain. |
2 | # | 2 | # |
3 | [PATHS] | 3 | [PATHS] |
4 | # Persistent data storage for the testcase | ||
5 | TALER_TEST_HOME = test_anastasis_api_home/ | 4 | TALER_TEST_HOME = test_anastasis_api_home/ |
6 | TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/${USER:-}/taler-system-runtime/ | ||
7 | |||
8 | # Persistent data storage | ||
9 | TALER_DATA_HOME = $TALER_TEST_HOME/.local/share/taler/ | ||
10 | |||
11 | # Configuration files | ||
12 | TALER_CONFIG_HOME = $TALER_TEST_HOME/.config/taler/ | ||
13 | |||
14 | # Cached data, no big deal if lost | ||
15 | TALER_CACHE_HOME = $TALER_TEST_HOME/.cache/taler/ | ||
16 | 5 | ||
17 | [taler] | 6 | [taler] |
18 | # What currency do we use? | 7 | CURRENCY = EUR |
19 | #currency = EUR | 8 | CURRENCY_ROUND_UNIT = EUR:0.01 |
20 | currency = EUR | ||
21 | #CURRENCY_ROUND_UNIT = EUR:0.01 | ||
22 | #CURRENCY_ROUND_UNIT = EUR:0.01 | ||
23 | 9 | ||
24 | [taler-helper-crypto-rsa] | 10 | [taler-helper-crypto-rsa] |
25 | # Reduce from 1 year to speed up test | ||
26 | LOOKAHEAD_SIGN = 12 days | 11 | LOOKAHEAD_SIGN = 12 days |
27 | 12 | ||
28 | [taler-helper-crypto-eddsa] | 13 | [taler-helper-crypto-eddsa] |
29 | # Reduce from 1 year to speed up test | ||
30 | LOOKAHEAD_SIGN = 12 days | 14 | LOOKAHEAD_SIGN = 12 days |
31 | # Reduce from 12 weeks to ensure we have multiple | ||
32 | DURATION = 7 days | 15 | DURATION = 7 days |
33 | 16 | ||
34 | |||
35 | [bank] | 17 | [bank] |
36 | HTTP_PORT = 8082 | 18 | HTTP_PORT = 8082 |
37 | #BASE_URL = https://bank.test.taler.net/ | 19 | BASE_URL = http://localhost:8082/ |
38 | |||
39 | ########################################## | ||
40 | # Configuration for Anastasis # | ||
41 | ########################################## | ||
42 | 20 | ||
43 | [anastasis] | 21 | [anastasis] |
44 | PORT = 8086 | 22 | PORT = 8086 |
45 | |||
46 | DB = postgres | 23 | DB = postgres |
47 | |||
48 | BUSINESS_NAME = "Checker's Test Inc." | 24 | BUSINESS_NAME = "Checker's Test Inc." |
49 | |||
50 | # Upload limit | ||
51 | UPLOAD_LIMIT_MB = 1 | 25 | UPLOAD_LIMIT_MB = 1 |
52 | |||
53 | ANNUAL_POLICY_UPLOAD_LIMIT = 64 | 26 | ANNUAL_POLICY_UPLOAD_LIMIT = 64 |
54 | |||
55 | INSURANCE = EUR:0 | 27 | INSURANCE = EUR:0 |
56 | |||
57 | PROVIDER_SALT = salty | 28 | PROVIDER_SALT = salty |
58 | |||
59 | |||
60 | # Annual fee we charge. | ||
61 | #ANNUAL_FEE = EUR:4.99 | ||
62 | ANNUAL_FEE = EUR:4.99 | 29 | ANNUAL_FEE = EUR:4.99 |
63 | |||
64 | TRUTH_UPLOAD_FEE = EUR:0.0 | 30 | TRUTH_UPLOAD_FEE = EUR:0.0 |
65 | 31 | BASE_URL = http://localhost:8086/ | |
66 | # Base URL of anastasis. | ||
67 | # BASE_URL = http://localhost:8086/ | ||
68 | 32 | ||
69 | [anastasis-merchant-backend] | 33 | [anastasis-merchant-backend] |
70 | # Where does our payment backend run? Must match PORT under [merchant] | ||
71 | PAYMENT_BACKEND_URL = http://localhost:8080/ | 34 | PAYMENT_BACKEND_URL = http://localhost:8080/ |
72 | 35 | ||
73 | # Authentication costs | ||
74 | [authorization-question] | 36 | [authorization-question] |
75 | # Cost of authentication by question | ||
76 | COST = EUR:0 | 37 | COST = EUR:0 |
77 | 38 | ||
78 | [authorization-file] | 39 | [authorization-file] |
79 | # Cost of authentication by file (only for testing purposes) | ||
80 | COST = EUR:1 | 40 | COST = EUR:1 |
81 | 41 | ||
82 | [authorization-email] | 42 | [authorization-email] |
83 | # Cost of authentication by E-Mail | ||
84 | COST = EUR:0 | 43 | COST = EUR:0 |
85 | 44 | ||
86 | [authorization-sms] | 45 | [authorization-sms] |
87 | # Cost of authentication by SMS | ||
88 | COST = EUR:0 | 46 | COST = EUR:0 |
89 | |||
90 | # Command which is executed for the sms authentication | ||
91 | COMMAND = ./sms_authentication.sh | 47 | COMMAND = ./sms_authentication.sh |
92 | 48 | ||
93 | |||
94 | |||
95 | |||
96 | # This specifies which database the postgres backend uses. | ||
97 | [stasis-postgres] | 49 | [stasis-postgres] |
98 | CONFIG = postgres:///anastasischeck | 50 | CONFIG = postgres:///anastasischeck |
99 | 51 | ||
100 | ########################################## | ||
101 | # Configuration for the merchant backend # | ||
102 | ########################################## | ||
103 | |||
104 | [merchant] | 52 | [merchant] |
105 | |||
106 | # Which port do we run the backend on? (HTTP server) | ||
107 | PORT = 8080 | 53 | PORT = 8080 |
108 | |||
109 | # How quickly do we want the exchange to send us our money? | ||
110 | # Used only if the frontend does not specify a value. | ||
111 | WIRE_TRANSFER_DELAY = 0 s | 54 | WIRE_TRANSFER_DELAY = 0 s |
112 | |||
113 | # Which plugin (backend) do we use for the DB. | ||
114 | DB = postgres | 55 | DB = postgres |
115 | 56 | ||
116 | # Default choice for maximum wire fee. | ||
117 | DEFAULT_MAX_WIRE_FEE = EUR:0.10 | ||
118 | |||
119 | # Default choice for maximum deposit fee. | ||
120 | DEFAULT_MAX_DEPOSIT_FEE = EUR:0.10 | ||
121 | |||
122 | |||
123 | # This specifies which database the postgres backend uses. | ||
124 | [merchantdb-postgres] | 57 | [merchantdb-postgres] |
125 | CONFIG = postgres:///talercheck | 58 | CONFIG = postgres:///talercheck |
126 | 59 | ||
127 | # Sections starting with "exchange-" specify trusted exchanges | ||
128 | # (by the merchant) | ||
129 | [merchant-exchange-default] | 60 | [merchant-exchange-default] |
130 | MASTER_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG | 61 | MASTER_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG |
131 | EXCHANGE_BASE_URL = http://localhost:8081/ | 62 | EXCHANGE_BASE_URL = http://localhost:8081/ |
132 | #MASTER_KEY = DY95EXAHQ2BKM2WK9YHZHYG1R7PPMMJPY14FNGP662DAKE35AKQG | ||
133 | #EXCHANGE_BASE_URL = https://exchange.test.taler.net/ | ||
134 | #CURRENCY = EUR | ||
135 | CURRENCY = EUR | 63 | CURRENCY = EUR |
136 | 64 | ||
137 | # only fixes skips. | ||
138 | [auditor] | 65 | [auditor] |
139 | BASE_URL = http://the.auditor/ | 66 | PORT = 8083 |
140 | #BASE_URL = https://auditor.test.taler.net/ | 67 | BASE_URL = "http://localhost:8083/" |
141 | #AUDITOR_KEY = DSDASDXAMDAARMNAD53ZA4AFAHA2QADAMAHHASWDAWXN84SDAA11 | ||
142 | # If currency does not match [TALER] section, the auditor | ||
143 | # will be ignored! | ||
144 | CURRENCY = EUR | ||
145 | |||
146 | # Where do we store the auditor's private key? | ||
147 | AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv | ||
148 | |||
149 | # Auditors must be in sections "auditor-", the rest of the section | ||
150 | # name could be anything. | ||
151 | [auditor-ezb] | ||
152 | # Informal name of the auditor. Just for the user. | ||
153 | NAME = European Central Bank | ||
154 | |||
155 | # URL of the auditor (especially for in the future, when the | ||
156 | # auditor offers an automated issue reporting system). | ||
157 | # Not really used today. | ||
158 | URL = http://taler.ezb.eu/ | ||
159 | |||
160 | # This is the important bit: the signing key of the auditor. | ||
161 | PUBLIC_KEY = 9QXF7XY7E9VPV47B5Z806NDFSX2VJ79SVHHD29QEQ3BG31ANHZ60 | ||
162 | |||
163 | # Which currency is this auditor trusted for? | ||
164 | CURRENCY = EUR | ||
165 | |||
166 | |||
167 | ################################################### | ||
168 | # Configuration for the exchange for the testcase # | ||
169 | ################################################### | ||
170 | 68 | ||
171 | [exchange] | 69 | [exchange] |
172 | AML_THRESHOLD = EUR:1000000 | 70 | AML_THRESHOLD = EUR:1000000 |
173 | |||
174 | # How to access our database | ||
175 | DB = postgres | 71 | DB = postgres |
176 | |||
177 | # HTTP port the exchange listens to | ||
178 | PORT = 8081 | 72 | PORT = 8081 |
179 | |||
180 | # how long are the signatures with the signkey valid? | ||
181 | SIGNKEY_LEGAL_DURATION = 2 years | 73 | SIGNKEY_LEGAL_DURATION = 2 years |
182 | |||
183 | # Our public key | ||
184 | MASTER_PUBLIC_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG | 74 | MASTER_PUBLIC_KEY = T1VVFQZZARQ1CMF4BN58EE7SKTW5AV2BS18S87ZEGYS4S29J6DNG |
185 | |||
186 | # Base URL of the exchange. | ||
187 | BASE_URL = "http://localhost:8081/" | 75 | BASE_URL = "http://localhost:8081/" |
188 | #BASE_URL = https://exchange.test.taler.net/ | ||
189 | |||
190 | # Network configuration for the normal API/service HTTP server | ||
191 | # serve via tcp socket (on PORT) | ||
192 | SERVE = tcp | 76 | SERVE = tcp |
193 | 77 | ||
194 | [exchange-offline] | 78 | [exchange-offline] |
195 | |||
196 | # Where do we store the offline master private key of the exchange? | ||
197 | MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv | 79 | MASTER_PRIV_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/master.priv |
198 | 80 | ||
199 | # Where do we store the TOFU key material? | ||
200 | SECM_TOFU_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/secm_tofus.pub | 81 | SECM_TOFU_FILE = ${TALER_DATA_HOME}/exchange/offline-keys/secm_tofus.pub |
201 | 82 | ||
202 | |||
203 | [taler-exchange-secmod-eddsa] | 83 | [taler-exchange-secmod-eddsa] |
204 | # Where do we store the generated private keys. | ||
205 | KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-eddsa/keys | 84 | KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-eddsa/keys |
206 | 85 | ||
207 | [taler-exchange-secmod-rsa] | 86 | [taler-exchange-secmod-rsa] |
208 | # Where do we store the generated private keys. | ||
209 | KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-rsa/keys | 87 | KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-rsa/keys |
210 | 88 | ||
89 | [taler-exchange-secmod-cs] | ||
90 | KEY_DIR = ${TALER_DATA_HOME}/exchange-secmod-cs/keys | ||
211 | 91 | ||
212 | [exchangedb-postgres] | ||
213 | CONFIG = "postgres:///talercheck" | ||
214 | 92 | ||
215 | [auditordb-postgres] | 93 | [exchangedb-postgres] |
216 | CONFIG = "postgres:///talercheck" | 94 | CONFIG = "postgres:///talercheck" |
217 | 95 | ||
218 | # Account of the EXCHANGE | ||
219 | [exchange-account-exchange] | 96 | [exchange-account-exchange] |
220 | # What is the exchange's bank account (with the "Taler Bank" demo system)? | ||
221 | PAYTO_URI = "payto://x-taler-bank/localhost:8082/2" | 97 | PAYTO_URI = "payto://x-taler-bank/localhost:8082/2" |
222 | ENABLE_DEBIT = YES | 98 | ENABLE_DEBIT = YES |
223 | ENABLE_CREDIT = YES | 99 | ENABLE_CREDIT = YES |
@@ -226,8 +102,6 @@ ENABLE_CREDIT = YES | |||
226 | WIRE_GATEWAY_URL = "http://localhost:8082/2/" | 102 | WIRE_GATEWAY_URL = "http://localhost:8082/2/" |
227 | WIRE_GATEWAY_AUTH_METHOD = NONE | 103 | WIRE_GATEWAY_AUTH_METHOD = NONE |
228 | 104 | ||
229 | |||
230 | |||
231 | [coin_eur_ct_1] | 105 | [coin_eur_ct_1] |
232 | value = EUR:0.01 | 106 | value = EUR:0.01 |
233 | duration_withdraw = 7 days | 107 | duration_withdraw = 7 days |
diff --git a/src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv b/src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv new file mode 100644 index 0000000..c20942d --- /dev/null +++ b/src/testing/test_anastasis_api_home/taler/exchange-offline/master.priv | |||
@@ -0,0 +1 @@ | |||
k;d_U}A.w"!Gv_m"_ \ No newline at end of file | |||
diff --git a/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv new file mode 100644 index 0000000..c20942d --- /dev/null +++ b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/master.priv | |||
@@ -0,0 +1 @@ | |||
k;d_U}A.w"!Gv_m"_ \ No newline at end of file | |||
diff --git a/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub new file mode 100644 index 0000000..09a3ebd --- /dev/null +++ b/src/testing/test_anastasis_api_home/taler/exchange/offline-keys/secm_tofus.pub | |||
Binary files differ | |||
diff --git a/src/testing/testing_cmd_secret_share.c b/src/testing/testing_cmd_secret_share.c index 70c97cf..3c401d2 100644 --- a/src/testing/testing_cmd_secret_share.c +++ b/src/testing/testing_cmd_secret_share.c | |||
@@ -359,7 +359,7 @@ secret_share_traits (void *cls, | |||
359 | struct SecretShareState *sss = cls; | 359 | struct SecretShareState *sss = cls; |
360 | struct TALER_TESTING_Trait traits[] = { | 360 | struct TALER_TESTING_Trait traits[] = { |
361 | TALER_TESTING_make_trait_claim_token (&sss->token), | 361 | TALER_TESTING_make_trait_claim_token (&sss->token), |
362 | ANASTASIS_TESTING_make_trait_core_secret (&sss->core_secret), | 362 | ANASTASIS_TESTING_make_trait_core_secret (sss->core_secret), |
363 | TALER_TESTING_make_trait_order_id (sss->payment_order_id), | 363 | TALER_TESTING_make_trait_order_id (sss->payment_order_id), |
364 | TALER_TESTING_trait_end () | 364 | TALER_TESTING_trait_end () |
365 | }; | 365 | }; |