colmena/integration-tests/apply-local/default.nix
Zhaofeng Li 8b87f0de02 integration-tests: Start migration to modular test framework
Still need to migrate most logic in tools.nix to modules.
2022-12-01 01:57:56 -07:00

27 lines
660 B
Nix

{ pkgs ? import ../nixpkgs.nix }:
let
tools = pkgs.callPackage ../tools.nix {
targets = [];
prebuiltTarget = "deployer";
extraDeployerConfig = {
users.users.colmena = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
security.sudo.wheelNeedsPassword = false;
};
};
in tools.runTest {
name = "colmena-apply-local";
colmena.test = {
bundle = ./.;
testScript = ''
deployer.succeed("cd /tmp/bundle && sudo -u colmena ${tools.colmenaExec} apply-local --sudo")
deployer.succeed("grep SUCCESS /etc/deployment")
deployer.succeed("grep SECRET /run/keys/key-text")
'';
};
}