remove unnecessary netconf
diff --git a/accton/vxlan_flow_test.py b/accton/vxlan_flow_test.py
index fcb840b..8977b7a 100755
--- a/accton/vxlan_flow_test.py
+++ b/accton/vxlan_flow_test.py
@@ -393,12 +393,6 @@
vlan=access_port2_vid, vnid=vnid)
logging.info("config VTAP 0x%lx, PHY %d, VID %d, VNID %lx", access_lport2, access_phy_port2, access_port2_vid, vnid);
assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
- next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id,
- dst_mac=dst_mac,
- phy_port=network_port_phy_port,
- vlan=network_port_vlan)
- logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", next_hop_id, dst_mac, network_port_phy_port, network_port_vlan);
- assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
lport=network_lport,
src_ip=network_port_sip, dst_ip=network_port_dip,
@@ -542,12 +536,6 @@
vlan=access_port2_vid, vnid=vnid)
logging.info("config VTAP 0x%lx, PHY %d, VID %d, VNID %lx", access_lport2, access_phy_port2, access_port2_vid, vnid);
assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
- next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id,
- dst_mac=dst_mac,
- phy_port=network_port_phy_port,
- vlan=network_port_vlan)
- logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", next_hop_id, dst_mac, network_port_phy_port, network_port_vlan);
- assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
lport=network_lport,
src_ip=network_port_sip, dst_ip=network_port_dip,
@@ -773,10 +761,338 @@
class AccessWithNetwork(base_tests.SimpleDataPlane):
def runTest(self):
+ """
+ first verify flood over unicast,
+ second verify flood over mcast
+ """
+ if config["switch_ip"] == None:
+ logging.error("Doesn't configure switch IP")
+ return
delete_all_flows(self.controller)
delete_all_groups(self.controller)
+
+ access_port1_vid=1
+ access_phy_port1=config["port_map"].keys()[0]
+ access_lport1=0x10001
+ access_lport1_mac=[0x00, 0x00, 0x00, 0x77, 0x77, 0x77]
+ access_lport1_mac_str=(":".join(map(str, map(hex, access_lport1_mac)))).replace("0x", "")
+ access_port2_vid=0
+ access_phy_port2=config["port_map"].keys()[1]
+ access_lport2=0x10002
+ access_lport2_mac=[0x00,0x00, 0x00, 0x00, 0x00, 0x02]
+ access_lport2_mac_str=(":".join(map(str, map(hex, access_lport2_mac)))).replace("0x", "")
+ vnid=10
+ next_hop_id=1
+ next_hop_id_mcast=2
+ dst_mac="00:00:11:22:22:11"
+ mcast_ipv4="224.1.1.1"
+ dst_mac_mcast="01:00:5e:01:01:01"
+ network_port_phy_port=config["port_map"].keys()[2]
+ network_lport=0x10003
+ network_port_vlan=2
+ network_port_sip="192.168.1.1"
+ network_port_dip="192.168.2.1"
+ network_lport_mac=[0x00,0x00, 0x00, 0x00, 0x00, 0x03]
+ network_lport_mac_str=(":".join(map(str, map(hex, network_lport_mac)))).replace("0x", "")
+
+
+
+ feature_reply=get_featureReplay(self)
+ #get switch CPU mac
+ str_datapath_id_f= "{:016x}".format(feature_reply.datapath_id)
+ str_datapath_id=':'.join([str_datapath_id_f[i:i+2] for i in range(0, len(str_datapath_id_f), 2)])
+ switch_cpu_mac_str=str_datapath_id[6:]
+ switch_cpu_mac = switch_cpu_mac_str.split(":")
+ switch_cpu_mac=[int(switch_cpu_mac[i],16) for i in range(0, len(switch_cpu_mac))]
+
+ #add config vtep/vtap/nexthop/vni
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id,
+ dst_mac=dst_mac,
+ phy_port=network_port_phy_port,
+ vlan=network_port_vlan)
+ logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", next_hop_id, dst_mac, network_port_phy_port, network_port_vlan);
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml)==True)
+
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id_mcast,
+ dst_mac=dst_mac_mcast,
+ phy_port=network_port_phy_port,
+ vlan=network_port_vlan)
+ logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", next_hop_id, dst_mac, network_port_phy_port, network_port_vlan);
+
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml)==True)
+
+ vni_config_xml=get_vni_config_xml(vni_id=vnid, mcast_ipv4=mcast_ipv4, next_hop_id=next_hop_id_mcast)
+ #vni_config_xml=get_vni_config_xml(vni_id=vnid, mcast_ipv4=None, next_hop_id=None)
+ logging.info("config VNI %lx", vnid);
+ assert(send_edit_config(config["switch_ip"], vni_config_xml) == True)
+
+ vtap_conf_xml=get_vtap_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=access_lport1, phy_port=access_phy_port1,
+ vlan=access_port1_vid, vnid=vnid)
+ logging.info("config VTAP 0x%lx, PHY %d, VID %d, VNID %lx", access_lport1, access_phy_port1, access_port1_vid, vnid);
+ assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
+
+ vtap_conf_xml=get_vtap_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=access_lport2, phy_port=access_phy_port2,
+ vlan=access_port2_vid, vnid=vnid)
+ logging.info("config VTAP 0x%lx, PHY %d, VID %d, VNID %lx", access_lport2, access_phy_port2, access_port2_vid, vnid);
+ assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
+ vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=network_lport,
+ src_ip=network_port_sip, dst_ip=network_port_dip,
+ next_hop_id=next_hop_id,
+ vnid=vnid)
+ logging.info("config VTEP 0x%lx, SRC_IP %s, DST_IP %s, NEXTHOP_ID %d", network_lport, network_port_sip, network_port_dip, next_hop_id);
+ assert(send_edit_config(config["switch_ip"], vtep_conf_xml) == True)
+
+ #add port table to have vxlan ability
+ add_port_table_flow(self.controller)
+ add_port_table_flow(self.controller, is_overlay=False)
+
+ #for network port need l2 interface group to decide vlan tag or not
+ add_one_l2_interface_grouop(self.controller, network_port_phy_port, vlan_id=network_port_vlan)
+ #add network mac
+ add_overlay_bridge_flow(self.controller, network_lport_mac, vnid, network_lport, False, True)
+ add_overlay_bridge_flow(self.controller, access_lport1_mac, vnid, access_lport1, False, True)
+
+ #add termination table for network port
+ add_termination_flow(self.controller, in_port=network_port_phy_port, eth_type=0x0800,
+ dst_mac=switch_cpu_mac, vlanid=network_port_vlan)
+ #add vlan table for network port rx packet class vlan
+ add_one_vlan_table_flow(self.controller, of_port=network_port_phy_port,
+ vlan_id=network_port_vlan)
+
+ #tx packet on access lport 1
+ parsed_pkt = simple_udp_packet(pktlen=96, eth_dst=network_lport_mac_str,
+ dl_vlan_enable= True,
+ vlan_vid=access_port1_vid)
+ pkt = str(parsed_pkt)
+ self.dataplane.send(access_phy_port1, pkt)
+ #verify packet on network port
+ #need find a way to verify vxlan header
+ parsed_pkt = simple_udp_packet(pktlen=92, eth_dst=network_lport_mac_str)
+ pkt = str(parsed_pkt)
+ verify_packet(self, pkt, network_port_phy_port)
+ verify_no_other_packets(self)
+
+ #tx packet on network lport
+ inner_pkt = simple_udp_packet(pktlen=96, eth_dst=access_lport1_mac_str)
+ vxlan_pkt = simple_vxlan_packet(eth_dst=switch_cpu_mac_str,
+ vnid=vnid,
+ ip_dst= network_port_sip,
+ ip_src=network_port_dip,
+ inner_payload=inner_pkt)
+ self.dataplane.send(network_port_phy_port, str(vxlan_pkt))
+ #verify
+ inner_pkt = simple_udp_packet(pktlen=100, eth_dst=access_lport1_mac_str,
+ dl_vlan_enable= True,
+ vlan_vid=access_port1_vid)
+
+ verify_packet(self, inner_pkt, access_phy_port1)
+ verify_no_other_packets(self)
+
+
+ #exit verification so clear all configuration
+ delete_all_flows(self.controller)
+ delete_all_groups(self.controller)
+
+ vtap_conf_xml=get_vtap_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=access_lport1, phy_port=access_phy_port1,
+ vlan=access_port1_vid, vnid=vnid, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
+ vtap_conf_xml=get_vtap_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=access_lport2, phy_port=access_phy_port2,
+ vlan=access_port2_vid, vnid=vnid, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
+ vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=network_lport,
+ src_ip=network_port_sip, dst_ip=network_port_dip,
+ next_hop_id=next_hop_id,
+ vnid=vnid, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vtep_conf_xml) == True)
+
+ vni_config_xml=get_vni_config_xml(vni_id=vnid, mcast_ipv4=None, next_hop_id=None, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vni_config_xml) == True)
+
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id,
+ dst_mac=dst_mac,
+ phy_port=network_port_phy_port,
+ vlan=network_port_vlan, operation="delete")
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
+
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id_mcast,
+ dst_mac=dst_mac_mcast,
+ phy_port=network_port_phy_port,
+ vlan=network_port_vlan, operation="delete")
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
class NetworkToNetwork(base_tests.SimpleDataPlane):
def runTest(self):
+ """
+ This case can't work, can't identify it is chip limitation or not
+ """
+ return
+ if config["switch_ip"] == None:
+ logging.error("Doesn't configure switch IP")
+ return
+
delete_all_flows(self.controller)
- delete_all_groups(self.controller)
\ No newline at end of file
+ delete_all_groups(self.controller)
+
+ vnid=10
+ mcast_ipv4="224.1.1.1"
+ dst_mac_mcast="01:00:5e:01:01:01"
+ next_hop_id_mcast=3
+
+ access_port1_vid=1
+ access_phy_port1=config["port_map"].keys()[0]
+ access_lport1=0x10001
+
+ network_port1_phy_port=config["port_map"].keys()[1]
+ network_lport1=0x10003
+ network_port1_vlan=2
+ network_port1_sip="192.168.1.1"
+ network_port1_dip="192.168.2.1"
+ network_port1_next_hop_id=1
+ network_port1_dst_mac="00:00:11:22:22:11"
+ network_lport1_mac=[0x00,0x00, 0x00, 0x00, 0x00, 0x33]
+ network_lport1_mac_str=(":".join(map(str, map(hex, network_lport1_mac)))).replace("0x", "")
+
+ network_port2_phy_port=config["port_map"].keys()[2]
+ network_lport2=0x10004
+ network_port2_vlan=3
+ network_port2_sip="192.168.3.1"
+ network_port2_dip="192.168.4.1"
+ network_port2_next_hop_id=2
+ network_port2_dst_mac="00:00:11:22:22:22"
+ network_lport2_mac=[0x00,0x00, 0x00, 0x00, 0x00, 0x44]
+ network_lport2_mac_str=(":".join(map(str, map(hex, network_lport2_mac)))).replace("0x", "")
+
+ feature_reply=get_featureReplay(self)
+ #get switch CPU mac
+ str_datapath_id_f= "{:016x}".format(feature_reply.datapath_id)
+ str_datapath_id=':'.join([str_datapath_id_f[i:i+2] for i in range(0, len(str_datapath_id_f), 2)])
+ switch_cpu_mac_str=str_datapath_id[6:]
+ switch_cpu_mac = switch_cpu_mac_str.split(":")
+ switch_cpu_mac=[int(switch_cpu_mac[i],16) for i in range(0, len(switch_cpu_mac))]
+ #config vlxan
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=network_port1_next_hop_id,
+ dst_mac=network_port1_dst_mac,
+ phy_port=network_port1_phy_port,
+ vlan=network_port1_vlan)
+ logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", network_port1_next_hop_id, network_port1_dst_mac, network_port1_phy_port, network_port1_vlan);
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml)==True)
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=network_port2_next_hop_id,
+ dst_mac=network_port2_dst_mac,
+ phy_port=network_port2_phy_port,
+ vlan=network_port2_vlan)
+ logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", network_port2_next_hop_id, network_port2_dst_mac, network_port2_phy_port, network_port2_vlan);
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml)==True)
+
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id_mcast,
+ dst_mac=dst_mac_mcast,
+ phy_port=network_port1_phy_port,
+ vlan=network_port1_vlan)
+ logging.info("config NextHop %d, DST_MAC %s, PHY %d, VLAN %d", next_hop_id_mcast, dst_mac_mcast, network_port1_phy_port, network_port1_vlan);
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml)==True)
+
+ vni_config_xml=get_vni_config_xml(vni_id=vnid, mcast_ipv4=mcast_ipv4, next_hop_id=next_hop_id_mcast)
+ logging.info("config VNI %lx", vnid);
+ assert(send_edit_config(config["switch_ip"], vni_config_xml) == True)
+
+ vtap_conf_xml=get_vtap_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=access_lport1, phy_port=access_phy_port1,
+ vlan=access_port1_vid, vnid=vnid)
+ logging.info("config VTAP 0x%lx, PHY %d, VID %d, VNID %lx", access_lport1, access_phy_port1, access_port1_vid, vnid);
+ assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
+
+ vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=network_lport1,
+ src_ip=network_port1_sip, dst_ip=network_port1_dip,
+ next_hop_id=network_port1_next_hop_id,
+ vnid=vnid)
+ logging.info("config VTEP 0x%lx, SRC_IP %s, DST_IP %s, NEXTHOP_ID %d", network_lport1, network_port1_sip, network_port1_dip, network_port1_next_hop_id);
+ assert(send_edit_config(config["switch_ip"], vtep_conf_xml) == True)
+ vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=network_lport2,
+ src_ip=network_port2_sip, dst_ip=network_port2_dip,
+ next_hop_id=network_port2_next_hop_id,
+ vnid=vnid)
+ logging.info("config VTEP 0x%lx, SRC_IP %s, DST_IP %s, NEXTHOP_ID %d", network_lport2, network_port2_sip, network_port2_dip, network_port2_next_hop_id);
+ assert(send_edit_config(config["switch_ip"], vtep_conf_xml) == True)
+
+ #add port table to have vxlan ability
+ add_port_table_flow(self.controller)
+
+ #for network port need l2 interface group to decide vlan tag or not
+ add_one_l2_interface_grouop(self.controller, network_port1_phy_port, vlan_id=network_port1_vlan)
+ add_one_l2_interface_grouop(self.controller, network_port2_phy_port, vlan_id=network_port2_vlan)
+ #add network mac
+ add_overlay_bridge_flow(self.controller, network_lport1_mac, vnid, network_lport1, False, True)
+ add_overlay_bridge_flow(self.controller, network_lport2_mac, vnid, network_lport2, False, True)
+
+ #add termination table for network port
+ add_termination_flow(self.controller, in_port=network_port1_phy_port, eth_type=0x0800,
+ dst_mac=switch_cpu_mac, vlanid=network_port1_vlan)
+ add_termination_flow(self.controller, in_port=network_port2_phy_port, eth_type=0x0800,
+ dst_mac=switch_cpu_mac, vlanid=network_port2_vlan)
+ #add vlan table for network port rx packet class vlan
+ add_one_vlan_table_flow(self.controller, of_port=network_port1_phy_port,
+ vlan_id=network_port1_vlan)
+ add_one_vlan_table_flow(self.controller, of_port=network_port2_phy_port,
+ vlan_id=network_port2_vlan)
+
+ #packet tx on network port 1 rx on network port 2
+ inner_pkt = simple_udp_packet(pktlen=96, eth_dst=network_lport2_mac_str)
+ vxlan_pkt = simple_vxlan_packet(eth_dst=switch_cpu_mac_str,
+ vnid=vnid,
+ ip_dst= network_port1_sip,
+ ip_src=network_port1_dip,
+ inner_payload=inner_pkt)
+ self.dataplane.send(network_port1_phy_port, str(vxlan_pkt))
+ #verify
+ verify_packet(self, str(inner_pkt), network_port2_phy_port)
+ verify_no_other_packets(self)
+
+
+
+ #exit verification so clear all configuration
+ delete_all_flows(self.controller)
+ delete_all_groups(self.controller)
+
+ vtap_conf_xml=get_vtap_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=access_lport1, phy_port=access_phy_port1,
+ vlan=access_port1_vid, vnid=vnid, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vtap_conf_xml) == True)
+
+ vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=network_lport1,
+ src_ip=network_port1_sip, dst_ip=network_port1_dip,
+ next_hop_id=network_port1_next_hop_id,
+ vnid=vnid, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vtep_conf_xml) == True)
+ vtep_conf_xml=get_vtep_lport_config_xml(dp_id=feature_reply.datapath_id,
+ lport=network_lport2,
+ src_ip=network_port2_sip, dst_ip=network_port2_dip,
+ next_hop_id=network_port2_next_hop_id,
+ vnid=vnid, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vtep_conf_xml) == True)
+ vni_config_xml=get_vni_config_xml(vni_id=vnid, mcast_ipv4=None, next_hop_id=None, operation="delete")
+ assert(send_edit_config(config["switch_ip"], vni_config_xml) == True)
+
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=network_port1_next_hop_id,
+ dst_mac=network_port1_dst_mac,
+ phy_port=network_port1_phy_port,
+ vlan=network_port1_vlan, operation="delete")
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=network_port2_next_hop_id,
+ dst_mac=network_port2_dst_mac,
+ phy_port=network_port2_phy_port,
+ vlan=network_port2_vlan, operation="delete")
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
+ next_hop_conf_xml=get_next_hop_config_xml(next_hop_id=next_hop_id_mcast,
+ dst_mac=dst_mac_mcast,
+ phy_port=network_port1_phy_port,
+ vlan=network_port1_vlan, operation="delete")
+ assert(send_edit_config(config["switch_ip"], next_hop_conf_xml) == True)
+
\ No newline at end of file