From ae7d5011df3379d6ac88353cca4ad87fb62d9bbd Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 4 Aug 2023 13:47:33 +0100 Subject: [PATCH] Fixes for Active Directory client tests abbra told me where I was going wrong with the 'expected' target of the getent command ("AD/" is not a magic string, it's just "(netbiosname)/", and our netbios name is "SAMDOM"...) so this fixes that too, trying to avoid hard-coding stuff. For the kickstart test, it seems like it's a timing issue. We added this 'install sssd-tools and enable debugging' step to try and debug it, and instead it fixed it. So...let's just stick with this, for now, because it's useful to have this debugging anyway. If the problem starts happening again, we can fiddle about with it more. Signed-off-by: Adam Williamson --- tests/domain_client.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/domain_client.pm b/tests/domain_client.pm index 97e51ac2..915bd60f 100644 --- a/tests/domain_client.pm +++ b/tests/domain_client.pm @@ -6,7 +6,9 @@ use utils; sub run { my $self = shift; my $admin = get_var("REALMD_ADMIN_USER", "admin"); + my $tcadmin = ucfirst($admin); my $domain = get_var("REALMD_DOMAIN", "test.openqa.fedoraproject.org"); + my $shortdom = uc((split(/\./, $domain))[0]); my $udomain = uc($domain); my $qdomain = quotemeta($domain); my $qudomain = uc($qdomain); @@ -15,10 +17,24 @@ sub run { # at tty1) send_key "ctrl-alt-f1"; wait_still_screen 1; + if (get_var("KICKSTART")) { + # we don't have sssd debugging enabled yet + assert_script_run 'dnf -y install sssd-tools', 240; + assert_script_run 'sss_debuglevel 9'; + } # check domain is listed in 'realm list' validate_script_output 'realm list', sub { $_ =~ m/domain-name: $qdomain.*configured: kerberos-member/s }; # check we can resolve domain accounts - assert_script_run "getent passwd $admin\@$udomain"; + if ($domain =~ m/samdom/) { + # give this two tries, to see if it helps the problem where + # it sometimes fails for no reason + if (script_run "getent passwd '$shortdom\\$tcadmin'") { + assert_script_run "getent passwd '$shortdom\\$tcadmin'"; + } + } + else { + assert_script_run "getent passwd $admin\@$udomain"; + } # check keytab entries # on AD clients, this isn't automatically installed assert_script_run "dnf -y install krb5-workstation", 180;