2017-11-18 22:33:24 +00:00
|
|
|
# Test configuration switching.
|
|
|
|
|
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
|
|
|
name = "switch-test";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ gleber ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes = {
|
2018-07-20 21:56:59 +01:00
|
|
|
machine = { ... }: {
|
2017-11-18 22:33:24 +00:00
|
|
|
users.mutableUsers = false;
|
|
|
|
};
|
2018-07-20 21:56:59 +01:00
|
|
|
other = { ... }: {
|
2017-11-18 22:33:24 +00:00
|
|
|
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");
|
|
|
|
'';
|
|
|
|
})
|