nixosTests.nscd: dump nscd socket info with sockdump
This dumps what's sent over the nscd socket to the console output, which allows debugging.
This commit is contained in:
parent
aee40c2d8a
commit
e7bc3e7504
@ -21,6 +21,24 @@ in
|
|||||||
192.0.2.1 somehost.test
|
192.0.2.1 somehost.test
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
systemd.services.sockdump = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
path = [
|
||||||
|
# necessary for bcc to unpack kernel headers and invoke modprobe
|
||||||
|
pkgs.gnutar
|
||||||
|
pkgs.xz.bin
|
||||||
|
pkgs.kmod
|
||||||
|
];
|
||||||
|
environment.PYTHONUNBUFFERED = "1";
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.sockdump}/bin/sockdump /var/run/nscd/socket";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "1";
|
||||||
|
Type = "simple";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
specialisation = {
|
specialisation = {
|
||||||
withUnscd.configuration = { ... }: {
|
withUnscd.configuration = { ... }: {
|
||||||
services.nscd.package = pkgs.unscd;
|
services.nscd.package = pkgs.unscd;
|
||||||
@ -63,6 +81,7 @@ in
|
|||||||
assert "somehost.test" in machine.succeed("${getent'} hosts 2001:db8::1")
|
assert "somehost.test" in machine.succeed("${getent'} hosts 2001:db8::1")
|
||||||
assert "somehost.test" in machine.succeed("${getent'} hosts 192.0.2.1")
|
assert "somehost.test" in machine.succeed("${getent'} hosts 192.0.2.1")
|
||||||
|
|
||||||
|
|
||||||
# Test host resolution via nss modules works
|
# Test host resolution via nss modules works
|
||||||
# We rely on nss-myhostname in this case, which resolves *.localhost and
|
# We rely on nss-myhostname in this case, which resolves *.localhost and
|
||||||
# _gateway.
|
# _gateway.
|
||||||
@ -88,6 +107,9 @@ in
|
|||||||
start_all()
|
start_all()
|
||||||
machine.wait_for_unit("default.target")
|
machine.wait_for_unit("default.target")
|
||||||
|
|
||||||
|
# give sockdump some time to finish attaching.
|
||||||
|
machine.sleep(5)
|
||||||
|
|
||||||
# Test all tests with glibc-nscd.
|
# Test all tests with glibc-nscd.
|
||||||
test_dynamic_user()
|
test_dynamic_user()
|
||||||
test_host_lookups()
|
test_host_lookups()
|
||||||
|
Loading…
Reference in New Issue
Block a user