From c8d137961d29b7ad1e9470718802209b0e636776 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Thu, 30 Dec 2021 14:52:34 -0800 Subject: nixos/tests/systemd-binfmt: Add ldPreload test for LD_PRELOAD error messages --- nixos/tests/systemd-binfmt.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'nixos/tests/systemd-binfmt.nix') diff --git a/nixos/tests/systemd-binfmt.nix b/nixos/tests/systemd-binfmt.nix index dc7ca6c882506..a3a6efac3e4dc 100644 --- a/nixos/tests/systemd-binfmt.nix +++ b/nixos/tests/systemd-binfmt.nix @@ -68,4 +68,23 @@ in { machine.succeed("exec -a meow ${testAarch64} meow") ''; }; + + ldPreload = makeTest { + name = "systemd-binfmt-ld-preload"; + machine = { + boot.binfmt.emulatedSystems = [ + "aarch64-linux" + ]; + }; + testScript = let + helloAarch64 = pkgs.pkgsCross.aarch64-multiplatform.hello; + libredirectAarch64 = pkgs.pkgsCross.aarch64-multiplatform.libredirect; + in '' + machine.start() + + assert "error" not in machine.succeed( + "LD_PRELOAD='${libredirectAarch64}/lib/libredirect.so' ${helloAarch64}/bin/hello 2>&1" + ).lower() + ''; + }; } -- cgit 1.4.1