CSIT-353: MAP-T FIX: Add tx src mac to traffic script 59/2659/2
authorMatej Klotton <mklotton@cisco.com>
Tue, 6 Sep 2016 11:46:30 +0000 (13:46 +0200)
committerJan Gelety <jgelety@cisco.com>
Tue, 6 Sep 2016 15:39:40 +0000 (15:39 +0000)
Change-Id: I011231c68dc470590323933dbdb3f33c3026559b
Signed-off-by: Matej Klotton <mklotton@cisco.com>
resources/libraries/robot/map.robot
resources/traffic_scripts/send_ipv6_udp_check_map_t.py
tests/func/softwire/map_t.robot

index fc7744e..ac086b4 100644 (file)
 | | ... | - tx_if - Interface from where to send IPv4 UDP packet. Type: string
 | | ... | - rx_if - Interface where to receive IPv6 UDP packet. Type: string
 | | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string
+| | ... | - tx_src_mac - Source MAC address of IPv4 packet. Type: string
 | | ... | - tx_dst_ipv6 - Destination IPv6 address. Type: string
 | | ... | - tx_src_ipv6 - Source IPv6 address. Type: string
 | | ... | - tx_src_udp_port - Source UDP port. Type: integer
 | | ... | \| 08:00:27:66:b8:57 \| 100.0.0.1 \| 20.169.201.219 \|
 | | ...
 | | [Arguments]
-| | ... | ${tg_node} | ${tx_if} | ${rx_if}
-| | ... | ${tx_dst_mac} | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_src_udp_port}
+| | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_src_mac}
+| | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_src_udp_port}
 | | ... | ${rx_dst_mac} | ${rx_src_mac} | ${dst_ipv4} | ${src_ipv4}
 | | ...
 | | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if}
 | | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if}
 | | ${args}= | Catenate
 | | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name}
-| | ... | --tx_dst_mac | ${tx_dst_mac}
+| | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac}
 | | ... | --tx_src_ipv6 | ${tx_src_ipv6} | --tx_dst_ipv6 | ${tx_dst_ipv6}
 | | ... | --tx_src_udp_port | ${tx_src_udp_port}
 | | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac}
index af117c1..2d9c291 100755 (executable)
@@ -49,12 +49,14 @@ def _is_udp_in_ipv4(pkt):
 
 def main():  # pylint: disable=too-many-statements, too-many-locals
     """Main function of the script file."""
-    args = TrafficScriptArg(['tx_dst_mac', 'tx_src_ipv6', 'tx_dst_ipv6',
+    args = TrafficScriptArg(['tx_dst_mac', 'tx_src_mac',
+                             'tx_src_ipv6', 'tx_dst_ipv6',
                              'tx_src_udp_port', 'rx_dst_mac', 'rx_src_mac',
                              'rx_src_ipv4', 'rx_dst_ipv4'])
     rx_if = args.get_arg('rx_if')
     tx_if = args.get_arg('tx_if')
     tx_dst_mac = args.get_arg('tx_dst_mac')
+    tx_src_mac = args.get_arg('tx_src_mac')
     tx_src_ipv6 = args.get_arg('tx_src_ipv6')
     tx_dst_ipv6 = args.get_arg('tx_dst_ipv6')
     tx_src_udp_port = int(args.get_arg('tx_src_udp_port'))
@@ -70,7 +72,7 @@ def main():  # pylint: disable=too-many-statements, too-many-locals
 
     # Create empty UDP datagram in IPv6
 
-    udp = (Ether(dst=tx_dst_mac) /
+    udp = (Ether(dst=tx_dst_mac, src=tx_src_mac) /
            IPv6(src=tx_src_ipv6, dst=tx_dst_ipv6) /
            UDP(sport=tx_src_udp_port, dport=tx_dst_udp_port) /
            'udp_payload')
index 76dea10..886c363 100644 (file)
 # |===================|===============|================|============|=============|==========|===========|================|==========|
 # | ipv4_pfx          | ipv6_dst_pfx  | ipv6_src_pfx   | ea_bit_len | psid_offset | psid_len | ipv4_src  | ipv4_dst       | dst_port |
 # |===================|===============|================|============|=============|==========|===========|================|==========|
-| | 20.169.0.0/16     | 2001:db8::/32 | ${ipv6_br_src} | ${12}      | ${6}        | ${8}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
-| | 20.169.0.0/16     | 2001:db8::/16 | ${ipv6_br_src} | ${40}      | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
+| | 20.169.0.0/16     | 2001::/16     | ${ipv6_br_src} | ${40}      | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
 | | 20.169.201.219/32 | 2001:db8::/32 | ${ipv6_br_src} | ${0}       | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
 | | 20.0.0.0/8        | 2001:db8::/40 | ${ipv6_br_src} | ${24}      | ${0}        | ${0}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
+#| | 20.169.201.0/32   | 2001:db8::/32 | ${ipv6_br_src} | ${0}       | ${6}        | ${8}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
+#| | 20.169.201.0/24   | 2001:db8::/32 | ${ipv6_br_src} | ${0}       | ${6}        | ${8}     | 100.0.0.1 | 20.169.201.219 | ${1232}  |
 
 
 *** Keywords ***
 # Check translation from v6 to v4 with traffic script
 | | Send IPv6 UDP and check IPv4 headers for MAP-T
 | | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1}
-| | ... | ${dut_to_tg_if2_mac}
+| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
 | | ... | ${ipv6_br_addr} | ${ipv6_ce_addr}
 | | ... | ${dst_port}
 | | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}