Commit d1a3259d authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(test); make it work in non-root

issue #933
parent 0bd73ff1
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment