Skip to content

Commit

Permalink
nixos/e2e: add cctlModule to e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanp committed Mar 20, 2024
1 parent b79a71b commit a8bfb72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
9 changes: 9 additions & 0 deletions nixos/tests/end-to-end.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
, mkKairosHostConfig
, kairos
, testResources ? ../../kairos-cli/tests/fixtures
, cctlModule
, casper-client-rs
}:
nixosTest {
name = "kairos e2e test";
Expand All @@ -10,13 +12,16 @@ nixosTest {
server = { config, pkgs, lib, ... }: {
imports = [
(mkKairosHostConfig "kairos")
cctlModule
];

# modify acme for nixos-test environment
security.acme = {
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, ... }: {
Expand All @@ -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)))
Expand Down

0 comments on commit a8bfb72

Please sign in to comment.