From 517ee7fd3eb28ecf030c5d50be09fcdabe508922 Mon Sep 17 00:00:00 2001 From: Matej Klotton Date: Mon, 25 Jul 2016 17:52:22 +0200 Subject: CSIT-197: Add basic mapping rule tests for MAP-E - IPv4 prefix length + ea bits length < 32 - IPv4 prefix length + ea bits length == 32 - IPv4 prefix length + ea bits length > 32 - End user IPv6 prefix is 64 - IPv4 preffix is 0 Change-Id: Ib8d76abfebfb206fbbaa3c1422b2d321a3ed8712 Signed-off-by: Matej Klotton --- resources/traffic_scripts/send_ipv4_udp_check_lw_4o6.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'resources/traffic_scripts') 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." -- cgit 1.2.3-korg