diff options
author | Florian Klink <flokli@flokli.de> | 2020-05-18 11:16:56 +0200 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2020-05-18 11:28:03 +0200 |
commit | fd49155848a8ee8aa2f103fe765ddb9aed1b3d2d (patch) | |
tree | c2542e6f7fde2a3d07608349d9cf8abdc3cb6ef1 /nixos/tests/systemd-binfmt.nix | |
parent | 4e2715934e2c995554c5d70fe4eea12716425480 (diff) |
nixosTests.systemd-binfmt: init
This adds a simple test running GNU Hello cross-compiled for armv7l and aarch64 inside a x86_64 VM with configured binfmt. We already build the cross toolchains in other invocations, and building hello itself is small.
Diffstat (limited to 'nixos/tests/systemd-binfmt.nix')
-rw-r--r-- | nixos/tests/systemd-binfmt.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/systemd-binfmt.nix b/nixos/tests/systemd-binfmt.nix new file mode 100644 index 0000000000000..2a676f3da98b6 --- /dev/null +++ b/nixos/tests/systemd-binfmt.nix @@ -0,0 +1,24 @@ +# Teach the kernel how to run armv7l and aarch64-linux binaries, +# and run GNU Hello for these architectures. +import ./make-test-python.nix ({ pkgs, ... }: { + name = "systemd-binfmt"; + machine = { + boot.binfmt.emulatedSystems = [ + "armv7l-linux" + "aarch64-linux" + ]; + }; + + testScript = let + helloArmv7l = pkgs.pkgsCross.armv7l-hf-multiplatform.hello; + helloAarch64 = pkgs.pkgsCross.aarch64-multiplatform.hello; + in '' + machine.start() + assert "world" in machine.succeed( + "${helloArmv7l}/bin/hello" + ) + assert "world" in machine.succeed( + "${helloAarch64}/bin/hello" + ) + ''; +}) |