mirror of
https://github.com/nix-community/disko.git
synced 2026-01-13 17:58:41 +01:00
QEMU on aarch64 requires an explicit machine type (e.g., '-machine virt'), unlike x86_64 which has a default. Previously, the test script hardcoded 'qemu-kvm' without machine type arguments, causing aarch64 tests to fail with "No machine specified, and there is no default". By importing and using nixpkgs' qemu-common.nix library, we reuse the existing platform-specific QEMU configuration logic.
36 lines
911 B
Nix
36 lines
911 B
Nix
{
|
|
makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix>,
|
|
eval-config ? import <nixpkgs/nixos/lib/eval-config.nix>,
|
|
qemu-common ? import <nixpkgs/nixos/lib/qemu-common.nix>,
|
|
pkgs ? import <nixpkgs> { },
|
|
}:
|
|
let
|
|
lib = pkgs.lib;
|
|
diskoLib = import ../lib {
|
|
inherit
|
|
lib
|
|
makeTest
|
|
eval-config
|
|
qemu-common
|
|
;
|
|
};
|
|
|
|
allTestFilenames = builtins.map (lib.removeSuffix ".nix") (
|
|
builtins.filter (x: lib.hasSuffix ".nix" x && x != "default.nix") (
|
|
lib.attrNames (builtins.readDir ./.)
|
|
)
|
|
);
|
|
incompatibleTests = lib.optionals pkgs.stdenv.buildPlatform.isRiscV64 [
|
|
"zfs"
|
|
"zfs-over-legacy"
|
|
"cli"
|
|
"module"
|
|
"complex"
|
|
];
|
|
allCompatibleFilenames = lib.subtractLists incompatibleTests allTestFilenames;
|
|
|
|
allTests = lib.genAttrs allCompatibleFilenames (
|
|
test: import (./. + "/${test}.nix") { inherit diskoLib pkgs; }
|
|
);
|
|
in
|
|
allTests
|