1 import ./make-test-python.nix ({ pkgs, ...} : {
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ zhaofengli ];
8 printer = { config, pkgs, ... }: {
9 security.polkit.enable = true;
11 services.moonraker = {
13 allowSystemControl = true;
17 trusted_clients = [ "127.0.0.0/8" "::1/128" ];
28 # No mcu configured so won't even enter `ready` state
37 printer.wait_for_unit("klipper.service")
38 printer.wait_for_unit("moonraker.service")
39 printer.wait_until_succeeds("curl http://localhost:7125/printer/info | grep -v 'Not Found' >&2", timeout=30)
41 with subtest("Check that we can perform system-level operations"):
42 printer.succeed("curl -X POST http://localhost:7125/machine/services/stop?service=klipper | grep ok >&2")
43 printer.wait_until_succeeds("systemctl --no-pager show klipper.service | grep ActiveState=inactive", timeout=10)