dhcp package

eth2p-ethip4-ip4base-ip4dhcpclient-func module

VPP sends a DHCP DISCOVER

Configure DHCPv4 client on interface to TG without hostname and check if DHCPv4 DISCOVER message contains all required fields with expected values.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
 When Set DHCP client on Interface  ${dut_node}  ${dut_to_tg_if1}
 Then Check DHCP DISCOVER header  ${tg_node}  ${tg_to_dut_if1}  ${dut_to_tg_if1_mac}

VPP sends a DHCPv4 DISCOVER with hostname

Configure DHCPv4 client on interface to TG with hostname and check if DHCPv4 DISCOVER message contains all required fields with expected values.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
 When Set DHCP client on Interface  ${dut_node}  ${dut_to_tg_if1}  ${client_hostname}
 Then Check DHCP DISCOVER header  ${tg_node}  ${tg_to_dut_if1}  ${dut_to_tg_if1_mac}  ${client_hostname}

VPP sends DHCPv4 REQUEST after OFFER

Configure DHCPv4 client on interface to TG and check if DHCPv4 REQUEST message contains all required fields.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
  And VPP Route Add  ${dut_node}  255.255.255.255  32  ${NONE}  local  ${FALSE}  ${NONE}
 When Set DHCP client on Interface  ${dut_node}  ${dut_to_tg_if1}
 Then Check DHCP REQUEST after OFFER  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if1_mac}  ${server_ip}  ${dut_to_tg_if1_mac}  ${client_ip}  ${client_mask}

VPP doesn’t send DHCPv4 REQUEST after OFFER with wrong XID

Configure DHCPv4 client on interface to TG. If server sends DHCPv4 OFFER with different XID as in DHCPv4 DISCOVER, DHCPv4 REQUEST message shouldn’t be sent.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
  And VPP Route Add  ${dut_node}  255.255.255.255  32  ${NONE}  local  ${FALSE}  ${NONE}
 When Set DHCP client on Interface  ${dut_node}  ${dut_to_tg_if1}
 Then Run Keyword And Expect Error  DHCP REQUEST Rx timeout  Check DHCP REQUEST after OFFER  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if1_mac}  ${server_ip}  ${dut_to_tg_if1_mac}  ${client_ip}  ${client_mask}  offer_xid=${own_xid}

VPP honors DHCPv4 lease time

Send IP configuration to the VPP client via DHCPv4. Address is checked with ICMP echo request and there should be no reply for echo request when lease has expired.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
  And VPP Route Add  ${dut_node}  255.255.255.255  32  ${NONE}  local  ${FALSE}  ${NONE}
 When Set DHCP client on Interface  ${dut_node}  ${dut_to_tg_if1}
  And Send IP configuration to client via DHCP  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if1_mac}  ${server_ip}  ${client_ip}  ${client_mask}  ${lease_time}
  And Add Arp On Dut  ${dut_node}  ${dut_to_tg_if1}  ${server_ip}  ${tg_to_dut_if1_mac}
 Then Node replies to ICMP echo request  ${tg_node}  ${tg_to_dut_if1}  ${dut_to_tg_if1_mac}  ${tg_to_dut_if1_mac}  ${client_ip}  ${server_ip}
  And Sleep  ${lease_time}
  And Run Keyword And Expect Error  ICMP echo Rx timeout  Node replies to ICMP echo request  ${tg_node}  ${tg_to_dut_if1}  ${dut_to_tg_if1_mac}  ${tg_to_dut_if1_mac}  ${client_ip}  ${server_ip}

eth2p-ethip4-ip4base-ip4dhcpproxy-func module

TC01: VPP proxies valid DHCPv4 request to DHCPv4 server

