diff options
| author | 姜萍 <[email protected]> | 2020-04-18 21:42:44 +0800 |
|---|---|---|
| committer | 姜萍 <[email protected]> | 2020-04-18 21:42:44 +0800 |
| commit | bde93f8ce13bf9bd0861674bb0e57f0e53596f47 (patch) | |
| tree | b0ae63b4176eeb3e182fcb264fe5cc48034800a6 | |
| parent | b287887835ce6297a16b59e6718f1e786aaeba22 (diff) | |
0418 commit-2
| -rw-r--r-- | .DS_Store | bin | 10244 -> 10244 bytes | |||
| -rw-r--r-- | ptf/test0418.py (renamed from ptf/test0410.py) | 22 |
2 files changed, 19 insertions, 3 deletions
| Binary files differ diff --git a/ptf/test0410.py b/ptf/test0418.py index abfec0a..15539ca 100644 --- a/ptf/test0410.py +++ b/ptf/test0418.py @@ -40,7 +40,7 @@ class BaseProgramTest(BfRuntimeTest): # nexthop def setUp(self): self.client_id = 0 - self.p4_name = "super_vlan_test" + self.p4_name = "super_vlan" self.dev = 0 self.dev_tgt = gc.Target(self.dev, pipe_id=0xFFFF) @@ -91,7 +91,12 @@ class BaseProgramTest(BfRuntimeTest): self.nexthop.info.data_field_annotation_add( "new_mac_sa", "Ingress.l3_switch", "mac") - self.tables = [ self.is_l2_switch, self.Trunk_switch, self.Port_to_srcvid, self.dstIP_to_dstvid, self.src_supervid_to_mac, self.ipv4_host, self.ipv4_lpm, self.nexthop ] + self.egr_vlan_port = self.bfrt_info.table_get("Egress.egr_vlan_port") + self.egr_vlan_port.info.key_field_annotation_add( + "meta.vid", "int") + + + self.tables = [ self.is_l2_switch, self.Trunk_switch, self.Port_to_srcvid, self.dstIP_to_dstvid, self.src_supervid_to_mac, self.ipv4_host, self.ipv4_lpm, self.nexthop, self.egr_vlan_port ] # Create a list of all ports available on the device self.swports = [] @@ -448,6 +453,17 @@ class HostL3Switch(BaseProgramTest): print(" Added an entry to is_l2_switch: {} --> l3_switch()". format(dst_addr)) + key_list = [ + self.egr_vlan_port.make_key([ + gc.KeyTuple('meta.vid', src_subvid), + gc.KeyTuple('egress_port', egress_port)]) + ] + data_list = [ + self.egr_vlan_port.make_data([], "Egress.send_untagged") + ] + + self.egr_vlan_port.entry_add(self.dev_tgt, key_list, data_list); + # # Prepare the test packet and the expected packet send_pkt = simple_tcp_packet(eth_dst=dst_addr, @@ -833,4 +849,4 @@ class LpmARP(BaseProgramTest): verify_packet(self, exp_pkt, ingress_port) print("IP address {} is at {}". - format(ipv4_dst, arp_mac))
\ No newline at end of file + format(ipv4_dst, arp_mac)) |
