mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 10:23:29 +00:00
Installer test: Remove fileSystems argument
The config function unintentionally ignored its fileSystems argument. However, things still worked thanks to the magic of nixos-generate-config. Yay!
This commit is contained in:
parent
fed7a43020
commit
077ecf43e5
@ -34,7 +34,7 @@ let
|
|||||||
|
|
||||||
|
|
||||||
# The configuration to install.
|
# The configuration to install.
|
||||||
config = { fileSystems, testChannel, grubVersion, grubDevice }: pkgs.writeText "configuration.nix"
|
config = { testChannel, grubVersion, grubDevice }: pkgs.writeText "configuration.nix"
|
||||||
''
|
''
|
||||||
{ config, pkgs, modulesPath, ... }:
|
{ config, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
@ -54,16 +54,6 @@ let
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
rootFS =
|
|
||||||
''
|
|
||||||
fileSystems."/".device = "/dev/disk/by-label/nixos";
|
|
||||||
'';
|
|
||||||
|
|
||||||
bootFS =
|
|
||||||
''
|
|
||||||
fileSystems."/boot".device = "/dev/disk/by-label/boot";
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
|
||||||
# Configuration of a web server that simulates the Nixpkgs channel
|
# Configuration of a web server that simulates the Nixpkgs channel
|
||||||
# distribution server.
|
# distribution server.
|
||||||
@ -90,9 +80,8 @@ let
|
|||||||
# The test script boots the CD, installs NixOS on an empty hard
|
# The test script boots the CD, installs NixOS on an empty hard
|
||||||
# disk, and then reboot from the hard disk. It's parameterized with
|
# disk, and then reboot from the hard disk. It's parameterized with
|
||||||
# a test script fragment `createPartitions', which must create
|
# a test script fragment `createPartitions', which must create
|
||||||
# partitions and filesystems, and a configuration.nix fragment
|
# partitions and filesystems.
|
||||||
# `fileSystems'.
|
testScriptFun = { createPartitions, testChannel, grubVersion, grubDevice }:
|
||||||
testScriptFun = { createPartitions, fileSystems, testChannel, grubVersion, grubDevice }:
|
|
||||||
let iface = if grubVersion == 1 then "scsi" else "virtio"; in
|
let iface = if grubVersion == 1 then "scsi" else "virtio"; in
|
||||||
''
|
''
|
||||||
createDisk("harddisk", 4 * 1024);
|
createDisk("harddisk", 4 * 1024);
|
||||||
@ -148,7 +137,7 @@ let
|
|||||||
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
||||||
|
|
||||||
$machine->copyFileFromHost(
|
$machine->copyFileFromHost(
|
||||||
"${ config { inherit fileSystems testChannel grubVersion grubDevice; } }",
|
"${ config { inherit testChannel grubVersion grubDevice; } }",
|
||||||
"/mnt/etc/nixos/configuration.nix");
|
"/mnt/etc/nixos/configuration.nix");
|
||||||
|
|
||||||
# Perform the installation.
|
# Perform the installation.
|
||||||
@ -192,12 +181,12 @@ let
|
|||||||
|
|
||||||
|
|
||||||
makeInstallerTest =
|
makeInstallerTest =
|
||||||
{ createPartitions, fileSystems, testChannel ? false, grubVersion ? 2, grubDevice ? "/dev/vda" }:
|
{ createPartitions, testChannel ? false, grubVersion ? 2, grubDevice ? "/dev/vda" }:
|
||||||
makeTest {
|
makeTest {
|
||||||
inherit iso;
|
inherit iso;
|
||||||
nodes = if testChannel then { inherit webserver; } else { };
|
nodes = if testChannel then { inherit webserver; } else { };
|
||||||
testScript = testScriptFun {
|
testScript = testScriptFun {
|
||||||
inherit createPartitions fileSystems testChannel grubVersion grubDevice;
|
inherit createPartitions testChannel grubVersion grubDevice;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -223,7 +212,6 @@ in {
|
|||||||
"mount LABEL=nixos /mnt",
|
"mount LABEL=nixos /mnt",
|
||||||
);
|
);
|
||||||
'';
|
'';
|
||||||
fileSystems = rootFS;
|
|
||||||
testChannel = true;
|
testChannel = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -246,7 +234,6 @@ in {
|
|||||||
"mount LABEL=boot /mnt/boot",
|
"mount LABEL=boot /mnt/boot",
|
||||||
);
|
);
|
||||||
'';
|
'';
|
||||||
fileSystems = rootFS + bootFS;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Create two physical LVM partitions combined into one volume group
|
# Create two physical LVM partitions combined into one volume group
|
||||||
@ -271,7 +258,6 @@ in {
|
|||||||
"mount LABEL=nixos /mnt",
|
"mount LABEL=nixos /mnt",
|
||||||
);
|
);
|
||||||
'';
|
'';
|
||||||
fileSystems = rootFS;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
swraid = makeInstallerTest
|
swraid = makeInstallerTest
|
||||||
@ -304,7 +290,6 @@ in {
|
|||||||
"mdadm -W /dev/md1",
|
"mdadm -W /dev/md1",
|
||||||
);
|
);
|
||||||
'';
|
'';
|
||||||
fileSystems = rootFS + bootFS;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Test a basic install using GRUB 1.
|
# Test a basic install using GRUB 1.
|
||||||
@ -323,7 +308,6 @@ in {
|
|||||||
);
|
);
|
||||||
|
|
||||||
'';
|
'';
|
||||||
fileSystems = rootFS;
|
|
||||||
grubVersion = 1;
|
grubVersion = 1;
|
||||||
grubDevice = "/dev/sda";
|
grubDevice = "/dev/sda";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user