test_start = time.time()
for conversant, question, answer in test:
print("luser%s waiting for: %s" % (conversant, question))
- index, match, received = lusers[conversant].expect(
- [re.compile(question.encode("utf-8"), flags=re.DOTALL)], 5)
- captures[conversant] += received.decode("utf-8")
+ try:
+ index, match, received = lusers[conversant].expect(
+ [re.compile(question.encode("utf-8"), flags=re.DOTALL)], 5)
+ captures[conversant] += received.decode("utf-8")
+ except EOFError:
+ print("ERROR: luser%s premature disconnection expecting:\n\n"
+ "%s\n\n"
+ "Check the end of capture_%s.log for received data."
+ % (conversant, question, conversant))
+ success = False
+ break
try:
captures[conversant] += lusers[
conversant].read_very_eager().decode("utf-8")