Commit d22cd44d authored by Felix Buehler's avatar Felix Buehler
Browse files

nixosTests.bentopdf: init

parent ec60ef02
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ in
  beanstalkd = runTest ./beanstalkd.nix;
  bees = runTest ./bees.nix;
  benchexec = runTest ./benchexec.nix;
  bentopdf = handleTest ./bentopdf { };
  beszel = runTest ./beszel.nix;
  binary-cache = runTest {
    imports = [ ./binary-cache.nix ];
+28 −0
Original line number Diff line number Diff line
import ../make-test-python.nix (
  { lib, ... }:

  {
    name = "bentopdf-caddy";
    meta.maintainers = with lib.maintainers; [ stunkymonkey ];

    nodes.machine =
      { pkgs, ... }:
      {
        services.bentopdf = {
          enable = true;
          domain = "localhost:80";
          caddy.enable = true;
          caddy.virtualHost.extraConfig = "tls internal";
        };
        # disable letsencrypt cert fetching
        services.caddy.globalConfig = "auto_https disable_certs";
      };

    testScript = ''
      machine.wait_for_unit("caddy.service")
      machine.wait_for_open_port(80)
      machine.succeed("curl -vvv --fail --show-error --silent --location --insecure http://localhost/")
      assert "<title>BentoPDF - The Privacy First PDF Toolkit</title>" in machine.succeed("curl --fail --show-error --silent --location --insecure http://localhost/")
    '';
  }
)
+6 −0
Original line number Diff line number Diff line
{ system, pkgs, ... }:

{
  caddy = import ./caddy.nix { inherit system pkgs; };
  nginx = import ./nginx.nix { inherit system pkgs; };
}
+24 −0
Original line number Diff line number Diff line
import ../make-test-python.nix (
  { lib, ... }:

  {
    name = "bentopdf-nginx";
    meta.maintainers = with lib.maintainers; [ stunkymonkey ];

    nodes.machine =
      { pkgs, ... }:
      {
        services.bentopdf = {
          enable = true;
          domain = "localhost";
          nginx.enable = true;
        };
      };

    testScript = ''
      machine.wait_for_unit("nginx.service")
      machine.wait_for_open_port(80)
      assert "<title>BentoPDF - The Privacy First PDF Toolkit</title>" in machine.succeed("curl --fail --show-error --silent --location --insecure http://localhost:80/")
    '';
  }
)
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildNpmPackage,
  fetchFromGitHub,
  nixosTests,
  simpleMode ? true,
}:
buildNpmPackage (finalAttrs: {
@@ -36,6 +37,10 @@ buildNpmPackage (finalAttrs: {
    runHook postInstall
  '';

  passthru.tests = {
    inherit (nixosTests.bentopdf) caddy nginx;
  };

  meta = {
    description = "Privacy-first PDF toolkit";
    homepage = "https://bentopdf.com";