From a27582f5fec247fc3ff5e0cd2deb5c400a0fd6b6 Mon Sep 17 00:00:00 2001 From: Izel Nakri Date: Mon, 24 Mar 2025 19:42:20 +0100 Subject: [PATCH] nixosTests/bitbox-bridge: init only run these tests on linux Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com> --- nixos/tests/all-tests.nix | 1 + nixos/tests/bitbox-bridge.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 nixos/tests/bitbox-bridge.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 35d6d0c0cfaa..c746802f5e57 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -214,6 +214,7 @@ in { bind = handleTest ./bind.nix {}; bird = handleTest ./bird.nix {}; birdwatcher = handleTest ./birdwatcher.nix {}; + bitbox-bridge = runTest ./bitbox-bridge.nix; bitcoind = handleTest ./bitcoind.nix {}; bittorrent = handleTest ./bittorrent.nix {}; blockbook-frontend = handleTest ./blockbook-frontend.nix {}; diff --git a/nixos/tests/bitbox-bridge.nix b/nixos/tests/bitbox-bridge.nix new file mode 100644 index 000000000000..0fe4ea94acb9 --- /dev/null +++ b/nixos/tests/bitbox-bridge.nix @@ -0,0 +1,30 @@ +{ lib, ... }: + +let + testPort = 8179; +in +{ + name = "bitbox-bridge"; + meta = { + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + izelnakri + tensor5 + ]; + }; + + nodes.machine = { + services.bitbox-bridge = { + enable = true; + port = testPort; + runOnMount = false; + }; + }; + + testScript = '' + start_all() + machine.wait_for_unit("bitbox-bridge.service") + machine.wait_for_open_port(${toString testPort}) + machine.wait_until_succeeds("curl -fL http://localhost:${toString testPort}/api/info | grep version") + ''; +}