aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-27 23:00:39 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-27 23:00:39 +0200
commitaadc6622c31b08ec99998f0a3682db752598304c (patch)
treeac332d4e855c797a8ed1d8c0977a4020b17bbdcd
parent416f5fd65570fa07f2f8d4f0cd22210d82a5f5a2 (diff)
downloadanastasis-gtk-aadc6622c31b08ec99998f0a3682db752598304c.tar.gz
anastasis-gtk-aadc6622c31b08ec99998f0a3682db752598304c.tar.bz2
anastasis-gtk-aadc6622c31b08ec99998f0a3682db752598304c.zip
improve test script
-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()
do
kill $n 2> /dev/null || true
done
- rm -rf $CONF $CONF4 $WALLET_DB $R1FILE $R2FILE $B1FILE $B2FILE $TMP_DIR
+ rm -rf $CONF $CONF_4 $WALLET_DB $R1FILE $R2FILE $B1FILE $B2FILE $TMP_DIR
wait
}
@@ -67,7 +67,7 @@ function wire_transfer_to_anastasis() {
export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME
export LIBEUFIN_NEXUS_PASSWORD=$CREDIT_PASSWORD
libeufin-cli accounts fetch-transactions nexus-bankaccount-credit > /dev/null
- anastasis-helper-authorization-iban -c $CONF_4 -t
+ anastasis-helper-authorization-iban -c $CONF_4 -t -L INFO
}
# $1 = facade base URL. Merely a debug utility.
@@ -123,17 +123,17 @@ export CONF_2="test_anastasis_reducer_2.conf"
export CONF_3="test_anastasis_reducer_3.conf"
if test $1 = 'free'
then
- export CONF_4="test_anastasis_reducer_4_free.conf"
+ CONF4="test_anastasis_reducer_4_free.conf"
else
- export CONF_4="test_anastasis_reducer_4.conf"
+ CONF4="test_anastasis_reducer_4.conf"
fi
# Exchange configuration file will be edited, so we create one
# from the template.
-CONF=`mktemp test_reducerXXXXXX.conf`
-CONF4=`mktemp test_reducer_4XXXXXX.conf`
+export CONF=`mktemp test_reducerXXXXXX.conf`
+export CONF_4=`mktemp test_reducer_4XXXXXX.conf`
cp test_reducer.conf $CONF
-cp $CONF_4 $CONF4
+cp $CONF4 $CONF_4
TMP_DIR=`mktemp -d keys-tmp-XXXXXX`
WALLET_DB=`mktemp test_reducer_walletXXXXXX.json`
@@ -167,8 +167,8 @@ echo -n "Testing for libeufin-cli"
if libeufin-cli --version > /dev/null
then
echo " FOUND"
- IBAN_CREDIT=`anastasis-config -c $CONF4 -s authorization-iban -o CREDIT_IBAN`
- CREDIT_BUSINESS_NAME=`anastasis-config -c $CONF4 -s authorization-iban -o BUSINESS_NAME`
+ IBAN_CREDIT=`anastasis-config -c $CONF_4 -s authorization-iban -o CREDIT_IBAN`
+ CREDIT_BUSINESS_NAME=`anastasis-config -c $CONF_4 -s authorization-iban -o BUSINESS_NAME`
echo -n "Setting up Nexus ..."
export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/nexus-db-XXXXXX.sqlite)"
export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/sandbox-db-XXXXXX.sqlite)"
@@ -257,31 +257,31 @@ then
## Reach facade with: $FACADE_URL + $CREDIT_USERNAME + $CREDIT_PASSWORD
echo -n "Configuring Anastasis IBAN account ..."
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o CREDIT_IBAN \
-V "${IBAN_CREDIT}"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o BUSINESS_NAME \
-V "${PERSON_CREDIT_NAME}"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o WIRE_GATEWAY_URL \
-V "${FACADE_URL}"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o WIRE_GATEWAY_AUTH_METHOD \
-V "basic"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o USERNAME \
-V "${LIBEUFIN_NEXUS_USERNAME}"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o PASSWORD \
-V "${LIBEUFIN_NEXUS_PASSWORD}"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o ENABLED \
-V YES
@@ -289,7 +289,7 @@ then
IBAN_ACTIVE='true'
else
echo " NOT FOUND (IBAN authentication not supported)"
- anastasis-config -c $CONF4 \
+ anastasis-config -c $CONF_4 \
-s authorization-iban \
-o ENABLED \
-V NO
@@ -307,7 +307,7 @@ echo -n "Initialize anastasis database ..."
TARGET_DB_1=`anastasis-config -c $CONF_1 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
TARGET_DB_2=`anastasis-config -c $CONF_2 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
TARGET_DB_3=`anastasis-config -c $CONF_3 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
-TARGET_DB_4=`anastasis-config -c $CONF4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
+TARGET_DB_4=`anastasis-config -c $CONF_4 -s stasis-postgres -o CONFIG | sed -e "s/^postgres:\/\/\///"`
dropdb $TARGET_DB_1 >/dev/null 2>/dev/null || true
createdb $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"
anastasis-dbinit -c $CONF_3 2> anastasis-dbinit_3.log
dropdb $TARGET_DB_4 >/dev/null 2>/dev/null || true
createdb $TARGET_DB_4 || exit_skip "Could not create database $TARGET_DB_4"
-anastasis-dbinit -c $CONF4 2> anastasis-dbinit_4.log
+anastasis-dbinit -c $CONF_4 2> anastasis-dbinit_4.log
echo " OK"
@@ -396,7 +396,7 @@ PREFIX=""
$PREFIX anastasis-httpd -L INFO -c $CONF_1 2> anastasis-httpd_1.log &
$PREFIX anastasis-httpd -L INFO -c $CONF_2 2> anastasis-httpd_2.log &
$PREFIX anastasis-httpd -L INFO -c $CONF_3 2> anastasis-httpd_3.log &
-$PREFIX anastasis-httpd -L INFO -c $CONF4 2> anastasis-httpd_4.log &
+$PREFIX anastasis-httpd -L INFO -c $CONF_4 2> anastasis-httpd_4.log &
if test $1 = 'fees'
@@ -475,6 +475,7 @@ then
echo " OK"
fi
+echo " OK"
echo -n "Waiting for anastasis services ..."