2019-11-23 12:25:27 +00:00
|
|
|
import ../make-test-python.nix ({pkgs, ...}: {
|
2017-11-06 17:41:34 +00:00
|
|
|
name = "kerberos_server-heimdal";
|
|
|
|
machine = { config, libs, pkgs, ...}:
|
|
|
|
{ services.kerberos_server =
|
|
|
|
{ enable = true;
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR".acl = [{principal = "admin"; access = ["add" "cpw"];}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
krb5 = {
|
|
|
|
enable = true;
|
2021-09-22 08:39:34 +01:00
|
|
|
kerberos = pkgs.heimdal;
|
2017-11-06 17:41:34 +00:00
|
|
|
libdefaults = {
|
|
|
|
default_realm = "FOO.BAR";
|
|
|
|
};
|
|
|
|
realms = {
|
|
|
|
"FOO.BAR" = {
|
|
|
|
admin_server = "machine";
|
|
|
|
kdc = "machine";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-23 12:25:27 +00:00
|
|
|
machine.succeed(
|
|
|
|
"kadmin -l init --realm-max-ticket-life='8 day' --realm-max-renewable-life='10 day' FOO.BAR",
|
|
|
|
"systemctl restart kadmind.service kdc.service",
|
|
|
|
)
|
2017-11-06 17:41:34 +00:00
|
|
|
|
2019-11-23 12:25:27 +00:00
|
|
|
for unit in ["kadmind", "kdc", "kpasswdd"]:
|
|
|
|
machine.wait_for_unit(f"{unit}.service")
|
2017-11-06 17:41:34 +00:00
|
|
|
|
2019-11-23 12:25:27 +00:00
|
|
|
machine.succeed(
|
|
|
|
"kadmin -l add --password=admin_pw --use-defaults admin",
|
|
|
|
"kadmin -l ext_keytab --keytab=admin.keytab admin",
|
|
|
|
"kadmin -p admin -K admin.keytab add --password=alice_pw --use-defaults alice",
|
|
|
|
"kadmin -l ext_keytab --keytab=alice.keytab alice",
|
|
|
|
"kinit -kt alice.keytab alice",
|
|
|
|
)
|
2017-11-06 17:41:34 +00:00
|
|
|
'';
|
|
|
|
})
|