commit 9663e72a9da81d1febf2710551bc047b719b245f
parent f15b3fd73495e47be19f396a6d9d1bc0959f7bd3
Author: Marcello Stanisci <ms@taler.net>
Date: Mon, 4 May 2020 14:50:26 +0200
Integration test.
Programmatically start the services.
Diffstat:
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/integration-tests/test-ebics.py b/integration-tests/test-ebics.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python3
from requests import post, get
+from subprocess import call, Popen, PIPE
+from time import sleep
+import os
# Steps implemented in this test.
#
@@ -26,7 +29,6 @@ from requests import post, get
# 6 Request history again, from Nexus to Bank.
# 7 Verify that previous payment shows up.
-
# Nexus user details
USERNAME="person"
@@ -43,6 +45,38 @@ SUBSCRIBER_BIC="BUKBGB22"
SUBSCRIBER_NAME="Oliver Smith"
BANK_ACCOUNT_LABEL="savings"
+#-1 Clean databases and start services.
+assert(0 == call(["rm", "-f", "../sandbox/libeufin-sandbox.sqlite3"]))
+assert(0 == call(["rm", "-f", "../nexus/libeufin-nexus.sqlite3"]))
+DEVNULL = open(os.devnull, "w")
+
+# Start nexus
+nexus = Popen(["../gradlew", "nexus:run"], stdout=PIPE, stderr=PIPE)
+for i in range(10):
+ try:
+ get("http://localhost:5001/")
+ except:
+ if i == 9:
+ stdout, stderr = nexus.communicate()
+ print("{}\n{}".format(stdout.decode(), stderr.decode()))
+ exit(77)
+ sleep(1)
+ continue
+ break
+
+sandbox = Popen(["../gradlew", "sandbox:run"], stdout=PIPE, stderr=PIPE)
+for i in range(10):
+ try:
+ get("http://localhost:5000/")
+ except:
+ if i == 9:
+ stdout, stderr = nexus.communicate()
+ print("{}\n{}".format(stdout.decode(), stderr.decode()))
+ exit(77)
+ sleep(1)
+ continue
+ break
+
#0.a
resp = post(
"http://localhost:5000/admin/ebics-host",