diff --git a/nixos/default.nix b/nixos/default.nix index dee0f65b..494dce20 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -30,7 +30,9 @@ in ./tests/end-to-end.nix { inherit mkKairosHostConfig; - inherit (self.packages."x86_64-linux") kairos; + inherit (self.packages.${pkgs.system}) kairos; + cctlModule = self.nixosModules.cctl; + inherit (inputs.csprpkgs.packages.${pkgs.system}) casper-client-rs; }; }; nixosModules = { diff --git a/nixos/tests/end-to-end.nix b/nixos/tests/end-to-end.nix index 335fa8b4..fb81c59b 100644 --- a/nixos/tests/end-to-end.nix +++ b/nixos/tests/end-to-end.nix @@ -2,6 +2,8 @@ , mkKairosHostConfig , kairos , testResources ? ../../kairos-cli/tests/fixtures +, cctlModule +, casper-client-rs }: nixosTest { name = "kairos e2e test"; @@ -10,6 +12,7 @@ nixosTest { server = { config, pkgs, lib, ... }: { imports = [ (mkKairosHostConfig "kairos") + cctlModule ]; # modify acme for nixos-test environment @@ -17,6 +20,8 @@ nixosTest { preliminarySelfsigned = true; defaults.server = "https://example.com"; # don't spam the acme production server }; + services.cctl.enable = true; + environment.systemPackages = [ casper-client-rs ]; }; client = { config, pkgs, nodes, ... }: { @@ -29,12 +34,16 @@ nixosTest { start_all() + kairos.wait_for_unit("cctl.service") + kairos.wait_for_unit("kairos.service") kairos.wait_for_unit("nginx.service") kairos.wait_for_open_port(80) client.wait_for_unit ("multi-user.target") + kairos.succeed("casper-client get-node-status --node-address http://localhost:11101") + deposit_request = { "public_key": "publickey", "amount": 10 } # REST API client.succeed("curl -X POST http://kairos/api/v1/deposit -H 'Content-Type: application/json' -d '{}'".format(json.dumps(deposit_request)))