corotests.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. __copyright__='''
  2. Copyright (c) 2010 Red Hat, Inc.
  3. '''
  4. # All rights reserved.
  5. #
  6. # Author: Angus Salkeld <asalkeld@redhat.com>
  7. #
  8. # This software licensed under BSD license, the text of which follows:
  9. #
  10. # Redistribution and use in source and binary forms, with or without
  11. # modification, are permitted provided that the following conditions are met:
  12. #
  13. # - Redistributions of source code must retain the above copyright notice,
  14. # this list of conditions and the following disclaimer.
  15. # - Redistributions in binary form must reproduce the above copyright notice,
  16. # this list of conditions and the following disclaimer in the documentation
  17. # and/or other materials provided with the distribution.
  18. # - Neither the name of the MontaVista Software, Inc. nor the names of its
  19. # contributors may be used to endorse or promote products derived from this
  20. # software without specific prior written permission.
  21. #
  22. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. # THE POSSIBILITY OF SUCH DAMAGE.
  33. from cts.CTStests import *
  34. ###################################################################
  35. class CoroTest(CTSTest):
  36. '''
  37. basic class to make sure that new configuration is applied
  38. and old configuration is removed.
  39. '''
  40. def __init__(self, cm):
  41. CTSTest.__init__(self,cm)
  42. self.start = StartTest(cm)
  43. self.stop = StopTest(cm)
  44. self.config = {}
  45. def setup(self, node):
  46. ret = CTSTest.setup(self, node)
  47. # setup the authkey
  48. localauthkey = '/tmp/authkey'
  49. if not os.path.exists(localauthkey):
  50. self.CM.rsh(node, 'corosync-keygen')
  51. self.CM.rsh.cp("%s:%s" % (node, "/etc/corosync/authkey"), localauthkey)
  52. for n in self.CM.Env["nodes"]:
  53. if n is not node:
  54. #copy key onto other nodes
  55. self.CM.rsh.cp(localauthkey, "%s:%s" % (n, "/etc/corosync/authkey"))
  56. # copy over any new config
  57. for c in self.config:
  58. self.CM.new_config[c] = self.config[c]
  59. # apply the config
  60. self.CM.apply_new_config()
  61. # start any killed corosync's
  62. for n in self.CM.Env["nodes"]:
  63. if not self.CM.StataCM(n):
  64. self.incr("started")
  65. self.start(n)
  66. return ret
  67. def teardown(self, node):
  68. self.CM.apply_default_config()
  69. return CTSTest.teardown(self, node)
  70. ###################################################################
  71. class CpgConfigChangeBase(CoroTest):
  72. '''
  73. join a cpg group on each node, and test that the following
  74. causes a leave event:
  75. - a call to cpg_leave()
  76. - app exit
  77. - node leave
  78. - node leave (with large token timeout)
  79. '''
  80. def setup(self, node):
  81. ret = CoroTest.setup(self, node)
  82. self.listener = None
  83. self.wobbly = None
  84. for n in self.CM.Env["nodes"]:
  85. self.CM.cpg_agent[n].clean_start()
  86. self.CM.cpg_agent[n].cpg_join(self.name)
  87. if self.listener is None:
  88. self.listener = n
  89. elif self.wobbly is None:
  90. self.wobbly = n
  91. self.wobbly_id = self.CM.cpg_agent[self.wobbly].cpg_local_get()
  92. self.CM.cpg_agent[self.listener].record_config_events(truncate=True)
  93. return ret
  94. def wait_for_config_change(self):
  95. found = False
  96. max_timeout = 5 * 60
  97. waited = 0
  98. printit = 0
  99. self.CM.log("Waiting for config change on " + self.listener)
  100. while not found:
  101. try:
  102. event = self.CM.cpg_agent[self.listener].read_config_event()
  103. except:
  104. return self.failure('connection to test cpg_agent failed.')
  105. if not event == None:
  106. self.CM.debug("RECEIVED: " + str(event))
  107. if event == None:
  108. if waited >= max_timeout:
  109. return self.failure("timedout(" + str(waited) + " sec) == no event!")
  110. else:
  111. time.sleep(1)
  112. waited = waited + 1
  113. printit = printit + 1
  114. if printit is 60:
  115. print 'waited 60 seconds'
  116. printit = 0
  117. elif str(event.node_id) in str(self.wobbly_id) and not event.is_member:
  118. self.CM.log("Got the config change in " + str(waited) + " seconds")
  119. found = True
  120. else:
  121. self.CM.debug("No match")
  122. self.CM.debug("wobbly nodeid:" + str(self.wobbly_id))
  123. self.CM.debug("event nodeid:" + str(event.node_id))
  124. self.CM.debug("event.is_member:" + str(event.is_member))
  125. if found:
  126. return self.success()
  127. ###################################################################
  128. class CpgCfgChgOnGroupLeave(CpgConfigChangeBase):
  129. def __init__(self, cm):
  130. CpgConfigChangeBase.__init__(self,cm)
  131. self.name="CpgCfgChgOnGroupLeave"
  132. def failure_action(self):
  133. self.CM.log("calling cpg_leave() on " + self.wobbly)
  134. self.CM.cpg_agent[self.wobbly].cpg_leave(self.name)
  135. def __call__(self, node):
  136. self.incr("calls")
  137. self.failure_action()
  138. return self.wait_for_config_change()
  139. ###################################################################
  140. class CpgCfgChgOnNodeLeave(CpgConfigChangeBase):
  141. def __init__(self, cm):
  142. CpgConfigChangeBase.__init__(self,cm)
  143. self.name="CpgCfgChgOnNodeLeave"
  144. def failure_action(self):
  145. self.CM.log("stopping corosync on " + self.wobbly)
  146. self.stop(self.wobbly)
  147. def __call__(self, node):
  148. self.incr("calls")
  149. self.failure_action()
  150. return self.wait_for_config_change()
  151. ###################################################################
  152. class CpgCfgChgOnLowestNodeJoin(CTSTest):
  153. '''
  154. 1) stop all nodes
  155. 2) start all but the node with the smallest ip address
  156. 3) start recording events
  157. 4) start the last node
  158. '''
  159. def __init__(self, cm):
  160. CTSTest.__init__(self, cm)
  161. self.name="CpgCfgChgOnLowestNodeJoin"
  162. self.start = StartTest(cm)
  163. self.stop = StopTest(cm)
  164. self.config = {}
  165. self.config['compatibility'] = 'none'
  166. def lowest_ip_set(self):
  167. self.lowest = None
  168. for n in self.CM.Env["nodes"]:
  169. if self.lowest is None:
  170. self.lowest = n
  171. self.CM.log("lowest node is " + self.lowest)
  172. def setup(self, node):
  173. # stop all nodes
  174. for n in self.CM.Env["nodes"]:
  175. self.CM.StopaCM(n)
  176. self.lowest_ip_set()
  177. # copy over any new config
  178. for c in self.config:
  179. self.CM.new_config[c] = self.config[c]
  180. # install the config
  181. self.CM.install_all_config()
  182. # start all but lowest
  183. self.listener = None
  184. for n in self.CM.Env["nodes"]:
  185. if n is not self.lowest:
  186. if self.listener is None:
  187. self.listener = n
  188. self.incr("started")
  189. self.CM.log("starting " + n)
  190. self.start(n)
  191. self.CM.cpg_agent[n].clean_start()
  192. self.CM.cpg_agent[n].cpg_join(self.name)
  193. # start recording events
  194. pats = []
  195. pats.append("%s .*sync: node joined.*" % self.listener)
  196. pats.append("%s .*sync: activate correctly.*" % self.listener)
  197. self.sync_log = self.create_watch(pats, 60)
  198. self.sync_log.setwatch()
  199. self.CM.log("setup done")
  200. return CTSTest.setup(self, node)
  201. def __call__(self, node):
  202. self.incr("calls")
  203. self.start(self.lowest)
  204. self.CM.cpg_agent[self.lowest].clean_start()
  205. self.CM.cpg_agent[self.lowest].cpg_join(self.name)
  206. self.wobbly_id = self.CM.cpg_agent[self.lowest].cpg_local_get()
  207. self.CM.log("waiting for sync events")
  208. if not self.sync_log.lookforall():
  209. return self.failure("Patterns not found: " + repr(self.sync_log.unmatched))
  210. else:
  211. return self.success()
  212. ###################################################################
  213. class CpgCfgChgOnExecCrash(CpgConfigChangeBase):
  214. def __init__(self, cm):
  215. CpgConfigChangeBase.__init__(self,cm)
  216. self.name="CpgCfgChgOnExecCrash"
  217. def failure_action(self):
  218. self.CM.log("sending SIGSEGV to corosync on " + self.wobbly)
  219. self.CM.rsh(self.wobbly, "killall -9 corosync")
  220. self.CM.rsh(self.wobbly, "rm -f /var/run/corosync.pid")
  221. self.CM.ShouldBeStatus[self.wobbly] = "down"
  222. def __call__(self, node):
  223. self.incr("calls")
  224. self.failure_action()
  225. return self.wait_for_config_change()
  226. ###################################################################
  227. class CpgCfgChgOnNodeIsolate(CpgConfigChangeBase):
  228. def __init__(self, cm):
  229. CpgConfigChangeBase.__init__(self,cm)
  230. self.name="CpgCfgChgOnNodeIsolate"
  231. def failure_action(self):
  232. self.CM.log("isolating node " + self.wobbly)
  233. self.CM.isolate_node(self.wobbly)
  234. def __call__(self, node):
  235. self.incr("calls")
  236. self.failure_action()
  237. return self.wait_for_config_change()
  238. def teardown(self, node):
  239. self.CM.unisolate_node (self.wobbly)
  240. return CpgConfigChangeBase.teardown(self, node)
  241. ###################################################################
  242. class CpgMsgOrderBase(CoroTest):
  243. def __init__(self, cm):
  244. CoroTest.__init__(self,cm)
  245. self.num_msgs_per_node = 0
  246. self.total_num_msgs = 0
  247. def setup(self, node):
  248. ret = CoroTest.setup(self, node)
  249. for n in self.CM.Env["nodes"]:
  250. self.total_num_msgs = self.total_num_msgs + self.num_msgs_per_node
  251. self.CM.cpg_agent[n].clean_start()
  252. self.CM.cpg_agent[n].cpg_join(self.name)
  253. self.CM.cpg_agent[n].record_messages()
  254. time.sleep(1)
  255. return ret
  256. def cpg_msg_blaster(self):
  257. for n in self.CM.Env["nodes"]:
  258. self.CM.cpg_agent[n].msg_blaster(self.num_msgs_per_node)
  259. def wait_and_validate_order(self):
  260. msgs = {}
  261. for n in self.CM.Env["nodes"]:
  262. msgs[n] = []
  263. stopped = False
  264. waited = 0
  265. while len(msgs[n]) < self.total_num_msgs and waited < 360:
  266. msg = self.CM.cpg_agent[n].read_messages(50)
  267. if not msg == None:
  268. msgl = msg.split(";")
  269. # remove empty entries
  270. not_done=True
  271. while not_done:
  272. try:
  273. msgl.remove('')
  274. except:
  275. not_done = False
  276. msgs[n].extend(msgl)
  277. elif msg == None:
  278. time.sleep(2)
  279. waited = waited + 2
  280. if len(msgs[n]) < self.total_num_msgs:
  281. return self.failure("expected %d messages from %s got %d" % (self.total_num_msgs, n, len(msgs[n])))
  282. fail = False
  283. error_message = ''
  284. for i in range(0, self.total_num_msgs):
  285. first = None
  286. for n in self.CM.Env["nodes"]:
  287. # first test for errors
  288. params = msgs[n][i].split(":")
  289. if not 'OK' in params[3]:
  290. fail = True
  291. error_message = 'error: ' + params[3] + ' in received message'
  292. self.CM.log(str(params))
  293. # then look for out of order messages
  294. if first == None:
  295. first = n
  296. else:
  297. if not msgs[first][i] == msgs[n][i]:
  298. # message order not the same!
  299. fail = True
  300. error_message = 'message out of order'
  301. self.CM.log(msgs[first][i] + " != " + msgs[n][i])
  302. if fail:
  303. return self.failure(error_message)
  304. else:
  305. return self.success()
  306. ###################################################################
  307. class CpgMsgOrderBasic(CpgMsgOrderBase):
  308. '''
  309. each sends & logs lots of messages
  310. '''
  311. def __init__(self, cm):
  312. CpgMsgOrderBase.__init__(self,cm)
  313. self.name="CpgMsgOrderBasic"
  314. self.num_msgs_per_node = 9000
  315. def __call__(self, node):
  316. self.incr("calls")
  317. for n in self.CM.Env["nodes"]:
  318. self.CM.cpg_agent[n].msg_blaster(self.num_msgs_per_node)
  319. return self.wait_and_validate_order()
  320. ###################################################################
  321. class CpgMsgOrderZcb(CpgMsgOrderBase):
  322. '''
  323. each sends & logs lots of messages
  324. '''
  325. def __init__(self, cm):
  326. CpgMsgOrderBase.__init__(self,cm)
  327. self.name="CpgMsgOrderZcb"
  328. self.num_msgs_per_node = 9000
  329. def __call__(self, node):
  330. self.incr("calls")
  331. for n in self.CM.Env["nodes"]:
  332. self.CM.cpg_agent[n].msg_blaster_zcb(self.num_msgs_per_node)
  333. return self.wait_and_validate_order()
  334. ###################################################################
  335. class MemLeakObject(CoroTest):
  336. '''
  337. run mem_leak_test.sh -1
  338. '''
  339. def __init__(self, cm):
  340. CoroTest.__init__(self,cm)
  341. self.name="MemLeakObject"
  342. def __call__(self, node):
  343. self.incr("calls")
  344. mem_leaked = self.CM.rsh(node, "/usr/share/corosync/tests/mem_leak_test.sh -1")
  345. if mem_leaked is 0:
  346. return self.success()
  347. else:
  348. return self.failure(str(mem_leaked) + 'kB memory leaked.')
  349. ###################################################################
  350. class MemLeakSession(CoroTest):
  351. '''
  352. run mem_leak_test.sh -2
  353. '''
  354. def __init__(self, cm):
  355. CoroTest.__init__(self,cm)
  356. self.name="MemLeakSession"
  357. def __call__(self, node):
  358. self.incr("calls")
  359. mem_leaked = self.CM.rsh(node, "/usr/share/corosync/tests/mem_leak_test.sh -2")
  360. if mem_leaked is 0:
  361. return self.success()
  362. else:
  363. return self.failure(str(mem_leaked) + 'kB memory leaked.')
  364. ###################################################################
  365. class ServiceLoadTest(CoroTest):
  366. '''
  367. Test loading and unloading of service engines
  368. '''
  369. def __init__(self, cm):
  370. CoroTest.__init__(self, cm)
  371. self.name="ServiceLoadTest"
  372. def is_loaded(self, node):
  373. check = 'corosync-objctl runtime.services. | grep evs'
  374. (res, out) = self.CM.rsh(node, check, stdout=2)
  375. if res is 0:
  376. return True
  377. else:
  378. return False
  379. def service_unload(self, node):
  380. # unload evs
  381. pats = []
  382. pats.append("%s .*Service engine unloaded: corosync extended.*" % node)
  383. unloaded = self.create_watch(pats, 60)
  384. unloaded.setwatch()
  385. self.CM.rsh(node, 'corosync-cfgtool -u corosync_evs')
  386. if not unloaded.lookforall():
  387. self.CM.log("Patterns not found: " + repr(unloaded.unmatched))
  388. self.error_message = "evs service not unloaded"
  389. return False
  390. if self.is_loaded(node):
  391. self.error_message = "evs has been unload, why are it's session objects are still there?"
  392. return False
  393. return True
  394. def service_load(self, node):
  395. # now reload it.
  396. pats = []
  397. pats.append("%s .*Service engine loaded.*" % node)
  398. loaded = self.create_watch(pats, 60)
  399. loaded.setwatch()
  400. self.CM.rsh(node, 'corosync-cfgtool -l corosync_evs')
  401. if not loaded.lookforall():
  402. self.CM.log("Patterns not found: " + repr(loaded.unmatched))
  403. self.error_message = "evs service not unloaded"
  404. return False
  405. return True
  406. def __call__(self, node):
  407. self.incr("calls")
  408. should_be_loaded = True
  409. if self.is_loaded(node):
  410. ret = self.service_unload(node)
  411. should_be_loaded = False
  412. else:
  413. ret = self.service_load(node)
  414. should_be_loaded = True
  415. if not ret:
  416. return self.failure(self.error_message)
  417. if self.is_loaded(node):
  418. ret = self.service_unload(node)
  419. else:
  420. ret = self.service_load(node)
  421. if not ret:
  422. return self.failure(self.error_message)
  423. return self.success()
  424. ###################################################################
  425. class ConfdbReplaceTest(CoroTest):
  426. def __init__(self, cm):
  427. CoroTest.__init__(self, cm)
  428. self.name="ConfdbReplaceTest"
  429. def __call__(self, node):
  430. self.incr("calls")
  431. res = self.CM.confdb_agent[node].set_get_test()
  432. if 'OK' in res:
  433. return self.success()
  434. else:
  435. return self.failure('set_get_test failed')
  436. ###################################################################
  437. class ConfdbIncrementTest(CoroTest):
  438. def __init__(self, cm):
  439. CoroTest.__init__(self, cm)
  440. self.name="ConfdbIncrementTest"
  441. def __call__(self, node):
  442. self.incr("calls")
  443. res = self.CM.confdb_agent[node].increment_decrement_test()
  444. if 'OK' in res:
  445. return self.success()
  446. else:
  447. return self.failure('increment_decrement_test failed')
  448. ###################################################################
  449. class ConfdbObjectFindTest(CoroTest):
  450. def __init__(self, cm):
  451. CoroTest.__init__(self, cm)
  452. self.name="ConfdbObjectFindTest"
  453. def __call__(self, node):
  454. self.incr("calls")
  455. res = self.CM.confdb_agent[node].object_find_test()
  456. if 'OK' in res:
  457. return self.success()
  458. else:
  459. return self.failure('object_find_test failed')
  460. ###################################################################
  461. class ConfdbNotificationTest(CoroTest):
  462. def __init__(self, cm):
  463. CoroTest.__init__(self, cm)
  464. self.name="ConfdbNotificationTest"
  465. def __call__(self, node):
  466. self.incr("calls")
  467. res = self.CM.confdb_agent[node].notification_test()
  468. if 'OK' in res:
  469. return self.success()
  470. else:
  471. return self.failure('notification_test failed')
  472. ###################################################################
  473. class SamTest1(CoroTest):
  474. def __init__(self, cm):
  475. CoroTest.__init__(self, cm)
  476. self.name="SamTest1"
  477. def __call__(self, node):
  478. self.incr("calls")
  479. res = self.CM.sam_agent[node].test1()
  480. if 'OK' in res:
  481. return self.success()
  482. else:
  483. return self.failure('sam test 1 failed')
  484. ###################################################################
  485. class SamTest2(CoroTest):
  486. def __init__(self, cm):
  487. CoroTest.__init__(self, cm)
  488. self.name="SamTest2"
  489. def __call__(self, node):
  490. self.incr("calls")
  491. res = self.CM.sam_agent[node].test2()
  492. if 'OK' in res:
  493. return self.success()
  494. else:
  495. return self.failure('sam test 2 failed')
  496. ###################################################################
  497. class SamTest3(CoroTest):
  498. def __init__(self, cm):
  499. CoroTest.__init__(self, cm)
  500. self.name="SamTest3"
  501. def __call__(self, node):
  502. self.incr("calls")
  503. res = self.CM.sam_agent[node].test3()
  504. if 'OK' in res:
  505. return self.success()
  506. else:
  507. return self.failure('sam test 3 failed')
  508. ###################################################################
  509. class SamTest4(CoroTest):
  510. def __init__(self, cm):
  511. CoroTest.__init__(self, cm)
  512. self.name="SamTest4"
  513. def __call__(self, node):
  514. self.incr("calls")
  515. res = self.CM.sam_agent[node].test4()
  516. if 'OK' in res:
  517. return self.success()
  518. else:
  519. return self.failure('sam test 4 failed')
  520. GenTestClasses = []
  521. GenTestClasses.append(CpgMsgOrderBasic)
  522. GenTestClasses.append(CpgMsgOrderZcb)
  523. GenTestClasses.append(CpgCfgChgOnExecCrash)
  524. GenTestClasses.append(CpgCfgChgOnGroupLeave)
  525. GenTestClasses.append(CpgCfgChgOnNodeLeave)
  526. GenTestClasses.append(CpgCfgChgOnNodeIsolate)
  527. GenTestClasses.append(CpgCfgChgOnLowestNodeJoin)
  528. AllTestClasses = []
  529. AllTestClasses.append(ConfdbReplaceTest)
  530. AllTestClasses.append(ConfdbIncrementTest)
  531. AllTestClasses.append(ConfdbObjectFindTest)
  532. AllTestClasses.append(ConfdbNotificationTest)
  533. AllTestClasses.append(SamTest1)
  534. AllTestClasses.append(SamTest2)
  535. AllTestClasses.append(SamTest3)
  536. AllTestClasses.append(SamTest4)
  537. AllTestClasses.append(ServiceLoadTest)
  538. AllTestClasses.append(MemLeakObject)
  539. AllTestClasses.append(MemLeakSession)
  540. AllTestClasses.append(FlipTest)
  541. AllTestClasses.append(RestartTest)
  542. AllTestClasses.append(StartOnebyOne)
  543. AllTestClasses.append(SimulStart)
  544. AllTestClasses.append(StopOnebyOne)
  545. AllTestClasses.append(SimulStop)
  546. AllTestClasses.append(RestartOnebyOne)
  547. #AllTestClasses.append(PartialStart)
  548. def CoroTestList(cm, audits):
  549. result = []
  550. configs = []
  551. for testclass in AllTestClasses:
  552. bound_test = testclass(cm)
  553. if bound_test.is_applicable():
  554. bound_test.Audits = audits
  555. result.append(bound_test)
  556. default = {}
  557. default['logging/function_name'] = 'off'
  558. default['logging/logfile_priority'] = 'info'
  559. default['logging/syslog_priority'] = 'info'
  560. default['logging/syslog_facility'] = 'daemon'
  561. default['uidgid/uid'] = '0'
  562. default['uidgid/gid'] = '0'
  563. configs.append(default)
  564. a = {}
  565. a['compatibility'] = 'none'
  566. a['totem/token'] = 10000
  567. configs.append(a)
  568. b = {}
  569. b['compatibility'] = 'whitetank'
  570. b['totem/token'] = 10000
  571. configs.append(b)
  572. c = {}
  573. c['totem/secauth'] = 'on'
  574. c['totem/crypto_accept'] = 'new'
  575. c['totem/crypto_type'] = 'nss'
  576. configs.append(c)
  577. d = {}
  578. d['totem/secauth'] = 'on'
  579. d['totem/crypto_type'] = 'sober'
  580. configs.append(d)
  581. e = {}
  582. e['totem/threads'] = 4
  583. configs.append(e)
  584. #quorum/provider=
  585. #f = {}
  586. #f['quorum/provider'] = 'corosync_quorum_ykd'
  587. #configs.append(f)
  588. g = {}
  589. g['totem/rrp_mode'] = 'passive'
  590. g['totem/interface[2]/ringnumber'] = '1'
  591. g['totem/interface[2]/bindnetaddr'] = '192.168.200.0'
  592. g['totem/interface[2]/mcastaddr'] = '226.94.1.2'
  593. g['totem/interface[2]/mcastport'] = '5405'
  594. configs.append(g)
  595. h = {}
  596. h['totem/rrp_mode'] = 'active'
  597. h['totem/interface[2]/ringnumber'] = '1'
  598. h['totem/interface[2]/bindnetaddr'] = '192.168.200.0'
  599. h['totem/interface[2]/mcastaddr'] = '226.94.1.2'
  600. h['totem/interface[2]/mcastport'] = '5405'
  601. configs.append(h)
  602. num=1
  603. for cfg in configs:
  604. for testclass in GenTestClasses:
  605. bound_test = testclass(cm)
  606. if bound_test.is_applicable():
  607. bound_test.Audits = audits
  608. for c in cfg:
  609. bound_test.config[c] = cfg[c]
  610. bound_test.name = bound_test.name + '_' + str(num)
  611. result.append(bound_test)
  612. num = num + 1
  613. return result