Skip to content

Commit

Permalink
Softfail known samba_adcli failures
Browse files Browse the repository at this point in the history
A number of samba_adcli failures have been identified as seen in
poo#96980.

Those are known failures and should be marked as soft failures,
in order to avoid coverage loss, as they are sporadic and currently
there is less benefit to unschedule the module.
  • Loading branch information
ge0r committed Aug 16, 2021
1 parent b1ab4d0 commit e95d6fc
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions tests/network/samba/samba_adcli.pm
Expand Up @@ -75,7 +75,10 @@ sub update_password {
record_soft_failure("bsc#1188390");

# Retrying the adcli join is needed, probably due to https://bugs.freedesktop.org/show_bug.cgi?id=55487
script_retry 'adcli join -v -W --domain geeko.com -U Administrator -C', delay => 10, retry => 5, timeout => 60;
if (script_retry('adcli join -v -W --domain geeko.com -U Administrator -C', delay => 10, retry => 15, timeout => 60, die => 0) != 0) {
record_soft_failure('poo#96983');
last;
}
}
}

Expand All @@ -90,7 +93,7 @@ sub update_password {
record_soft_failure("bsc#1188575");
last;
} else {
die("wbinfo output does not contain $substr");
record_soft_failure("wbinfo output does not contain $substr");
}
}
}
Expand Down Expand Up @@ -121,7 +124,10 @@ sub run {
assert_script_run "expect kinit.exp";

# Retrying the adcli join is needed, probably due to https://bugs.freedesktop.org/show_bug.cgi?id=55487
script_retry 'adcli join -v -W --domain geeko.com -U Administrator -C', delay => 10, retry => 5, timeout => 60;
if (script_retry('adcli join -v -W --domain geeko.com -U Administrator -C', delay => 10, retry => 15, timeout => 60, die => 0) != 0) {
record_soft_failure('poo#96983');
return;
}

#Verify if machine already added
assert_script_run "adcli info -D geeko.com -S $AD_hostname -v";
Expand All @@ -131,7 +137,10 @@ sub run {
# if something is not working in the future: i.e authentication is not working, switching to using expect
# would be a better idea
assert_script_run "klist";
assert_script_run "echo Nots3cr3t | net ads join --domain geeko.com -U Administrator --no-dns-updates -i";
if (script_run("echo Nots3cr3t | net ads join --domain geeko.com -U Administrator --no-dns-updates -i") != 0) {
record_soft_failure('poo#96986');
return;
}

#systemctl('restart nmb');
#systemctl('restart winbind');
Expand All @@ -146,13 +155,17 @@ sub run {

systemctl('restart nscd');
#Verify users and groups from AD
assert_script_run "wbinfo -u | grep foursixnine";
if (script_run("wbinfo -u | grep foursixnine") != 0) {
record_soft_failure('poo#96513');
}
assert_script_run "wbinfo -g | grep dnsupdateproxy";
assert_script_run "wbinfo -D geeko.com";
assert_script_run "wbinfo -i geekouser\@geeko.com";
assert_script_run "wbinfo -i Administrator\@geeko.com";

assert_script_run "expect -c 'spawn ssh -l geekouser\@geeko.com localhost -t;expect sword:;send Nots3cr3t\\n;expect geekouser>;send exit\\n;interact'";
if (script_run("expect -c 'spawn ssh -l geekouser\@geeko.com localhost -t;expect sword:;send Nots3cr3t\\n;expect geekouser>;send exit\\n;interact'") != 0) {
record_soft_failure('poo#96512');
}

# poo#91950 (update machine password with adcli --add-samba-data option)
update_password() unless is_sle('=15'); # sle 15 does not support the `--add-samba-data` option
Expand Down

0 comments on commit e95d6fc

Please sign in to comment.