pytests: import test_pipelining (test11)

parent eb461c40
......@@ -23,3 +23,21 @@ def test_ignore_garbage(kresd_sock):
msg_answer = utils.receive_parse_answer(kresd_sock)
assert msg_answer.id == MSG_ID
def test_pipelining(kresd_sock):
"""
Test sends two queries to kresd - 1000.delay.getdnsapi.net and 1.delay.getdnsapi.net.
Expected: answer to the second query must come first.
"""
MSG_ID_FIRST = 1
MSG_ID_SECOND = 2
buf = utils.get_msgbuf('1000.delay.getdnsapi.net.', dns.rdatatype.A, MSG_ID_FIRST) \
+ utils.get_msgbuf('1.delay.getdnsapi.net.', dns.rdatatype.A, MSG_ID_SECOND)
kresd_sock.sendall(buf)
msg_answer = utils.receive_parse_answer(kresd_sock)
assert msg_answer.id == MSG_ID_SECOND
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment