Skip to content

Commit

Permalink
refactor(test); make it work in non-root
Browse files Browse the repository at this point in the history
issue UPC#933
  • Loading branch information
frankiejol committed Nov 22, 2018
1 parent 0bd73ff commit d1a3259
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions t/front/70_ldap_access.t
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,15 @@ for my $vm_name ('KVM', 'Void') {
}
my $ldap;

eval { $ldap = Ravada::Auth::LDAP::_init_ldap_admin() };
eval { $ldap = Ravada::Auth::LDAP::_init_ldap_admin() } if $vm;

if ($@ =~ /Bad credentials/) {
diag("$@\nFix admin credentials in t/etc/ravada_ldap.conf");
} else {
diag("Skipped LDAP tests ".($@ or '')) if !$ldap;
$msg = "$@\nFix admin credentials in t/etc/ravada_ldap.conf";
} elsif ($vm) {
$msg = "Skipped LDAP tests ".($@ or '');
}

$msg = "SKIPPEd: No LDAP server found" if !$ldap && $@ !~ /Bad credentials/;
skip($msg,10) if !$vm || !$ldap;
skip($msg,10) if !$ldap;
diag("Testing LDAP access for $vm_name");

test_external_auth();
Expand Down

0 comments on commit d1a3259

Please sign in to comment.