Loading nixos/tests/all-tests.nix +4 −2 Original line number Diff line number Diff line Loading @@ -828,8 +828,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 {}; Loading nixos/tests/printing.nix +11 −5 Original line number Diff line number Diff line Loading @@ -3,12 +3,17 @@ import ./make-test-python.nix ( { pkgs , socket ? true # whether to use socket activation , listenTcp ? true # whether to open port 631 on client , ... }: let inherit (pkgs) lib; in { name = "printing"; meta = with pkgs.lib.maintainers; { meta = with lib.maintainers; { maintainers = [ domenkozar matthewbauer ]; }; Loading @@ -35,9 +40,10 @@ import ./make-test-python.nix ( }]; }; 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"; Loading @@ -54,8 +60,8 @@ import ./make-test-python.nix ( start_all() with subtest("Make sure that cups is up on both sides and printers are set up"): server.wait_for_unit("cups.${if socket then "socket" else "service"}") client.wait_for_unit("cups.${if socket then "socket" else "service"}") server.wait_for_unit("ensure-printers.service") client.wait_for_unit("ensure-printers.service") assert "scheduler is running" in client.succeed("lpstat -r") Loading @@ -63,7 +69,7 @@ import ./make-test-python.nix ( 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/") Loading pkgs/misc/cups/default.nix +3 −0 Original line number Diff line number Diff line Loading @@ -138,8 +138,11 @@ stdenv.mkDerivation rec { passthru.tests = { inherit (nixosTests) cups-pdf printing-service printing-socket printing-service-notcp printing-socket-notcp ; }; Loading Loading
nixos/tests/all-tests.nix +4 −2 Original line number Diff line number Diff line Loading @@ -828,8 +828,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 {}; Loading
nixos/tests/printing.nix +11 −5 Original line number Diff line number Diff line Loading @@ -3,12 +3,17 @@ import ./make-test-python.nix ( { pkgs , socket ? true # whether to use socket activation , listenTcp ? true # whether to open port 631 on client , ... }: let inherit (pkgs) lib; in { name = "printing"; meta = with pkgs.lib.maintainers; { meta = with lib.maintainers; { maintainers = [ domenkozar matthewbauer ]; }; Loading @@ -35,9 +40,10 @@ import ./make-test-python.nix ( }]; }; 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"; Loading @@ -54,8 +60,8 @@ import ./make-test-python.nix ( start_all() with subtest("Make sure that cups is up on both sides and printers are set up"): server.wait_for_unit("cups.${if socket then "socket" else "service"}") client.wait_for_unit("cups.${if socket then "socket" else "service"}") server.wait_for_unit("ensure-printers.service") client.wait_for_unit("ensure-printers.service") assert "scheduler is running" in client.succeed("lpstat -r") Loading @@ -63,7 +69,7 @@ import ./make-test-python.nix ( 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/") Loading
pkgs/misc/cups/default.nix +3 −0 Original line number Diff line number Diff line Loading @@ -138,8 +138,11 @@ stdenv.mkDerivation rec { passthru.tests = { inherit (nixosTests) cups-pdf printing-service printing-socket printing-service-notcp printing-socket-notcp ; }; Loading