1
0

ticket48194_test.py 20 KB

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