mirror of
https://github.com/ryantm/agenix.git
synced 2024-11-25 11:08:30 +03:00
Fix integration test
This commit is contained in:
parent
2b8f414fa6
commit
3d61cccadd
2 changed files with 33 additions and 36 deletions
|
@ -8,7 +8,6 @@
|
|||
(
|
||||
umask u=rw,g=,o=
|
||||
cp ${../example_keys/system1} /etc/ssh/ssh_host_ed25519_key
|
||||
touch /etc/ssh/ssh_host_rsa_key
|
||||
)
|
||||
|
||||
'';
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
{
|
||||
nixpkgs ? <nixpkgs>,
|
||||
pkgs ? import <nixpkgs> { inherit system; config = {}; },
|
||||
system ? builtins.currentSystem
|
||||
} @args:
|
||||
args@{ pkgs ? <nixpkgs>, ... }:
|
||||
|
||||
import "${nixpkgs}/nixos/tests/make-test-python.nix" ({ pkgs, ...}: {
|
||||
import "${pkgs}/nixos/tests/make-test-python.nix"
|
||||
{
|
||||
name = "agenix-integration";
|
||||
|
||||
nodes.system1 = { config, lib, ... }: {
|
||||
|
||||
nodes.system1 = { config, ... }: {
|
||||
imports = [
|
||||
../modules/age.nix
|
||||
./install_ssh_host_keys.nix
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
age.secrets.passwordfile-user1 = {
|
||||
file = ../example/passwordfile-user1.age;
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
hostKeys = [{ type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; }];
|
||||
};
|
||||
|
||||
age.secrets.passwordfile-user1.file = ../example/passwordfile-user1.age;
|
||||
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
|
||||
|
@ -30,14 +27,14 @@ import "${nixpkgs}/nixos/tests/make-test-python.nix" ({ pkgs, ...}: {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
testScript =
|
||||
let
|
||||
user = "user1";
|
||||
password = "password1234";
|
||||
in ''
|
||||
in
|
||||
''
|
||||
system1.wait_for_unit("multi-user.target")
|
||||
system1.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
|
||||
system1.sleep(2)
|
||||
|
@ -55,4 +52,5 @@ import "${nixpkgs}/nixos/tests/make-test-python.nix" ({ pkgs, ...}: {
|
|||
system1.wait_for_file("/tmp/1")
|
||||
assert "${user}" in system1.succeed("cat /tmp/1")
|
||||
'';
|
||||
}) args
|
||||
}
|
||||
args
|
||||
|
|
Loading…
Reference in a new issue