Only run ldap commands when configured with ldap
We already do this elsewhere in tests and it saves us a bunch of warnings.