flake.nix: Add basic check for opening the home page
This commit is contained in:
parent
b76e61a55a
commit
b88937af54
|
@ -64,5 +64,10 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
checks.${system} = import ./nix/checks {
|
||||
inherit self system;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
9
nix/checks/default.nix
Normal file
9
nix/checks/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
pkgs,
|
||||
self,
|
||||
system,
|
||||
}: let
|
||||
callPackage = pkgs.lib.callPackageWith (pkgs // {inherit self;});
|
||||
in {
|
||||
openHomepage = callPackage ./open-homepage.nix {};
|
||||
}
|
35
nix/checks/open-homepage.nix
Normal file
35
nix/checks/open-homepage.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
self,
|
||||
nixosTest,
|
||||
}:
|
||||
nixosTest {
|
||||
nodes = {
|
||||
host = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [self.nixosModules.default];
|
||||
|
||||
services.tlaternet-webserver = {
|
||||
enable = true;
|
||||
listen = {
|
||||
addr = "0.0.0.0";
|
||||
port = 8000;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [8000];
|
||||
};
|
||||
|
||||
client = {pkgs, ...}: {};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
host.wait_for_unit("default.target")
|
||||
client.succeed("curl --fail http://host:8000/ >&2")
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue