alpha
Login
or
Join now
soopy.moe
/
knotserver-module
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
module: add a simple test
author
Cassie Cheung
date
1 year ago
(Mar 18, 2025, 5:41 PM +0800)
commit
5636e492
5636e4924b530ce2e416dbeb30c3fe78f8c184cd
parent
c450e3ea
c450e3eac8a4a68907c99f77caf9cf3a7079b4e1
+34
-1
2 changed files
Expand all
Collapse all
Unified
Split
flake.nix
test.nix
+9
-1
flake.nix
Reviewed
···
17
17
};
18
18
};
19
19
20
20
-
outputs = { tangledCore, ... }: {
20
20
+
outputs = { self, tangledCore, nixpkgs }: let
21
21
+
lib = nixpkgs.lib;
22
22
+
testedSystems = ["x86_64-linux" "aarch64-linux"];
23
23
+
forAllSystems = fn: lib.genAttrs testedSystems (system: fn nixpkgs.legacyPackages.${system});
24
24
+
in {
21
25
nixosModules.default = import ./module.nix tangledCore;
26
26
+
27
27
+
checks = forAllSystems (pkgs: {
28
28
+
default = pkgs.callPackage ./test.nix { module = self.nixosModules.default; };
29
29
+
});
22
30
};
23
31
}
+25
test.nix
Reviewed
···
1
1
+
{ testers, module }:
2
2
+
3
3
+
testers.runNixOSTest {
4
4
+
name = "knotserver-basic";
5
5
+
6
6
+
defaults = {
7
7
+
imports = [ module ];
8
8
+
};
9
9
+
10
10
+
nodes.machine = {
11
11
+
services.tangled-knotserver = {
12
12
+
enable = true;
13
13
+
14
14
+
server.listenAddr = "127.0.0.1:5555";
15
15
+
server.hostname = "knot.example.org";
16
16
+
extraConfig.KNOT_SERVER_SECRET = "verysecuresecret";
17
17
+
};
18
18
+
};
19
19
+
20
20
+
testScript = ''
21
21
+
machine.wait_for_unit("knotserver.service")
22
22
+
machine.wait_for_open_port(5555)
23
23
+
machine.succeed('curl -f http://127.0.0.1:5555 | grep "This is a knot server"')
24
24
+
'';
25
25
+
}