This commit is contained in:
2025-04-11 18:10:55 +02:00
parent a3b066859b
commit 0bcec807c8
2 changed files with 42 additions and 0 deletions

21
test/test.nix Normal file
View File

@@ -0,0 +1,21 @@
# ./tests/hello-world-server.nix
(import ./lib.nix) {
name = "from-nixos";
nodes = {
# `self` here is set by using specialArgs in `lib.nix`
node1 = { self, pkgs, ... }: {
imports = [ self.nixosModules.zineshop ];
services.zineshop.enable = true;
environment.systemPackages = [ pkgs.curl ];
};
};
testScript = ''
start_all() # wait for our service to start
node1.wait_for_unit("zineshop.service")
output = node1.succeed("curl localhost:8080")
# Check if our webserver returns the expected result
assert "Zine Shop" in output, f"'{output}' does not contain 'Zine Shop'"
'';
}