aboutsummaryrefslogtreecommitdiffstats
path: root/test/testldap.py
diff options
context:
space:
mode:
authorastokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-02-17 16:28:17 +0000
committerastokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-02-17 16:28:17 +0000
commit18191c43943661b2d61b191ea95a9c9351bd465c (patch)
treedd426874c830ec029dbd44eec4e469131d4fadc9 /test/testldap.py
parent494f1de1db6c29a3f5f6d0e5cabc29b86eaf99e8 (diff)
downloadsos-18191c43943661b2d61b191ea95a9c9351bd465c.tar.gz
- moved 1.9 to trunkr1.9
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@778 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'test/testldap.py')
-rw-r--r--test/testldap.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/testldap.py b/test/testldap.py
new file mode 100644
index 00000000..19511f74
--- /dev/null
+++ b/test/testldap.py
@@ -0,0 +1,41 @@
+from sos.sosreport import *
+from commons import *
+from nose.tools import *
+import os, sys, shutil
+
+class GlobalVars:
+ pass
+
+class TestLDAP:
+ def __init__(self):
+ GlobalVars.commons = commons
+ GlobalVars.dstroot = None
+
+ def setup(self):
+ """ prework """
+ pass
+
+ def teardown(self):
+ """ cleanup dstroot and other miscellaneous files """
+ if os.path.isdir(GlobalVars.dstroot) and not None:
+ shutil.rmtree(GlobalVars.dstroot)
+
+ def testPostProc(self):
+ """ check scraping of bindpw if exists """
+ GlobalVars.commons['testOptions'].append("-oldap")
+ GlobalVars.dstroot = sosreport(GlobalVars.commons['testOptions'])
+ ldapconf = os.path.join(GlobalVars.dstroot,'etc/ldap.conf')
+ if os.path.isfile(ldapconf) and os.path.isfile("/etc/ldap.conf"):
+ f = open('/etc/ldap.conf','r').readlines()
+ for line in f:
+ assert_false('bindpw ***' in line)
+
+ def testCapture(self):
+ """ check for capture of proper files """
+ GlobalVars.commons['testOptions'].append("-oldap")
+ GlobalVars.dstroot = sosreport(GlobalVars.commons['testOptions'])
+ ldapdir = os.path.join(GlobalVars.dstroot,'etc/openldap')
+ if os.path.isdir(ldapdir) and \
+ os.path.isfile(os.path.join(GlobalVars.dstroot,'etc/ldap.conf')):
+ GlobalVars.commons['testOptions'].pop()
+ assert_true