nixos/tests/cups-pdf: migration to runTest

https://github.com/NixOS/nixpkgs/issues/386873
This commit is contained in:
Yarny0
2025-03-05 18:55:53 +01:00
parent 2c8d3f48d3
commit f4f89032a1
2 changed files with 41 additions and 43 deletions

View File

@@ -343,7 +343,7 @@ in
crabfit = handleTest ./crabfit.nix { };
cri-o = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./cri-o.nix { };
cryptpad = runTest ./cryptpad.nix;
cups-pdf = handleTest ./cups-pdf.nix { };
cups-pdf = runTest ./cups-pdf.nix;
curl-impersonate = handleTest ./curl-impersonate.nix { };
custom-ca = handleTest ./custom-ca.nix { };
croc = handleTest ./croc.nix { };

View File

@@ -1,5 +1,4 @@
import ./make-test-python.nix (
{ lib, pkgs, ... }:
{ hostPkgs, lib, ... }:
{
name = "cups-pdf";
@@ -38,10 +37,9 @@ import ./make-test-python.nix (
machine.wait_until_succeeds(f"su - alice -c 'pdfinfo /var/spool/cups-pdf-{name}/users/alice/*.pdf'")
machine.succeed(f"cp /var/spool/cups-pdf-{name}/users/alice/*.pdf /tmp/{name}.pdf")
machine.copy_from_vm(f"/tmp/{name}.pdf", "")
run(f"${pkgs.imagemagickBig}/bin/convert -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True)
assert text.encode() in run(f"${lib.getExe pkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout
run(f"${hostPkgs.imagemagickBig}/bin/convert -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True)
assert text.encode() in run(f"${lib.getExe hostPkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout
'';
meta.maintainers = [ lib.maintainers.yarny ];
}
)