diff options
author | Florian Dold <florian@dold.me> | 2021-03-03 21:20:05 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-03-03 21:20:05 +0100 |
commit | 1a0610f222f841237f9940a3a3a55635eec7d324 (patch) | |
tree | b80c67be371a006080cd26b2d61f26cd3aa77697 /packages/taler-wallet-cli/src/integrationtests/harness.ts | |
parent | 186a38250ff4a11f88c8956db4da574f08e741dc (diff) | |
download | wallet-core-1a0610f222f841237f9940a3a3a55635eec7d324.tar.xz |
WIP: wallet backup integration test
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/harness.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/harness.ts | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts b/packages/taler-wallet-cli/src/integrationtests/harness.ts index 118bc35d4..a2d2b8e13 100644 --- a/packages/taler-wallet-cli/src/integrationtests/harness.ts +++ b/packages/taler-wallet-cli/src/integrationtests/harness.ts @@ -99,6 +99,7 @@ import { import { ApplyRefundResponse } from "@gnu-taler/taler-wallet-core"; import { PendingOperationsResponse } from "@gnu-taler/taler-wallet-core"; import { CoinConfig } from "./denomStructures"; +import { AddBackupProviderRequest, BackupInfo } from "@gnu-taler/taler-wallet-core/src/operations/backup"; const exec = util.promisify(require("child_process").exec); @@ -396,7 +397,11 @@ export interface TalerConfig { } export interface DbInfo { + /** + * Postgres connection string. + */ connStr: string; + dbname: string; } @@ -418,7 +423,7 @@ export interface BankConfig { maxDebt?: string; } -function setPaths(config: Configuration, home: string) { +function setTalerPaths(config: Configuration, home: string) { config.setString("paths", "taler_home", home); // We need to make sure that the path of taler_runtime_dir isn't too long, // as it contains unix domain sockets (108 character limit). @@ -647,7 +652,7 @@ export class BankService implements BankServiceInterface { bc: BankConfig, ): Promise<BankService> { const config = new Configuration(); - setPaths(config, gc.testDir + "/talerhome"); + setTalerPaths(config, gc.testDir + "/talerhome"); config.setString("taler", "currency", bc.currency); config.setString("bank", "database", bc.database); config.setString("bank", "http_port", `${bc.httpPort}`); @@ -860,7 +865,7 @@ export class ExchangeService implements ExchangeServiceInterface { "currency_round_unit", e.roundUnit ?? `${e.currency}:0.01`, ); - setPaths(config, gc.testDir + "/talerhome"); + setTalerPaths(config, gc.testDir + "/talerhome"); config.setString( "exchange", @@ -1425,7 +1430,7 @@ export class MerchantService implements MerchantServiceInterface { config.setString("taler", "currency", mc.currency); const cfgFilename = gc.testDir + `/merchant-${mc.name}.conf`; - setPaths(config, gc.testDir + "/talerhome"); + setTalerPaths(config, gc.testDir + "/talerhome"); config.setString("merchant", "serve", "tcp"); config.setString("merchant", "port", `${mc.httpPort}`); config.setString( @@ -1846,4 +1851,20 @@ export class WalletCli { } throw new OperationFailedError(resp.error); } + + async addBackupProvider(req: AddBackupProviderRequest): Promise<void> { + const resp = await this.apiRequest("addBackupProvider", req); + if (resp.type === "response") { + return; + } + throw new OperationFailedError(resp.error); + } + + async getBackupInfo(): Promise<BackupInfo> { + const resp = await this.apiRequest("getBackupInfo", {}); + if (resp.type === "response") { + return resp.result as BackupInfo; + } + throw new OperationFailedError(resp.error); + } } |