krb5 commit: Use two queues for concurrent t_otp.py daemons

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/c03f67eefec05db19e84e889fab7c25904929633
commit c03f67eefec05db19e84e889fab7c25904929633
Author: Greg Hudson <[email protected]>
Date:   Wed Mar 4 17:18:51 2020 -0500

    Use two queues for concurrent t_otp.py daemons
    
    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 |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/tests/t_otp.py b/src/tests/t_otp.py
index cba871a..c3b820a 100755
--- a/src/tests/t_otp.py
+++ b/src/tests/t_otp.py
@@ -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')
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.