Skip to content
This repository was archived by the owner on Jul 7, 2024. It is now read-only.

Commit 5680cda

Browse files
committed
srv: implement tests
1 parent 6d2211c commit 5680cda

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

nixos-modules.nix

+1
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ args@{ self, system, nixpkgsFor, libFor, nixosLibFor, ldflags, packages, ...
425425
};
426426
systemd.services.qrystal-cs = {
427427
wants = [ "network-online.target" ];
428+
wantedBy = [ "multi-user.target" ];
428429
serviceConfig = let pkg = packages.cs;
429430
in {
430431
User = "qrystal-cs";

test.nix

+12
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,17 @@ in {
160160
imports = [
161161
base
162162
self.outputs.nixosModules.${system}.node
163+
{
164+
qrystal.services.node.config.srvList = pkgs.writeText "srvlist.json" (builtins.toJSON {
165+
${networkName} = [{
166+
Service = "_testservice";
167+
Protocol = "_tcp";
168+
Priority = "10";
169+
Weight = "10";
170+
Port = "123";
171+
}];
172+
});
173+
}
163174
];
164175

165176
networking.firewall.allowedTCPPorts = [ 39251 ];
@@ -247,6 +258,7 @@ in {
247258
for node in nodes:
248259
assert pp(node.execute("host idkpeer.testnet.qrystal.internal 127.0.0.39"))[0] == 1
249260
assert pp(node.execute("host node1.idknet.qrystal.internal 127.0.0.39"))[0] == 1
261+
assert pp(node.execute("host _testservice._tcp.idkpeer.testnet.qrystal.internal 127.0.0.39"))[0] == 1
250262
# TODO: test network level queries
251263
'';
252264
});

0 commit comments

Comments
 (0)