Changeset 1507
- Timestamp:
- 06/06/08 10:56:59 (7 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/qa/061-PAM.py (modified) (1 diff)
- cherokee/trunk/qa/167-RuleGeoIP.py (modified) (1 diff)
- cherokee/trunk/qa/base.py (modified) (1 diff)
- cherokee/trunk/qa/util.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1506 r1507 1 1 2008-06-06 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * qa/base.py (TestBase.has_module), 4 qa/util.py (cherokee_has_plugin): The base.has_module() is 5 replaced with cherokee_has_plugin() helper function. It is now 6 able to detect both dynamic and built-in plug-ins. 2 7 3 8 * cherokee/main.c: Added a new -i, --print-server-info parameter. cherokee/trunk/qa/061-PAM.py
r1496 r1507 42 42 43 43 # Check that pam module was compiled 44 if not self.has_module("pam"):44 if not cherokee_has_plugin("pam"): 45 45 return False 46 46 cherokee/trunk/qa/167-RuleGeoIP.py
r1497 r1507 39 39 return True 40 40 # Check that pam module was compiled 41 if not self.has_module("geoip"):41 if not cherokee_has_plugin("geoip"): 42 42 return False 43 43 return True cherokee/trunk/qa/base.py
r1496 r1507 341 341 return final 342 342 343 def has_module (self, module):344 try:345 pams = filter(lambda x: module in x, os.listdir(CHEROKEE_MODS))346 if len(pams) < 1:347 return False348 except:349 return False350 return True351 352 343 353 344 class TestCollection: cherokee/trunk/qa/util.py
r1225 r1507 145 145 __free_port += 1 146 146 return __free_port 147 148 149 _built_in_list = [] 150 _built_in_list_done = False 151 152 def cherokee_has_plugin (module): 153 # Check for the dynamic plug-in 154 try: 155 mods = filter(lambda x: module in x, os.listdir(CHEROKEE_MODS)) 156 if len(mods) >= 1: 157 return True 158 except: 159 pass 160 161 # Let's see whether it's built-in 162 global _built_in_list 163 global _built_in_list_done 164 165 if not _built_in_list_done: 166 _built_in_list_done = True 167 168 f = os.popen ("%s -i" % (CHEROKEE_PATH)) 169 cont = f.read() 170 f.close() 171 172 try: 173 line = filter(lambda x: x.startswith (" Built-in: "), cont.split("\n"))[0] 174 line = line.replace(" Built-in: ", "") 175 _built_in_list = line.split(" ") 176 except: 177 pass 178 179 return module in _built_in_list 180