anchor.diff:        networking.enableIPv6 = enableIPv6;
       };
       testScript = ''
  -      startAll
  -      $machine->waitForUnit("multi-user.target");
  -      $machine->waitForOpenPort(11334);
  -      $machine->waitForUnit("rspamd.service");
  -      $machine->succeed("id \"rspamd\" >/dev/null");
  +      start_all()
  +      machine.wait_for_unit("multi-user.target")
  +      machine.wait_for_open_port(11334)
  +      machine.wait_for_unit("rspamd.service")
  +      machine.succeed("id rspamd >/dev/null")
         ${checkSocket "/run/rspamd/rspamd.sock" "rspamd" "rspamd" "660" }
  -      sleep 10;
  -      $machine->log($machine->succeed("cat /etc/rspamd/rspamd.conf"));
  -      $machine->log($machine->succeed("grep 'CONFDIR/worker-controller.inc' /etc/rspamd/rspamd.conf"));
  -      $machine->log($machine->succeed("grep 'CONFDIR/worker-normal.inc' /etc/rspamd/rspamd.conf"));
  -      $machine->log($machine->succeed("systemctl cat rspamd.service"));
  -      $machine->log($machine->succeed("curl http://localhost:11334/auth"));
  -      $machine->log($machine->succeed("curl http://127.0.0.1:11334/auth"));
  -      ${optionalString enableIPv6 ''
  -        $machine->log($machine->succeed("curl http://[::1]:11334/auth"));
  -      ''}
  +      machine.sleep(10)
  +      machine.log(machine.succeed("cat /etc/rspamd/rspamd.conf"))
  +      machine.log(
  +          machine.succeed("grep 'CONFDIR/worker-controller.inc' /etc/rspamd/rspamd.conf")
  +      )
  +      machine.log(machine.succeed("grep 'CONFDIR/worker-normal.inc' /etc/rspamd/rspamd.conf"))
  +      machine.log(machine.succeed("systemctl cat rspamd.service"))
  +      machine.log(machine.succeed("curl http://localhost:11334/auth"))
  +      machine.log(machine.succeed("curl http://127.0.0.1:11334/auth"))
  +      ${optionalString enableIPv6 ''machine.log(machine.succeed("curl http://[::1]:11334/auth"))''}
  +      # would not reformat
       '';
     };
   in
  
positive.code:     };
      testScript = ''
        ${initMachine}
        $machine->waitForOpenPort(11334);
        $machine->log($machine->succeed("cat /etc/rspamd/rspamd.conf"));
        $machine->log($machine->succeed("cat /etc/rspamd/rspamd.local.lua"));
        $machine->log($machine->succeed("cat /etc/rspamd/local.d/groups.conf"));
        # Verify that redis.conf was not written
        $machine->fail("cat /etc/rspamd/local.d/redis.conf >&2");
        # Verify that antivirus.conf was not written
        $machine->fail("cat /etc/rspamd/local.d/antivirus.conf >&2");
        ${checkSocket "/run/rspamd/rspamd.sock" "rspamd" "rspamd" "660" }
        $machine->log($machine->succeed("curl --unix-socket /run/rspamd/rspamd.sock http://localhost/ping"));
        $machine->log($machine->succeed("rspamc -h 127.0.0.1:11334 stat"));
        $machine->log($machine->succeed("cat /etc/tests/no-muh.eml | rspamc -h 127.0.0.1:11334"));
        $machine->log($machine->succeed("cat /etc/tests/muh.eml | rspamc -h 127.0.0.1:11334 symbols"));
        $machine->waitUntilSucceeds("journalctl -u rspamd | grep -i muh >&2");
        $machine->log($machine->fail("cat /etc/tests/no-muh.eml | rspamc -h 127.0.0.1:11334 symbols | grep NO_MUH"));
        $machine->log($machine->succeed("cat /etc/tests/muh.eml | rspamc -h 127.0.0.1:11334 symbols | grep NO_MUH"));
      '';
    };
    postfixIntegration = makeTest {
  
negative.code:     };
      testScript = ''
        ${initMachine}
        machine.wait_for_open_port(11334)
        machine.wait_for_open_port(25)
        ${checkSocket "/run/rspamd/rspamd-milter.sock" "rspamd" "postfix" "660" }
        machine.log(machine.succeed("rspamc -h 127.0.0.1:11334 stat"))
        machine.log(
            machine.succeed(
                "msmtp --host=localhost -t --read-envelope-from < /etc/tests/example.eml"
            )
        )
        machine.log(
            machine.fail(
                "msmtp --host=localhost -t --read-envelope-from < /etc/tests/gtube.eml"
            )
        )
  
        machine.wait_until_fails('[ "$(postqueue -p)" != "Mail queue is empty" ]')
        machine.fail("journalctl -u postfix | grep -i error >&2")
        machine.fail("journalctl -u postfix | grep -i warning >&2")
      '';
    };
  }
  