1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00
nixpkgs/nixos/tests/switch-test.nix
Gleb Peregud 2f6148c743 nixos/system: make switch-to-configuration script pure.
Fixes #28443

Fixed few invocations to `systemctl` to have an absolute path. Additionally add
LOCALE_ARCHIVE so that perl stops spewing warning messages.
2017-11-19 19:42:54 +01:00

26 lines
740 B
Nix

# Test configuration switching.
import ./make-test.nix ({ pkgs, ...} : {
name = "switch-test";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ gleber ];
};
nodes = {
machine = { config, lib, pkgs, ... }: {
users.mutableUsers = false;
};
other = { config, lib, pkgs, ... }: {
users.mutableUsers = true;
};
};
testScript = {nodes, ...}: let
originalSystem = nodes.machine.config.system.build.toplevel;
otherSystem = nodes.other.config.system.build.toplevel;
in ''
$machine->succeed("env -i ${originalSystem}/bin/switch-to-configuration test | tee /dev/stderr");
$machine->succeed("env -i ${otherSystem}/bin/switch-to-configuration test | tee /dev/stderr");
'';
})