NAT: disable CLI/API not supported in active mode (VPP-1234)
[vpp.git] / test / test_dhcp.py
index 21940ca..c5b1fa5 100644 (file)
@@ -11,7 +11,8 @@ from util import mk_ll_addr
 
 from scapy.layers.l2 import Ether, getmacbyip, ARP
 from scapy.layers.inet import IP, UDP, ICMP
-from scapy.layers.inet6 import IPv6, in6_getnsmac, in6_mactoifaceid
+from scapy.layers.inet6 import IPv6, in6_getnsmac
+from scapy.utils6 import in6_mactoifaceid
 from scapy.layers.dhcp import DHCP, BOOTP, DHCPTypes
 from scapy.layers.dhcp6 import DHCP6, DHCP6_Solicit, DHCP6_RelayForward, \
     DHCP6_RelayReply, DHCP6_Advertise, DHCP6OptRelayMsg, DHCP6OptIfaceId, \
@@ -1216,7 +1217,9 @@ class TestDHCP(VppTestCase):
         p_offer = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
                    IP(src=self.pg3.remote_ip4, dst="255.255.255.255") /
                    UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
-                   BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+                   BOOTP(op=1,
+                         yiaddr=self.pg3.local_ip4,
+                         chaddr=mactobinary(self.pg3.local_mac)) /
                    DHCP(options=[('message-type', 'offer'),
                                  ('server_id', self.pg3.remote_ip4),
                                  ('end')]))
@@ -1235,7 +1238,8 @@ class TestDHCP(VppTestCase):
         p_ack = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
                  IP(src=self.pg3.remote_ip4, dst="255.255.255.255") /
                  UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
-                 BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+                 BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+                       chaddr=mactobinary(self.pg3.local_mac)) /
                  DHCP(options=[('message-type', 'ack'),
                                ('subnet_mask', "255.255.255.0"),
                                ('router', self.pg3.remote_ip4),
@@ -1306,7 +1310,8 @@ class TestDHCP(VppTestCase):
         p_ack = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
                  IP(src=self.pg3.remote_ip4, dst=self.pg3.local_ip4) /
                  UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
-                 BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+                 BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+                       chaddr=mactobinary(self.pg3.local_mac)) /
                  DHCP(options=[('message-type', 'ack'),
                                ('subnet_mask', "255.255.255.0"),
                                ('router', self.pg3.remote_ip4),
@@ -1363,7 +1368,8 @@ class TestDHCP(VppTestCase):
         p_offer = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
                    IP(src=self.pg3.remote_ip4, dst=self.pg3.local_ip4) /
                    UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
-                   BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+                   BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+                         chaddr=mactobinary(self.pg3.local_mac)) /
                    DHCP(options=[('message-type', 'offer'),
                                  ('server_id', self.pg3.remote_ip4),
                                  ('end')]))
@@ -1383,7 +1389,8 @@ class TestDHCP(VppTestCase):
         p_ack = (Ether(dst=self.pg3.local_mac, src=self.pg3.remote_mac) /
                  IP(src=self.pg3.remote_ip4, dst=self.pg3.local_ip4) /
                  UDP(sport=DHCP4_SERVER_PORT, dport=DHCP4_CLIENT_PORT) /
-                 BOOTP(op=1, yiaddr=self.pg3.local_ip4) /
+                 BOOTP(op=1, yiaddr=self.pg3.local_ip4,
+                       chaddr=mactobinary(self.pg3.local_mac)) /
                  DHCP(options=[('message-type', 'ack'),
                                ('subnet_mask', "255.255.255.0"),
                                ('router', self.pg3.remote_ip4),