X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftraffic_scripts%2Fsend_ipv4_udp_check_lw_4o6.py;h=116edb206b69fb94670b1817712470d6e5d1bbdc;hp=881abc83a256d39f7a234c7a11a91c1bcbd53f94;hb=517ee7fd3eb28ecf030c5d50be09fcdabe508922;hpb=bc4e345605abe0772043892fcc99fce9aa768edb diff --git a/resources/traffic_scripts/send_ipv4_udp_check_lw_4o6.py b/resources/traffic_scripts/send_ipv4_udp_check_lw_4o6.py index 881abc83a2..116edb206b 100755 --- a/resources/traffic_scripts/send_ipv4_udp_check_lw_4o6.py +++ b/resources/traffic_scripts/send_ipv4_udp_check_lw_4o6.py @@ -19,6 +19,7 @@ import sys from scapy.layers.l2 import Ether from scapy.layers.inet import IP, UDP +from ipaddress import ip_address from resources.libraries.python.PacketVerifier import RxQueue, TxQueue from resources.libraries.python.TrafficScriptArg import TrafficScriptArg @@ -88,12 +89,12 @@ def main(): # pylint: disable=too-many-statements, too-many-locals ipv6 = ether.payload # check ipv6 - if ipv6.dst != rx_dst_ipv6: + if ip_address(unicode(ipv6.dst)) != ip_address(unicode(rx_dst_ipv6)): raise RuntimeError("Destination IP error {} != {}.". format(ipv6.dst, rx_dst_ipv6)) print "Destination IPv6: OK." - if ipv6.src != rx_src_ipv6: + if ip_address(unicode(ipv6.src)) != ip_address(unicode(rx_src_ipv6)): raise RuntimeError("Source IP error {} != {}.". format(ipv6.src, rx_src_ipv6)) print "Source IPv6: OK."