aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_prepare.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/test_prepare.sh')
-rwxr-xr-xsrc/testing/test_prepare.sh41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/testing/test_prepare.sh b/src/testing/test_prepare.sh
index 035a588..4088b1a 100755
--- a/src/testing/test_prepare.sh
+++ b/src/testing/test_prepare.sh
@@ -24,7 +24,7 @@ function cleanup()
24 do 24 do
25 kill $n 2> /dev/null || true 25 kill $n 2> /dev/null || true
26 done 26 done
27 rm -rf $CONF $CONF4 $WALLET_DB $R1FILE $R2FILE $B1FILE $B2FILE $TMP_DIR 27 rm -rf $CONF $CONF_4 $WALLET_DB $R1FILE $R2FILE $B1FILE $B2FILE $TMP_DIR
28 wait 28 wait
29} 29}
30 30
@@ -67,7 +67,7 @@ function wire_transfer_to_anastasis() {
67 export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME 67 export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME
68 export LIBEUFIN_NEXUS_PASSWORD=$CREDIT_PASSWORD 68 export LIBEUFIN_NEXUS_PASSWORD=$CREDIT_PASSWORD
69 libeufin-cli accounts fetch-transactions nexus-bankaccount-credit > /dev/null 69 libeufin-cli accounts fetch-transactions nexus-bankaccount-credit > /dev/null
70 anastasis-helper-authorization-iban -c $CONF_4 -t 70 anastasis-helper-authorization-iban -c $CONF_4 -t -L INFO
71} 71}
72 72
73# $1 = facade base URL. Merely a debug utility. 73# $1 = facade base URL. Merely a debug utility.
@@ -123,17 +123,17 @@ export CONF_2="test_anastasis_reducer_2.conf"
123export CONF_3="test_anastasis_reducer_3.conf" 123export CONF_3="test_anastasis_reducer_3.conf"
124if test $1 = 'free' 124if test $1 = 'free'
125then 125then
126 export CONF_4="test_anastasis_reducer_4_free.conf" 126 CONF4="test_anastasis_reducer_4_free.conf"
127else 127else
128 export CONF_4="test_anastasis_reducer_4.conf" 128 CONF4="test_anastasis_reducer_4.conf"
129fi 129fi
130 130
131# Exchange configuration file will be edited, so we create one 131# Exchange configuration file will be edited, so we create one
132# from the template. 132# from the template.
133CONF=`mktemp test_reducerXXXXXX.conf` 133export CONF=`mktemp test_reducerXXXXXX.conf`
134CONF4=`mktemp test_reducer_4XXXXXX.conf` 134export CONF_4=`mktemp test_reducer_4XXXXXX.conf`
135cp test_reducer.conf $CONF 135cp test_reducer.conf $CONF
136cp $CONF_4 $CONF4 136cp $CONF4 $CONF_4
137 137
138TMP_DIR=`mktemp -d keys-tmp-XXXXXX` 138TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
139WALLET_DB=`mktemp test_reducer_walletXXXXXX.json` 139WALLET_DB=`mktemp test_reducer_walletXXXXXX.json`
@@ -167,8 +167,8 @@ echo -n "Testing for libeufin-cli"
167if libeufin-cli --version > /dev/null 167if libeufin-cli --version > /dev/null
168then 168then
169 echo " FOUND" 169 echo " FOUND"
170 IBAN_CREDIT=`anastasis-config -c $CONF4 -s authorization-iban -o CREDIT_IBAN` 170 IBAN_CREDIT=`anastasis-config -c $CONF_4 -s authorization-iban -o CREDIT_IBAN`
171 CREDIT_BUSINESS_NAME=`anastasis-config -c $CONF4 -s authorization-iban -o BUSINESS_NAME` 171 CREDIT_BUSINESS_NAME=`anastasis-config -c $CONF_4 -s authorization-iban -o BUSINESS_NAME`
172 echo -n "Setting up Nexus ..." 172 echo -n "Setting up Nexus ..."
173 export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/nexus-db-XXXXXX.sqlite)" 173 export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/nexus-db-XXXXXX.sqlite)"
174 export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/sandbox-db-XXXXXX.sqlite)" 174 export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/sandbox-db-XXXXXX.sqlite)"
@@ -257,31 +257,31 @@ then
257 ## Reach facade with: $FACADE_URL + $CREDIT_USERNAME + $CREDIT_PASSWORD 257 ## Reach facade with: $FACADE_URL + $CREDIT_USERNAME + $CREDIT_PASSWORD
258 258
259 echo -n "Configuring Anastasis IBAN account ..." 259 echo -n "Configuring Anastasis IBAN account ..."
260 anastasis-config -c $CONF4 \ 260 anastasis-config -c $CONF_4 \
261 -s authorization-iban \ 261 -s authorization-iban \
262 -o CREDIT_IBAN \ 262 -o CREDIT_IBAN \
263 -V "${IBAN_CREDIT}" 263 -V "${IBAN_CREDIT}"
264 anastasis-config -c $CONF4 \ 264 anastasis-config -c $CONF_4 \
265 -s authorization-iban \ 265 -s authorization-iban \
266 -o BUSINESS_NAME \ 266 -o BUSINESS_NAME \
267 -V "${PERSON_CREDIT_NAME}" 267 -V "${PERSON_CREDIT_NAME}"
268 anastasis-config -c $CONF4 \ 268 anastasis-config -c $CONF_4 \
269 -s authorization-iban \ 269 -s authorization-iban \
270 -o WIRE_GATEWAY_URL \ 270 -o WIRE_GATEWAY_URL \
271 -V "${FACADE_URL}" 271 -V "${FACADE_URL}"
272 anastasis-config -c $CONF4 \ 272 anastasis-config -c $CONF_4 \
273 -s authorization-iban \ 273 -s authorization-iban \
274 -o WIRE_GATEWAY_AUTH_METHOD \ 274 -o WIRE_GATEWAY_AUTH_METHOD \
275 -V "basic" 275 -V "basic"
276 anastasis-config -c $CONF4 \ 276 anastasis-config -c $CONF_4 \
277 -s authorization-iban \ 277 -s authorization-iban \
278 -o USERNAME \ 278 -o USERNAME \
279 -V "${LIBEUFIN_NEXUS_USERNAME}" 279 -V "${LIBEUFIN_NEXUS_USERNAME}"
280 anastasis-config -c $CONF4 \ 280 anastasis-config -c $CONF_4 \
281 -s authorization-iban \ 281 -s authorization-iban \
282 -o PASSWORD \ 282 -o PASSWORD \
283 -V "${LIBEUFIN_NEXUS_PASSWORD}" 283 -V "${LIBEUFIN_NEXUS_PASSWORD}"
284 anastasis-config -c $CONF4 \ 284 anastasis-config -c $CONF_4 \
285 -s authorization-iban \ 285 -s authorization-iban \
286 -o ENABLED \ 286 -o ENABLED \
287 -V YES 287 -V YES
@@ -289,7 +289,7 @@ then
289 IBAN_ACTIVE='true' 289 IBAN_ACTIVE='true'
290else 290else
291 echo " NOT FOUND (IBAN authentication not supported)" 291 echo " NOT FOUND (IBAN authentication not supported)"
292 anastasis-config -c $CONF4 \ 292 anastasis-config -c $CONF_4 \
293 -s authorization-iban \ 293 -s authorization-iban \
294 -o ENABLED \ 294 -o ENABLED \
295 -V NO 295 -V NO
@@ -307,7 +307,7 @@ echo -n "Initialize anastasis database ..."
307TARGET_DB_1=`anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"` 307TARGET_DB_1=`anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
308TARGET_DB_2=`anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"` 308TARGET_DB_2=`anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
309TARGET_DB_3=`anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"` 309TARGET_DB_3=`anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
310TARGET_DB_4=`anastasis-config -c $CONF4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"` 310TARGET_DB_4=`anastasis-config -c $CONF_4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
311 311
312dropdb $TARGET_DB_1 >/dev/null 2>/dev/null || true 312dropdb $TARGET_DB_1 >/dev/null 2>/dev/null || true
313createdb $TARGET_DB_1 || exit_skip "Could not create database $TARGET_DB_1" 313createdb $TARGET_DB_1 || exit_skip "Could not create database $TARGET_DB_1"
@@ -320,7 +320,7 @@ createdb $TARGET_DB_3 || exit_skip "Could not create database $TARGET_DB_3"
320anastasis-dbinit -c $CONF_3 2> anastasis-dbinit_3.log 320anastasis-dbinit -c $CONF_3 2> anastasis-dbinit_3.log
321dropdb $TARGET_DB_4 >/dev/null 2>/dev/null || true 321dropdb $TARGET_DB_4 >/dev/null 2>/dev/null || true
322createdb $TARGET_DB_4 || exit_skip "Could not create database $TARGET_DB_4" 322createdb $TARGET_DB_4 || exit_skip "Could not create database $TARGET_DB_4"
323anastasis-dbinit -c $CONF4 2> anastasis-dbinit_4.log 323anastasis-dbinit -c $CONF_4 2> anastasis-dbinit_4.log
324 324
325echo " OK" 325echo " OK"
326 326
@@ -396,7 +396,7 @@ PREFIX=""
396$PREFIX anastasis-httpd -L INFO -c $CONF_1 2> anastasis-httpd_1.log & 396$PREFIX anastasis-httpd -L INFO -c $CONF_1 2> anastasis-httpd_1.log &
397$PREFIX anastasis-httpd -L INFO -c $CONF_2 2> anastasis-httpd_2.log & 397$PREFIX anastasis-httpd -L INFO -c $CONF_2 2> anastasis-httpd_2.log &
398$PREFIX anastasis-httpd -L INFO -c $CONF_3 2> anastasis-httpd_3.log & 398$PREFIX anastasis-httpd -L INFO -c $CONF_3 2> anastasis-httpd_3.log &
399$PREFIX anastasis-httpd -L INFO -c $CONF4 2> anastasis-httpd_4.log & 399$PREFIX anastasis-httpd -L INFO -c $CONF_4 2> anastasis-httpd_4.log &
400 400
401 401
402if test $1 = 'fees' 402if test $1 = 'fees'
@@ -475,6 +475,7 @@ then
475 echo " OK" 475 echo " OK"
476 476
477fi 477fi
478echo " OK"
478 479
479echo -n "Waiting for anastasis services ..." 480echo -n "Waiting for anastasis services ..."
480 481