Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Report: Add data
[csit.git]
/
resources
/
traffic_scripts
/
arp_request.py
diff --git
a/resources/traffic_scripts/arp_request.py
b/resources/traffic_scripts/arp_request.py
index
86a4c01
..
8c5b9c7
100755
(executable)
--- a/
resources/traffic_scripts/arp_request.py
+++ b/
resources/traffic_scripts/arp_request.py
@@
-47,6
+47,7
@@
def arp_request_test():
"""Send ARP request, expect a reply and verify its fields.
returns: test status
"""Send ARP request, expect a reply and verify its fields.
returns: test status
+ :raises RuntimeError: ARP reply timeout.
"""
test_passed = False
(src_if, src_mac, dst_mac, src_ip, dst_ip) = parse_arguments()
"""
test_passed = False
(src_if, src_mac, dst_mac, src_ip, dst_ip) = parse_arguments()
@@
-65,6
+66,9
@@
def arp_request_test():
# wait for APR reply
ether = interface.recv_pkt()
# wait for APR reply
ether = interface.recv_pkt()
+ if not ether:
+ raise RuntimeError("ARP reply timeout")
+
# verify received packet
if not ether.haslayer(ARP):
# verify received packet
if not ether.haslayer(ARP):
@@
-101,8
+105,6
@@
def arp_request_test():
except RuntimeError as ex:
print 'Error occurred: {}'.format(ex)
except RuntimeError as ex:
print 'Error occurred: {}'.format(ex)
- finally:
- interface.close()
return test_passed
return test_passed