summary refs log tree commit diff
path: root/nixos/tests/systemd-binfmt.nix
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2021-12-30 14:52:34 -0800
committerZhaofeng Li <hello@zhaofeng.li>2021-12-30 14:52:34 -0800
commitc8d137961d29b7ad1e9470718802209b0e636776 (patch)
tree44582a54f2377db8de6f31098f456abb7467afcc /nixos/tests/systemd-binfmt.nix
parent9e5d0a94581ef8769bf0184d495a43c5d80fda43 (diff)
downloadnixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.tar
nixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.tar.gz
nixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.tar.bz2
nixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.tar.lz
nixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.tar.xz
nixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.tar.zst
nixpkgs-c8d137961d29b7ad1e9470718802209b0e636776.zip
nixos/tests/systemd-binfmt: Add ldPreload test for LD_PRELOAD error messages
Diffstat (limited to 'nixos/tests/systemd-binfmt.nix')
-rw-r--r--nixos/tests/systemd-binfmt.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/nixos/tests/systemd-binfmt.nix b/nixos/tests/systemd-binfmt.nix
index dc7ca6c8825..a3a6efac3e4 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()
+    '';
+  };
 }