- Timestamp:
- 01/18/12 22:47:06 (16 months ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- 2ec2eb6
- Parents:
- ffa6a59
- Location:
- scripts
- Files:
-
- 6 edited
-
CMakeLists.txt (modified) (1 diff)
-
python/lib/test_helper.py (modified) (1 diff)
-
python/test_all.py (modified) (1 diff)
-
python/test_nrpe.py (modified) (1 diff)
-
python/test_nsca.py (modified) (2 diffs)
-
python/test_python.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
scripts/CMakeLists.txt
r4b1e6fe r441a022 5 5 FILE (GLOB scripts_PS1 "*.ps1") 6 6 FILE (GLOB scripts_LIB "lib/*.vbs") 7 IF(WIN32)7 #IF(WIN32) 8 8 FILE (GLOB_RECURSE scripts_PYT "python/*.py") 9 ELSE(WIN32)10 FILE (GLOB scripts_PYT "python/*.py" "python/lib/*.py")11 ENDIF(WIN32)9 #ELSE(WIN32) 10 #FILE (GLOB scripts_PYT "python/*.py" "python/lib/*.py") 11 #ENDIF(WIN32) 12 12 FILE (GLOB scripts_LUA "lua/*.lua") 13 13 -
scripts/python/lib/test_helper.py
rffa6a59 r441a022 221 221 return 'OK: %s'%self.title 222 222 else: 223 (total, ok) = c.count()223 (total, ok) = self.count() 224 224 return 'ERROR: %s (%d/%d)'%(self.title, ok, total) 225 225 -
scripts/python/test_all.py
rffa6a59 r441a022 3 3 4 4 from sys import path 5 from os import getcwd 6 path.append( getcwd() + '/scripts/python')5 import os 6 path.append(os.getcwd() + '/scripts/python') 7 7 8 8 from test_nsca import NSCAServerTest 9 9 from test_nrpe import NRPEServerTest 10 10 #from test_pb import NSCAServerTest 11 from test_eventlog import EventLogTest12 11 from test_python import PythonTest 13 from test_w32_system import Win32SystemTest14 12 15 all_tests = [NSCAServerTest, NRPEServerTest, EventLogTest, PythonTest, Win32SystemTest] 13 # 14 all_tests = [NSCAServerTest, PythonTest, NRPEServerTest] 15 if os.name == 'nt': 16 from test_eventlog import EventLogTest 17 from test_w32_system import Win32SystemTest 18 all_tests.extend([EventLogTest, Win32SystemTest]) 16 19 17 20 def __main__(): -
scripts/python/test_nrpe.py
r89838be r441a022 1 1 from NSCP import Settings, Registry, Core, log, status, log_error, sleep 2 import sys 3 log('==>%s'%sys.path) 4 2 5 from test_helper import BasicTest, TestResult, Callable, setup_singleton, install_testcases, init_testcases, shutdown_testcases 3 6 import plugin_pb2 -
scripts/python/test_nsca.py
rba63b95 r441a022 165 165 (result_code, err) = core.submit('nsca_test_outbox', message.SerializeToString()) 166 166 167 result = TestResult( )167 result = TestResult('Testing payload: %s'%tag) 168 168 result.add_message(len(err) == 0, 'Testing to send message using %s/sbp'%tag, err) 169 169 found = self.wait_and_validate(uid, result, msg, perf, '%s/spb'%tag) … … 192 192 found = self.wait_and_validate(uid, result, msg, perf, '%s/exec'%tag) 193 193 if retry and not found: 194 return self.submit_via_exec(encryption, source, status, msg, perf, tag, False)194 return self.submit_via_exec(encryption, source, status, msg, perf, '%s (retry)'%tag, False) 195 195 return result 196 196 -
scripts/python/test_python.py
r89838be r441a022 4 4 from time import time 5 5 6 install_checks = 1000 6 install_checks = 100 7 time_to_run = 30 8 9 core = Core.get() 7 10 8 11 class PythonTest(BasicTest): … … 36 39 self.reg.simple_function('py_stress_noop', PythonTest.noop_handler, 'This is a simple noop command') 37 40 self.reg.simple_subscription('py_stress_test', PythonTest.stress_handler) 41 conf = Settings.get() 42 conf.set_string('/settings/test_scheduler', 'threads', '50') 43 core.reload('test_scheduler') 44 38 45 39 46 def teardown(self): 47 conf = Settings.get() 48 conf.set_string('/settings/test_scheduler', 'threads', '0') 49 core.reload('test_scheduler') 40 50 None 41 51 … … 43 53 result = TestResult() 44 54 start = time() 45 while self.stress_count < install_checks*10: 46 log('Waiting for %d: %d/%d'%(install_checks*10, self.stress_count, self.noop_count)) 55 total_count = install_checks*time_to_run/5 56 while self.stress_count < total_count: 57 log('Waiting for %d: %d/%d'%(total_count, self.stress_count, self.noop_count)) 47 58 old_stress_count = self.stress_count 48 59 old_noop_count = self.noop_count … … 63 74 64 75 base_path = '/settings/test_scheduler' 65 conf.set_string(base_path, 'threads', ' 50')76 conf.set_string(base_path, 'threads', '0') 66 77 67 78 default_path = '%s/default'%base_path
Note: See TracChangeset
for help on using the changeset viewer.








