]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use two queues for concurrent t_otp.py daemons 1046/head
authorGreg Hudson <ghudson@mit.edu>
Wed, 4 Mar 2020 22:18:51 +0000 (17:18 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 5 Mar 2020 18:28:50 +0000 (13:28 -0500)
t_otp.py occasionally fails during the #8708 regression test, reading
a true answer instead of the expected false answer during the first
verify() call.  Most likely the daemons are writing their answers to
the shared queue out of order.  Use a separate queue for the second
daemon to ensure correct correlation of results.

src/tests/t_otp.py

index cba871a0f2a2f349857e8c0d2dd325ea63659a4f..c3b820a411d5f874f39c7721aa52a9d0f15e4d49 100755 (executable)
@@ -256,16 +256,17 @@ verify(daemon, queue, True, realm.user_princ, 'accept')
 ## tokens configured, with the first rejecting and the second
 ## accepting.  With the bug, the KDC incorrectly rejects the request
 ## and then performs invalid memory accesses, most likely crashing.
+queue2 = Queue()
 daemon1 = UDPRadiusDaemon(args=(server_addr, secret_file, 'accept1', queue))
-daemon2 = UnixRadiusDaemon(args=(socket_file, None, 'accept2', queue))
+daemon2 = UnixRadiusDaemon(args=(socket_file, None, 'accept2', queue2))
 daemon1.start()
 queue.get()
 daemon2.start()
-queue.get()
+queue2.get()
 oconf = '[' + otpconfig_1('udp') + ', ' + otpconfig_1('unix') + ']'
 realm.run([kadminl, 'setstr', realm.user_princ, 'otp', oconf])
 realm.kinit(realm.user_princ, 'accept2', flags=flags)
 verify(daemon1, queue, False, realm.user_princ.split('@')[0], 'accept2')
-verify(daemon2, queue, True, realm.user_princ, 'accept2')
+verify(daemon2, queue2, True, realm.user_princ, 'accept2')
 
 success('OTP tests')