commit 805dae3cccb639afda6f018babd3e6b7ac22cbe7
parent 5596d7321e45c93cf39e6d4b1e0ca336aa9e47e5
Author: Antoine A <>
Date: Thu, 25 Sep 2025 11:14:49 +0200
nexus: improve testbench
Diffstat:
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/testbench/README.md b/testbench/README.md
@@ -2,10 +2,10 @@
## Interactive EBICS test
-To add a platform write a minimal configuration file at `testbench/test/PLATFORM/ebics.conf` such as :
+To add a platform write a minimal configuration file at `testbench/test/conf/PLATFORM.conf` such as :
``` ini
-# testbench/test/PLATFORM/ebics.conf
+# testbench/test/conf/PLATFORM.conf
[nexus-ebics]
currency = CHF
@@ -31,7 +31,7 @@ make testbench platform=PLATFORM
If HOST_BASE_URL is one a known test platform we will generate and then offer to reset client private keys to test keys registration, otherwise, we will expect existing keys to be found at `testbench/test/PLATFORM/client-ebics-keys.json`.
-This minimal configuration will be augmented on start, you can find the full documentation at `testbench/test/PLATFORM/ebics.edited.conf`.
+This minimal configuration will be augmented on start, you can find the full documentation at `testbench/test/PLATFORM/ebics.conf`.
By default, the testbench will use a random dummy IBAN when issuing transactions, but you can specify a real IBAN for real-life testing in the testbench configuration at `testbench/test/config.json` :
diff --git a/testbench/src/main/kotlin/Main.kt b/testbench/src/main/kotlin/Main.kt
@@ -95,15 +95,22 @@ class Cli : CliktCommand() {
override fun run() {
// List available platform
- val platforms = Path("test").listDirectoryEntries().filter { it.isDirectory() }.map { it.fileName.toString() }
+ val platforms = Path("test/conf").listDirectoryEntries().mapNotNull {
+ val fileName = it.fileName.toString()
+ if (fileName == "config.json") {
+ null
+ } else {
+ fileName.removeSuffix(".conf")
+ }
+ }
if (!platforms.contains(platform)) {
println("Unknown platform '$platform', expected one of $platforms")
throw ProgramResult(1)
}
// Augment config
- val simpleCfg = Path("test/$platform/ebics.conf").readText()
- val conf = Path("test/$platform/ebics.edited.conf")
+ val simpleCfg = Path("test/conf/$platform.conf").readText()
+ val conf = Path("test/$platform/ebics.conf")
conf.writeText(
"""$simpleCfg
[paths]
@@ -134,7 +141,7 @@ class Cli : CliktCommand() {
}
// Read testbench config
- val benchCfg: Config = loadJsonFile(Path("test/config.json"), "testbench config")
+ val benchCfg: Config = loadJsonFile(Path("test/conf/config.json"), "testbench config")
?: Config(emptyMap())
// Prepare cmds
@@ -276,7 +283,7 @@ class Cli : CliktCommand() {
var clientKeys = loadClientKeys(clientKeysPath)
val bankKeys = loadBankKeys(bankKeysPath)
if (!kind.test && clientKeys == null) {
- throw Exception("Clients keys are required to run netzbon tests")
+ msg("Manual setup is required for non test enviroment")
} else if (clientKeys == null || !clientKeys.submitted_ini || !clientKeys.submitted_hia || bankKeys == null || !bankKeys.accepted) {
step("Run EBICS setup")
if (!nexusCmd.run("ebics-setup $debugFlags")) {