Loading nixos/tests/systemd-binfmt.nix +25 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,29 @@ in { ).lower() ''; }; chroot = makeTest { name = "systemd-binfmt-chroot"; nodes.machine = { pkgs, lib, ... }: { boot.binfmt.emulatedSystems = [ "aarch64-linux" "wasm32-wasi" ]; boot.binfmt.preferStaticEmulators = true; environment.systemPackages = [ (pkgs.writeShellScriptBin "test-chroot" '' set -euo pipefail mkdir -p /tmp/chroot cp ${lib.getExe' pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic.busybox "busybox"} /tmp/chroot/busybox cp ${lib.getExe pkgs.pkgsCross.wasi32.yaml2json} /tmp/chroot/yaml2json # wasi binaries that build are hard to come by chroot /tmp/chroot /busybox uname -m | grep aarch64 echo 42 | chroot /tmp/chroot /yaml2json | grep 42 '') ]; }; testScript = '' machine.start() machine.succeed("test-chroot") ''; }; } Loading
nixos/tests/systemd-binfmt.nix +25 −0 Original line number Diff line number Diff line Loading @@ -87,4 +87,29 @@ in { ).lower() ''; }; chroot = makeTest { name = "systemd-binfmt-chroot"; nodes.machine = { pkgs, lib, ... }: { boot.binfmt.emulatedSystems = [ "aarch64-linux" "wasm32-wasi" ]; boot.binfmt.preferStaticEmulators = true; environment.systemPackages = [ (pkgs.writeShellScriptBin "test-chroot" '' set -euo pipefail mkdir -p /tmp/chroot cp ${lib.getExe' pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic.busybox "busybox"} /tmp/chroot/busybox cp ${lib.getExe pkgs.pkgsCross.wasi32.yaml2json} /tmp/chroot/yaml2json # wasi binaries that build are hard to come by chroot /tmp/chroot /busybox uname -m | grep aarch64 echo 42 | chroot /tmp/chroot /yaml2json | grep 42 '') ]; }; testScript = '' machine.start() machine.succeed("test-chroot") ''; }; }