[test] Skip LDAP tests if any of the underlying programs is not found
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 19 Jan 2016 10:03:16 +0100
changeset 11073 d7e8912549cd
parent 11072 8c3155a0ae5b
child 11076 403a901b6b1e
[test] Skip LDAP tests if any of the underlying programs is not found Some programs are in ldap-utils or ldapscripts, which may not be installed despite slapd may. Follow-up on 282880f81311.
cubicweb/server/test/unittest_ldapsource.py
--- a/cubicweb/server/test/unittest_ldapsource.py	Mon Jan 18 09:23:07 2016 +0100
+++ b/cubicweb/server/test/unittest_ldapsource.py	Tue Jan 19 10:03:16 2016 +0100
@@ -116,8 +116,11 @@
 
     @classmethod
     def setUpClass(cls):
-        if not os.path.exists('/usr/sbin/slapd'):
-            raise unittest.SkipTest('slapd not found')
+        for path in ('/usr/sbin/slapd',
+                     '/usr/sbin/slapadd',
+                     '/usr/bin/ldapmodify'):
+            if not os.path.exists(path):
+                raise unittest.SkipTest('%s not found' % path)
         from cubicweb.cwctl import init_cmdline_log_threshold
         init_cmdline_log_threshold(cls.config, cls.loglevel)
         cls._tmpdir = create_slapd_configuration(cls)