| | ... | ${tg_node} | ${args}
| Send Packet And Check ARP Request
-| | [Documentation] | Send IP packet from tx_port and check if ARP Request
+| | [Documentation] | Send IP packet from tx_port and check if ARP Request\
| | ... | packet is received on rx_port.
| | ...
| | ... | *Arguments:*
| | ...
| | ... | \| Send Packet And Check ARP Packet \| ${nodes['TG']} \| 16.0.0.1 \
| | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \
-| | ... | \| eth4 \| 08:00:27:5b:49:dd \| 08:00:27:54:71:02 \|
+| | ... | \| eth4 \| 08:00:27:5b:49:dd \| 192.168.2.1 \| 192.168.2.2 \|
| | ...
| | [Arguments] | ${tg_node} | ${tx_src_ip} | ${tx_dst_ip} | ${tx_port}
-| | ... | ${tx_dst_mac} | ${rx_port} | ${rx_dst_mac} | ${rx_arp_src_ip}
+| | ... | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} | ${rx_arp_src_ip}
| | ... | ${rx_arp_dst_ip}
| | ${args}= | Catenate
-| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac}
+| | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_src_mac | ${rx_src_mac}
| | ... | --tx_src_ip | ${tx_src_ip} | --tx_dst_ip | ${tx_dst_ip}
| | ... | --tx_if | ${tx_port} | --rx_if | ${rx_port}
| | ... | --rx_arp_src_ip ${rx_arp_src_ip} | --rx_arp_dst_ip ${rx_arp_dst_ip}
"""Send IP ICMP packet from one traffic generator interface and expects
ARP on the other."""
args = TrafficScriptArg(
- ['tx_dst_mac', 'rx_dst_mac', 'tx_src_ip', 'tx_dst_ip', 'rx_arp_src_ip',
+ ['tx_dst_mac', 'rx_src_mac', 'tx_src_ip', 'tx_dst_ip', 'rx_arp_src_ip',
'rx_arp_dst_ip'])
tx_dst_mac = args.get_arg('tx_dst_mac')
- rx_dst_mac = args.get_arg('rx_dst_mac')
+ rx_src_mac = args.get_arg('rx_src_mac')
src_ip = args.get_arg('tx_src_ip')
dst_ip = args.get_arg('tx_dst_ip')
tx_if = args.get_arg('tx_if')
rx_if = args.get_arg('rx_if')
+ rx_dst_mac = 'ff:ff:ff:ff:ff:ff'
rx_arp_src_ip = args.get_arg('rx_arp_src_ip')
rx_arp_dst_ip = args.get_arg('rx_arp_dst_ip')
if ether is None:
raise RuntimeError("Ethernet frame Rx timeout")
+ if ether.dst == rx_dst_mac:
+ print("Ethernet destination address matched.")
+ else:
+ raise RuntimeError(
+ "Matching ethernet destination address unsuccessful: {0} != {1}".
+ format(ether.dst, rx_dst_mac))
+
+ if ether.src == rx_src_mac:
+ print("Ethernet source address matched.")
+ else:
+ raise RuntimeError(
+ "Matching ethernet source address unsuccessful: {0} != {1}"
+ .format(ether.src, rx_src_mac))
+
# ARP check
if ether['ARP'] is not None:
print("ARP packet received.")
if ether['ARP'].op == 1: # 1 - who-has request
print("ARP request matched.")
else:
- raise RuntimeError("Matching ARP request unsuccessful: {0}"
- .format(ether.__repr__()))
+ raise RuntimeError("Matching ARP request unsuccessful: {0} != {1}"
+ .format(ether['ARP'].op, 1))
- if ether['ARP'].hwsrc == rx_dst_mac:
+ if ether['ARP'].hwsrc == rx_src_mac:
print("Source MAC matched.")
else:
- raise RuntimeError("Matching Source MAC unsuccessful: {0}"
- .format(ether.__repr__()))
+ raise RuntimeError("Matching Source MAC unsuccessful: {0} != {1}"
+ .format(ether['ARP'].hwsrc, rx_src_mac))
if ether['ARP'].hwdst == "00:00:00:00:00:00":
print("Destination MAC matched.")
else:
- raise RuntimeError("Matching Destination MAC unsuccessful: {0}"
- .format(ether.__repr__()))
+ raise RuntimeError("Matching Destination MAC unsuccessful: {0} != {1}"
+ .format(ether['ARP'].hwdst, "00:00:00:00:00:00"))
if ether['ARP'].psrc == rx_arp_src_ip:
print("Source ARP IP address matched.")
else:
- raise RuntimeError("Matching Source ARP IP address unsuccessful: {0}"
- .format(ether.__repr__()))
+ raise RuntimeError(
+ "Matching Source ARP IP address unsuccessful: {0} != {1}"
+ .format(ether['ARP'].psrc, rx_arp_src_ip))
if ether['ARP'].pdst == rx_arp_dst_ip:
print("Destination ARP IP address matched.")
else:
- raise RuntimeError("Matching Destination ARP IP address unsuccessful: "
- "{0}".format(ether.__repr__()))
+ raise RuntimeError(
+ "Matching Destination ARP IP address unsuccessful: {0} != {1}"
+ .format(ether['ARP'].pdst, rx_arp_dst_ip))
sys.exit(0)
*** Test Cases ***
| VPP sends ARP requests for unknown destinations
+| | [Documentation] | Setup IP addresses.
+| | ... | Send ICMP packet and check if VPP sends ARP request.
+| | Given Path for 3-node testing is set
+| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
+| | And Interfaces in 3-node path are up
+| | And L2 setup xconnect on DUT
+| | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
+| | When Set Interface Address | ${dut1_node}
+| | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
+| | And Set Interface Address | ${dut1_node}
+| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
+| | Then Send Packet And Check ARP Request | ${tg_node}
+| | ... | ${test_src_ip} | ${dut1_to_dut2_ip_GW} | ${tg_to_dut1}
+| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac}
+| | ... | ${dut1_to_dut2_ip} | ${dut1_to_dut2_ip_GW}
+
+| VPP sends ARP requests for route's next hop IP
+| | [Tags] | EXPECTED_FAILING
| | [Documentation] | Setup IP addresses and route.
| | ... | Send ICMP packet and check if VPP sends ARP request.
| | Given Path for 3-node testing is set
| | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
| | And Vpp Route Add
| | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
-| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
+| | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE}
| | Then Send Packet And Check ARP Request | ${tg_node}
| | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
-| | ... | ${tg_to_dut2_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac}
+| | ... | ${dut1_to_tg_mac} | ${tg_to_dut2} | ${dut1_to_dut2_mac}
| | ... | ${dut1_to_dut2_ip} | ${dut1_to_dut2_ip_GW}