[Top] TG=DUT [Enc] Eth-IPv4-UDP-BOOTP-DHCP [Cfg] On DUT setup DHCPv4 proxy. [Ver] Make TG verify matching DHCPv4 packets between client and DHCPv4 server through DHCP proxy.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
  And VPP Route Add  ${dut_node}  255.255.255.255  32  ${NONE}  local  ${FALSE}  ${NONE}
  And Set Interface Address  ${dut_node}  ${dut_to_tg_if1}  ${dut_to_tg_if1_ip}  ${prefix_length}
  And Set Interface Address  ${dut_node}  ${dut_to_tg_if2}  ${dut_to_tg_if2_ip}  ${prefix_length}
  And Add Arp On Dut  ${dut_node}  ${dut_to_tg_if2}  ${dhcp_server_ip}  ${tg_to_dut_if2_mac}
 When DHCP Proxy Config  ${dut_node}  ${dhcp_server_ip}  ${dut_to_tg_if1_ip}
 Then Send DHCP Messages  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if2}  ${dhcp_server_ip}  ${tg_to_dut_if2_mac}  ${client_ip}  ${tg_to_dut_if1_mac}  ${dut_to_tg_if1_ip}

TC02: VPP proxy ignores invalid DHCPv4 request

[Top] TG=DUT [Enc] Eth-IPv4-UDP-BOOTP-DHCP [Cfg] On DUT setup DHCPv4 proxy. [Ver] Make TG verify matching invalid DHCPv4 packets are dropped.


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
  And VPP Route Add  ${dut_node}  255.255.255.255  32  ${NONE}  local  ${FALSE}  ${NONE}
  And Set Interface Address  ${dut_node}  ${dut_to_tg_if1}  ${dut_to_tg_if1_ip}  ${prefix_length}
  And Set Interface Address  ${dut_node}  ${dut_to_tg_if2}  ${dut_to_tg_if2_ip}  ${prefix_length}
  And Add Arp On Dut  ${dut_node}  ${dut_to_tg_if2}  ${dhcp_server_ip}  ${tg_to_dut_if2_mac}
 When DHCP Proxy Config  ${dut_node}  ${dhcp_server_ip}  ${dut_to_tg_if1_ip}
 Then Send DHCP DISCOVER  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if2}  ${discover_src_ip}  ${valid_discover_dst_ip}
  And Send DHCP DISCOVER should fail  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if2}  ${discover_src_ip}  ${invalid_discover_dst_ip}

eth2p-ethip6-ip6base-ip6dhcpproxy-func module

TC01: VPP proxies valid DHCPv6 request to DHCPv6 server

[Top] TG=DUT [Cfg] On DUT setup DHCP proxy. [Ver] Make TG verify matching DHCPv6 packets between client and DHCPv6 server through DHCPv6 proxy. [Ref] RFC 3315


Given Path for 2-node testing is set  ${nodes['TG']}  ${nodes['DUT1']}  ${nodes['TG']}
  And Interfaces in 2-node path are up
  And Vpp Set If Ipv6 Addr  ${dut_node}  ${dut_to_tg_if1}  ${dut_to_tg_if1_ip}  ${prefix_length}
  And Vpp Set If Ipv6 Addr  ${dut_node}  ${dut_to_tg_if2}  ${dut_to_tg_if2_ip}  ${prefix_length}
  And VPP Route Add  ${dut_node}  ff02::1:2  128  ${NONE}  local  ${FALSE}  ${NONE}
  And Add IP Neighbor  ${dut_node}  ${dut_to_tg_if2}  ${dhcp_server_ip}  ${tg_to_dut_if2_mac}
  And Vpp All Ra Suppress Link Layer  ${nodes}
 When DHCP Proxy Config  ${dut_node}  ${dhcp_server_ip}  ${dut_to_tg_if1_ip}
 Then Send DHCPv6 Messages  ${tg_node}  ${tg_to_dut_if1}  ${tg_to_dut_if2}  ${dut_to_tg_if1_ip}  ${dut_to_tg_if1_mac}  ${dhcp_server_ip}  ${tg_to_dut_if2_mac}  ${tg_to_dut_if1_mac}  ${dut_to_tg_if2_mac}