Added timeout to sr1 calls

This commit is contained in:
Kkevsterrr 2020-03-13 08:44:04 -04:00
parent d7c5ed50c2
commit 81b2e935c9
1 changed files with 2 additions and 2 deletions

View File

@ -207,7 +207,7 @@ def test_decompress():
original = packet.copy()
tamper.tamper(packet, logger)
assert bytes(packet["DNS"]) == b'\x00\x00\x01\x00\x00\x02\x00\x00\x00\x00\x00\x00\x07minghui\xc0\x1a\x00\x01\x00\x01\x02ca\x00\x00\x01\x00\x01'
resp = sr1(packet.packet)
resp = sr1(packet.packet, timeout=5)
assert resp["DNS"]
assert resp["DNS"].rcode != 1
assert resp["DNSQR"]
@ -219,7 +219,7 @@ def test_decompress():
original = packet.copy()
tamper.tamper(packet, logger)
assert bytes(packet["DNS"]) == b'\x00\x00\x01\x00\x00\x02\x00\x00\x00\x00\x00\x00\x04maps\xc0\x17\x00\x01\x00\x01\x06google\x03com\x00\x00\x01\x00\x01'
resp = sr1(packet.packet)
resp = sr1(packet.packet, timeout=5)
assert resp["DNS"]
assert resp["DNS"].rcode != 1
assert resp["DNSQR"]