diff options
author | MS <ms@taler.net> | 2021-02-03 14:34:31 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2021-02-03 14:34:31 +0100 |
commit | a3b84dca53dc78ee8db1353d828898c6aa07be9a (patch) | |
tree | b1428d367706b012845c1e24ef8c62720b26fe3b /packages | |
parent | d8c4b2734e1b5a8fd125631a909513be84a68c8d (diff) |
libeufin tutorial test: check sandbox step
Diffstat (limited to 'packages')
3 files changed, 39 insertions, 4 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts b/packages/taler-wallet-cli/src/integrationtests/harness.ts index 5c29d1642..bd950da0b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/harness.ts +++ b/packages/taler-wallet-cli/src/integrationtests/harness.ts @@ -136,6 +136,7 @@ export async function sh( t: GlobalTestState, logName: string, command: string, + env: { [index: string]: string | undefined } = process.env, ): Promise<string> { console.log("runing command", command); return new Promise((resolve, reject) => { @@ -143,6 +144,7 @@ export async function sh( const proc = spawn(command, { stdio: ["inherit", "pipe", "pipe"], shell: true, + env: env, }); proc.stdout.on("data", (x) => { if (x instanceof Buffer) { diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts index 971505cbb..486837e9b 100644 --- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts +++ b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts @@ -25,6 +25,7 @@ import { ProcessWrapper, runCommand, extendEnv, + sh, } from "./harness"; export interface LibeufinSandboxServiceInterface { @@ -45,6 +46,13 @@ export interface LibeufinNexusConfig { databaseJdbcUri: string; } +export interface LibeufinCliDetails { + nexusUrl: string; + sandboxUrl: string; + nexusDatabaseUri: string; + sandboxDatabaseUri: string; +} + export class LibeufinSandboxService implements LibeufinSandboxServiceInterface { static async create( gc: GlobalTestState, @@ -171,6 +179,25 @@ export interface SimulateIncomingTransactionRequest { currency: string; } +export class LibeufinCli { + cliDetails: LibeufinCliDetails; + globalTestState: GlobalTestState; + + constructor(gc: GlobalTestState, cd: LibeufinCliDetails) { + this.globalTestState = gc; + this.cliDetails = cd; + } + + async checkSandbox(): Promise<void> { + await sh( + this.globalTestState, + "libeufin-cli-checksandbox", + "libeufin-cli sandbox check", + extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }), + ); + } +} + export namespace LibeufinSandboxApi { export async function createEbicsHost( libeufinSandboxService: LibeufinSandboxServiceInterface, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts index 817bfad8e..dce5e8869 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts @@ -19,17 +19,15 @@ */ import { CoreApiResponse } from "@gnu-taler/taler-wallet-core"; import { CoinConfig, defaultCoinConfig } from "./denomStructures"; -import { - GlobalTestState, -} from "./harness"; +import { GlobalTestState } from "./harness"; import { LibeufinNexusApi, LibeufinNexusService, LibeufinSandboxApi, LibeufinSandboxService, + LibeufinCli, } from "./libeufin"; - /** * Run basic test with LibEuFin. */ @@ -52,4 +50,12 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) { await libeufinNexus.start(); await libeufinNexus.pingUntilAvailable(); + const libeufinCli = new LibeufinCli(t, { + sandboxUrl: libeufinSandbox.baseUrl, + nexusUrl: libeufinNexus.baseUrl, + sandboxDatabaseUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`, + nexusDatabaseUri: `jdbc:sqlite:${t.testDir}/libeufin-nexus.sqlite3`, + }); + + await libeufinCli.checkSandbox(); } |