nixos/tests/printing: test cases for domain socket only config
Add two new vm tests for the printing configuration that test `listenAddresses = []`, i.e., the situation where cups only listens on the unix domain socket `/run/cups/cups.sock`. This helps catching bugs like this: https://github.com/OpenPrinting/cups/issues/985 https://github.com/NixOS/nixpkgs/pull/337748
This commit is contained in:
parent
2e48883fc4
commit
9bca42857a
@ -827,8 +827,10 @@ in {
|
||||
predictable-interface-names = handleTest ./predictable-interface-names.nix {};
|
||||
pretalx = runTest ./web-apps/pretalx.nix;
|
||||
pretix = runTest ./web-apps/pretix.nix;
|
||||
printing-socket = handleTest ./printing.nix { socket = true; };
|
||||
printing-service = handleTest ./printing.nix { socket = false; };
|
||||
printing-socket = handleTest ./printing.nix { socket = true; listenTcp = true; };
|
||||
printing-service = handleTest ./printing.nix { socket = false; listenTcp = true; };
|
||||
printing-socket-notcp = handleTest ./printing.nix { socket = true; listenTcp = false; };
|
||||
printing-service-notcp = handleTest ./printing.nix { socket = false; listenTcp = false; };
|
||||
private-gpt = handleTest ./private-gpt.nix {};
|
||||
privatebin = runTest ./privatebin.nix;
|
||||
privoxy = handleTest ./privoxy.nix {};
|
||||
|
@ -3,6 +3,7 @@
|
||||
import ./make-test-python.nix (
|
||||
{ pkgs
|
||||
, socket ? true # whether to use socket activation
|
||||
, listenTcp ? true # whether to open port 631 on client
|
||||
, ...
|
||||
}:
|
||||
|
||||
@ -39,9 +40,10 @@ in
|
||||
}];
|
||||
};
|
||||
|
||||
nodes.client = { ... }: {
|
||||
nodes.client = { lib, ... }: {
|
||||
services.printing.enable = true;
|
||||
services.printing.startWhenNeeded = socket;
|
||||
services.printing.listenAddresses = lib.mkIf (!listenTcp) [];
|
||||
# Add printer to the client as well, via IPP.
|
||||
hardware.printers.ensurePrinters = [{
|
||||
name = "DeskjetRemote";
|
||||
@ -67,7 +69,7 @@ in
|
||||
assert "/var/run/cups/cups.sock" in client.succeed("lpstat -H")
|
||||
|
||||
with subtest("HTTP server is available too"):
|
||||
client.succeed("curl --fail http://localhost:631/")
|
||||
${lib.optionalString listenTcp ''client.succeed("curl --fail http://localhost:631/")''}
|
||||
client.succeed(f"curl --fail http://{server.name}:631/")
|
||||
server.fail(f"curl --fail --connect-timeout 2 http://{client.name}:631/")
|
||||
|
||||
|
@ -141,6 +141,8 @@ stdenv.mkDerivation rec {
|
||||
cups-pdf
|
||||
printing-service
|
||||
printing-socket
|
||||
printing-service-notcp
|
||||
printing-socket-notcp
|
||||
;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user