ticket48194_test.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. # --- BEGIN COPYRIGHT BLOCK ---
  2. # Copyright (C) 2015 Red Hat, Inc.
  3. # All rights reserved.
  4. #
  5. # License: GPL (version 3 or any later version).
  6. # See LICENSE for details.
  7. # --- END COPYRIGHT BLOCK ---
  8. #
  9. import os
  10. import sys
  11. import subprocess
  12. import time
  13. import ldap
  14. import logging
  15. import pytest
  16. import shutil
  17. from lib389 import DirSrv, Entry, tools
  18. from lib389 import DirSrvTools
  19. from lib389.tools import DirSrvTools
  20. from lib389._constants import *
  21. from lib389.properties import *
  22. log = logging.getLogger(__name__)
  23. CONFIG_DN = 'cn=config'
  24. ENCRYPTION_DN = 'cn=encryption,%s' % CONFIG_DN
  25. RSA = 'RSA'
  26. RSA_DN = 'cn=%s,%s' % (RSA, ENCRYPTION_DN)
  27. LDAPSPORT = '10636'
  28. SERVERCERT = 'Server-Cert'
  29. plus_all_ecount = 0
  30. plus_all_dcount = 0
  31. plus_all_ecount_noweak = 0
  32. plus_all_dcount_noweak = 0
  33. class TopologyStandalone(object):
  34. def __init__(self, standalone):
  35. standalone.open()
  36. self.standalone = standalone
  37. @pytest.fixture(scope="module")
  38. def topology(request):
  39. '''
  40. This fixture is used to standalone topology for the 'module'.
  41. '''
  42. # Creating standalone instance ...
  43. standalone = DirSrv(verbose=False)
  44. # Args for the standalone instance
  45. args_instance[SER_HOST] = HOST_STANDALONE
  46. args_instance[SER_PORT] = PORT_STANDALONE
  47. args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
  48. args_standalone = args_instance.copy()
  49. standalone.allocate(args_standalone)
  50. # Get the status of the instance and restart it if it exists
  51. instance_standalone = standalone.exists()
  52. # Remove the instance
  53. if instance_standalone:
  54. standalone.delete()
  55. # Create the instance
  56. standalone.create()
  57. # Used to retrieve configuration information (dbdir, confdir...)
  58. standalone.open()
  59. # clear the tmp directory
  60. standalone.clearTmpDir(__file__)
  61. # Here we have standalone instance up and running
  62. return TopologyStandalone(standalone)
  63. def _header(topology, label):
  64. topology.standalone.log.info("\n\n###############################################")
  65. topology.standalone.log.info("####### %s" % label)
  66. topology.standalone.log.info("###############################################")
  67. def my_test_init(topology):
  68. """
  69. Generate self signed cert and import it to the DS cert db.
  70. Enable SSL
  71. """
  72. _header(topology, 'Testing Ticket 48194 - harden the list of ciphers available by default')
  73. conf_dir = topology.standalone.confdir
  74. log.info("\n######################### Checking existing certs ######################\n")
  75. os.system('certutil -L -d %s -n "CA certificate"' % conf_dir)
  76. os.system('certutil -L -d %s -n "%s"' % (conf_dir, SERVERCERT))
  77. log.info("\n######################### Create a password file ######################\n")
  78. pwdfile = '%s/pwdfile.txt' % (conf_dir)
  79. opasswd = os.popen("(ps -ef ; w ) | sha1sum | awk '{print $1}'", "r")
  80. passwd = opasswd.readline()
  81. pwdfd = open(pwdfile, "w")
  82. pwdfd.write(passwd)
  83. pwdfd.close()
  84. log.info("\n######################### Create a noise file ######################\n")
  85. noisefile = '%s/noise.txt' % (conf_dir)
  86. noise = os.popen("(w ; ps -ef ; date ) | sha1sum | awk '{print $1}'", "r")
  87. noisewdfd = open(noisefile, "w")
  88. noisewdfd.write(noise.readline())
  89. noisewdfd.close()
  90. log.info("\n######################### Create key3.db and cert8.db database ######################\n")
  91. os.system("ls %s" % pwdfile)
  92. os.system("cat %s" % pwdfile)
  93. os.system('certutil -N -d %s -f %s' % (conf_dir, pwdfile))
  94. log.info("\n######################### Creating encryption key for CA ######################\n")
  95. os.system('certutil -G -d %s -z %s -f %s' % (conf_dir, noisefile, pwdfile))
  96. log.info("\n######################### Creating self-signed CA certificate ######################\n")
  97. os.system('( echo y ; echo ; echo y ) | certutil -S -n "CA certificate" -s "cn=CAcert" -x -t "CT,," -m 1000 -v 120 -d %s -z %s -f %s -2' % (conf_dir, noisefile, pwdfile))
  98. log.info("\n######################### Exporting the CA certificate to cacert.asc ######################\n")
  99. cafile = '%s/cacert.asc' % conf_dir
  100. catxt = os.popen('certutil -L -d %s -n "CA certificate" -a' % conf_dir)
  101. cafd = open(cafile, "w")
  102. while True:
  103. line = catxt.readline()
  104. if (line == ''):
  105. break
  106. cafd.write(line)
  107. cafd.close()
  108. log.info("\n######################### Generate the server certificate ######################\n")
  109. ohostname = os.popen('hostname --fqdn', "r")
  110. myhostname = ohostname.readline()
  111. os.system('certutil -S -n "%s" -s "cn=%s,ou=389 Directory Server" -c "CA certificate" -t "u,u,u" -m 1001 -v 120 -d %s -z %s -f %s' % (SERVERCERT, myhostname.rstrip(), conf_dir, noisefile, pwdfile))
  112. log.info("\n######################### create the pin file ######################\n")
  113. pinfile = '%s/pin.txt' % (conf_dir)
  114. pintxt = 'Internal (Software) Token:%s' % passwd
  115. pinfd = open(pinfile, "w")
  116. pinfd.write(pintxt)
  117. pinfd.close()
  118. log.info("\n######################### enable SSL in the directory server with all ciphers ######################\n")
  119. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  120. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3', 'off'),
  121. (ldap.MOD_REPLACE, 'nsTLS1', 'on'),
  122. (ldap.MOD_REPLACE, 'nsSSLClientAuth', 'allowed'),
  123. (ldap.MOD_REPLACE, 'allowWeakCipher', 'on'),
  124. (ldap.MOD_REPLACE, 'nsSSL3Ciphers', '+all')])
  125. topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-security', 'on'),
  126. (ldap.MOD_REPLACE, 'nsslapd-ssl-check-hostname', 'off'),
  127. (ldap.MOD_REPLACE, 'nsslapd-secureport', LDAPSPORT)])
  128. topology.standalone.add_s(Entry((RSA_DN, {'objectclass': "top nsEncryptionModule".split(),
  129. 'cn': RSA,
  130. 'nsSSLPersonalitySSL': SERVERCERT,
  131. 'nsSSLToken': 'internal (software)',
  132. 'nsSSLActivation': 'on'})))
  133. def connectWithOpenssl(topology, cipher, expect):
  134. """
  135. Connect with the given cipher
  136. Condition:
  137. If expect is True, the handshake should be successful.
  138. If expect is False, the handshake should be refused with
  139. access log: "Cannot communicate securely with peer:
  140. no common encryption algorithm(s)."
  141. """
  142. log.info("Testing %s -- expect to handshake %s", cipher,"successfully" if expect else "failed")
  143. myurl = 'localhost:%s' % LDAPSPORT
  144. cmdline = ['/usr/bin/openssl', 's_client', '-connect', myurl, '-cipher', cipher]
  145. strcmdline = '/usr/bin/openssl s_client -connect localhost:%s -cipher %s' % (LDAPSPORT, cipher)
  146. log.info("Running cmdline: %s", strcmdline)
  147. try:
  148. proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
  149. except ValueError:
  150. log.info("%s failed: %s", cmdline, ValueError)
  151. proc.kill()
  152. while True:
  153. l = proc.stdout.readline()
  154. if l == "":
  155. break
  156. if 'Cipher is' in l:
  157. log.info("Found: %s", l)
  158. if expect:
  159. if '(NONE)' in l:
  160. assert False
  161. else:
  162. proc.stdin.close()
  163. assert True
  164. else:
  165. if '(NONE)' in l:
  166. assert True
  167. else:
  168. proc.stdin.close()
  169. assert False
  170. def my_test_run_0(topology):
  171. """
  172. Check nsSSL3Ciphers: +all
  173. All ciphers are enabled except null.
  174. Note: allowWeakCipher: on
  175. """
  176. _header(topology, 'Test Case 1 - Check the ciphers availability for "+all"; allowWeakCipher: on')
  177. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  178. topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-errorlog-level', '64')])
  179. log.info("\n######################### Restarting the server ######################\n")
  180. topology.standalone.restart(timeout=120)
  181. connectWithOpenssl(topology, 'RC4-SHA', True)
  182. connectWithOpenssl(topology, 'AES256-SHA256', True)
  183. def my_test_run_1(topology):
  184. """
  185. Check nsSSL3Ciphers: +all
  186. All ciphers are enabled except null.
  187. Note: default allowWeakCipher (i.e., off) for +all
  188. """
  189. _header(topology, 'Test Case 2 - Check the ciphers availability for "+all" with default allowWeakCiphers')
  190. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  191. topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-errorlog-level', '64')])
  192. # Make sure allowWeakCipher is not set.
  193. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_DELETE, 'allowWeakCipher', None)])
  194. log.info("\n######################### Restarting the server ######################\n")
  195. topology.standalone.stop(timeout=10)
  196. os.system('mv %s %s.48194_0' % (topology.standalone.errlog, topology.standalone.errlog))
  197. os.system('touch %s' % (topology.standalone.errlog))
  198. topology.standalone.start(timeout=120)
  199. connectWithOpenssl(topology, 'RC4-SHA', False)
  200. connectWithOpenssl(topology, 'AES256-SHA256', True)
  201. def my_test_run_2(topology):
  202. """
  203. Check nsSSL3Ciphers: +rsa_aes_128_sha,+rsa_aes_256_sha
  204. rsa_aes_128_sha, tls_rsa_aes_128_sha, rsa_aes_256_sha, tls_rsa_aes_256_sha are enabled.
  205. default allowWeakCipher
  206. """
  207. _header(topology, 'Test Case 3 - Check the ciphers availability for "+rsa_aes_128_sha,+rsa_aes_256_sha" with default allowWeakCipher')
  208. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  209. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', '+rsa_aes_128_sha,+rsa_aes_256_sha')])
  210. log.info("\n######################### Restarting the server ######################\n")
  211. topology.standalone.stop(timeout=10)
  212. os.system('mv %s %s.48194_1' % (topology.standalone.errlog, topology.standalone.errlog))
  213. os.system('touch %s' % (topology.standalone.errlog))
  214. topology.standalone.start(timeout=120)
  215. connectWithOpenssl(topology, 'RC4-SHA', False)
  216. connectWithOpenssl(topology, 'AES256-SHA256', False)
  217. connectWithOpenssl(topology, 'AES128-SHA', True)
  218. connectWithOpenssl(topology, 'AES256-SHA', True)
  219. def my_test_run_3(topology):
  220. """
  221. Check nsSSL3Ciphers: -all
  222. All ciphers are disabled.
  223. default allowWeakCipher
  224. """
  225. _header(topology, 'Test Case 4 - Check the ciphers availability for "-all"')
  226. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  227. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', '-all')])
  228. log.info("\n######################### Restarting the server ######################\n")
  229. topology.standalone.stop(timeout=10)
  230. os.system('mv %s %s.48194_2' % (topology.standalone.errlog, topology.standalone.errlog))
  231. os.system('touch %s' % (topology.standalone.errlog))
  232. topology.standalone.start(timeout=120)
  233. connectWithOpenssl(topology, 'RC4-SHA', False)
  234. connectWithOpenssl(topology, 'AES256-SHA256', False)
  235. def my_test_run_4(topology):
  236. """
  237. Check no nsSSL3Ciphers
  238. Default ciphers are enabled.
  239. default allowWeakCipher
  240. """
  241. _header(topology, 'Test Case 5 - Check no nsSSL3Ciphers (-all) with default allowWeakCipher')
  242. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  243. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_DELETE, 'nsSSL3Ciphers', '-all')])
  244. log.info("\n######################### Restarting the server ######################\n")
  245. topology.standalone.stop(timeout=10)
  246. os.system('mv %s %s.48194_3' % (topology.standalone.errlog, topology.standalone.errlog))
  247. os.system('touch %s' % (topology.standalone.errlog))
  248. topology.standalone.start(timeout=120)
  249. connectWithOpenssl(topology, 'RC4-SHA', False)
  250. connectWithOpenssl(topology, 'AES256-SHA256', True)
  251. def my_test_run_5(topology):
  252. """
  253. Check nsSSL3Ciphers: default
  254. Default ciphers are enabled.
  255. default allowWeakCipher
  256. """
  257. _header(topology, 'Test Case 6 - Check default nsSSL3Ciphers (default setting) with default allowWeakCipher')
  258. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  259. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', 'default')])
  260. log.info("\n######################### Restarting the server ######################\n")
  261. topology.standalone.stop(timeout=10)
  262. os.system('mv %s %s.48194_4' % (topology.standalone.errlog, topology.standalone.errlog))
  263. os.system('touch %s' % (topology.standalone.errlog))
  264. topology.standalone.start(timeout=120)
  265. connectWithOpenssl(topology, 'RC4-SHA', False)
  266. connectWithOpenssl(topology, 'AES256-SHA256', True)
  267. def my_test_run_6(topology):
  268. """
  269. Check nsSSL3Ciphers: +all,-TLS_RSA_WITH_AES_256_CBC_SHA256
  270. All ciphers are disabled.
  271. default allowWeakCipher
  272. """
  273. _header(topology, 'Test Case 7 - Check nsSSL3Ciphers: +all,-TLS_RSA_WITH_AES_256_CBC_SHA256 with default allowWeakCipher')
  274. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  275. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', '+all,-TLS_RSA_WITH_AES_256_CBC_SHA256')])
  276. log.info("\n######################### Restarting the server ######################\n")
  277. topology.standalone.stop(timeout=10)
  278. os.system('mv %s %s.48194_5' % (topology.standalone.errlog, topology.standalone.errlog))
  279. os.system('touch %s' % (topology.standalone.errlog))
  280. topology.standalone.start(timeout=120)
  281. connectWithOpenssl(topology, 'RC4-SHA', False)
  282. connectWithOpenssl(topology, 'AES256-SHA256', False)
  283. connectWithOpenssl(topology, 'AES128-SHA', True)
  284. def my_test_run_7(topology):
  285. """
  286. Check nsSSL3Ciphers: -all,+rsa_rc4_128_md5
  287. All ciphers are disabled.
  288. default allowWeakCipher
  289. """
  290. _header(topology, 'Test Case 8 - Check nsSSL3Ciphers: -all,+rsa_rc4_128_md5 with default allowWeakCipher')
  291. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  292. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', '-all,+rsa_rc4_128_md5')])
  293. log.info("\n######################### Restarting the server ######################\n")
  294. topology.standalone.stop(timeout=10)
  295. os.system('mv %s %s.48194_6' % (topology.standalone.errlog, topology.standalone.errlog))
  296. os.system('touch %s' % (topology.standalone.errlog))
  297. topology.standalone.start(timeout=120)
  298. connectWithOpenssl(topology, 'RC4-SHA', False)
  299. connectWithOpenssl(topology, 'AES256-SHA256', False)
  300. connectWithOpenssl(topology, 'RC4-MD5', True)
  301. def my_test_run_8(topology):
  302. """
  303. Check nsSSL3Ciphers: default + allowWeakCipher: off
  304. Strong Default ciphers are enabled.
  305. """
  306. _header(topology, 'Test Case 9 - Check default nsSSL3Ciphers (default setting + allowWeakCipher: off)')
  307. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  308. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', 'default'),
  309. (ldap.MOD_REPLACE, 'allowWeakCipher', 'off')])
  310. log.info("\n######################### Restarting the server ######################\n")
  311. topology.standalone.stop(timeout=10)
  312. os.system('mv %s %s.48194_7' % (topology.standalone.errlog, topology.standalone.errlog))
  313. os.system('touch %s' % (topology.standalone.errlog))
  314. topology.standalone.start(timeout=120)
  315. connectWithOpenssl(topology, 'RC4-SHA', False)
  316. connectWithOpenssl(topology, 'AES256-SHA256', True)
  317. def my_test_run_9(topology):
  318. """
  319. Check no nsSSL3Ciphers
  320. Default ciphers are enabled.
  321. allowWeakCipher: on
  322. nsslapd-errorlog-level: 0
  323. """
  324. _header(topology, 'Test Case 10 - Check no nsSSL3Ciphers (default setting) with no errorlog-level & allowWeakCipher on')
  325. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  326. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', None),
  327. (ldap.MOD_REPLACE, 'allowWeakCipher', 'on')])
  328. topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-errorlog-level', None)])
  329. log.info("\n######################### Restarting the server ######################\n")
  330. topology.standalone.stop(timeout=10)
  331. os.system('mv %s %s.48194_8' % (topology.standalone.errlog, topology.standalone.errlog))
  332. os.system('touch %s' % (topology.standalone.errlog))
  333. topology.standalone.start(timeout=120)
  334. connectWithOpenssl(topology, 'RC4-SHA', True)
  335. connectWithOpenssl(topology, 'AES256-SHA256', True)
  336. def my_test_run_10(topology):
  337. """
  338. Check nsSSL3Ciphers: -TLS_RSA_WITH_NULL_MD5,+TLS_RSA_WITH_RC4_128_MD5,
  339. +TLS_RSA_EXPORT_WITH_RC4_40_MD5,+TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5,
  340. +TLS_DHE_RSA_WITH_DES_CBC_SHA,+SSL_RSA_FIPS_WITH_DES_CBC_SHA,
  341. +TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,+SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA,
  342. +TLS_RSA_EXPORT1024_WITH_RC4_56_SHA,+TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA,
  343. -SSL_CK_RC4_128_WITH_MD5,-SSL_CK_RC4_128_EXPORT40_WITH_MD5,
  344. -SSL_CK_RC2_128_CBC_WITH_MD5,-SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5,
  345. -SSL_CK_DES_64_CBC_WITH_MD5,-SSL_CK_DES_192_EDE3_CBC_WITH_MD5
  346. allowWeakCipher: on
  347. nsslapd-errorlog-level: 0
  348. """
  349. _header(topology, 'Test Case 11 - Check nsSSL3Ciphers: long list using the NSS Cipher Suite name with allowWeakCipher on')
  350. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  351. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers',
  352. '-TLS_RSA_WITH_NULL_MD5,+TLS_RSA_WITH_RC4_128_MD5,+TLS_RSA_EXPORT_WITH_RC4_40_MD5,+TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5,+TLS_DHE_RSA_WITH_DES_CBC_SHA,+SSL_RSA_FIPS_WITH_DES_CBC_SHA,+TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,+SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA,+TLS_RSA_EXPORT1024_WITH_RC4_56_SHA,+TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA,-SSL_CK_RC4_128_WITH_MD5,-SSL_CK_RC4_128_EXPORT40_WITH_MD5,-SSL_CK_RC2_128_CBC_WITH_MD5,-SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5,-SSL_CK_DES_64_CBC_WITH_MD5,-SSL_CK_DES_192_EDE3_CBC_WITH_MD5')])
  353. log.info("\n######################### Restarting the server ######################\n")
  354. topology.standalone.stop(timeout=10)
  355. os.system('mv %s %s.48194_9' % (topology.standalone.errlog, topology.standalone.errlog))
  356. os.system('touch %s' % (topology.standalone.errlog))
  357. topology.standalone.start(timeout=120)
  358. connectWithOpenssl(topology, 'RC4-SHA', False)
  359. connectWithOpenssl(topology, 'RC4-MD5', True)
  360. connectWithOpenssl(topology, 'AES256-SHA256', False)
  361. def my_test_run_11(topology):
  362. """
  363. Check nsSSL3Ciphers: +fortezza
  364. SSL_GetImplementedCiphers does not return this as a secuire cipher suite
  365. """
  366. _header(topology, 'Test Case 12 - Check nsSSL3Ciphers: +fortezza, which is not supported')
  367. topology.standalone.simple_bind_s(DN_DM, PASSWORD)
  368. topology.standalone.modify_s(ENCRYPTION_DN, [(ldap.MOD_REPLACE, 'nsSSL3Ciphers', '+fortezza')])
  369. log.info("\n######################### Restarting the server ######################\n")
  370. topology.standalone.stop(timeout=10)
  371. os.system('mv %s %s.48194_10' % (topology.standalone.errlog, topology.standalone.errlog))
  372. os.system('touch %s' % (topology.standalone.errlog))
  373. topology.standalone.start(timeout=120)
  374. connectWithOpenssl(topology, 'RC4-SHA', False)
  375. connectWithOpenssl(topology, 'AES256-SHA256', False)
  376. def my_test_final(topology):
  377. topology.standalone.delete()
  378. log.info('Testcase PASSED')
  379. def test_ticket48194(topology):
  380. '''
  381. run_isolated is used to run these test cases independently of a test scheduler (xunit, py.test..)
  382. To run isolated without py.test, you need to
  383. - edit this file and comment '@pytest.fixture' line before 'topology' function.
  384. - set the installation prefix
  385. - run this program
  386. '''
  387. my_test_init(topology)
  388. my_test_run_0(topology)
  389. my_test_run_1(topology)
  390. my_test_run_2(topology)
  391. my_test_run_3(topology)
  392. my_test_run_4(topology)
  393. my_test_run_5(topology)
  394. my_test_run_6(topology)
  395. my_test_run_7(topology)
  396. my_test_run_8(topology)
  397. my_test_run_9(topology)
  398. my_test_run_10(topology)
  399. my_test_run_11(topology)
  400. my_test_final(topology)
  401. if __name__ == '__main__':
  402. # Run isolated
  403. # -s for DEBUG mode
  404. CURRENT_FILE = os.path.realpath(__file__)
  405. pytest.main("-s %s" % CURRENT_FILE)