Skip to content

Commit 3cee20f

Browse files
author
krishna
committed
pd testcases fix
1 parent a6120d4 commit 3cee20f

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

tests/ptf-tests/common/pd_utils.py

+24-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
default_entries = {}
1111
stats_enabled = 1
12+
nat_enabled = 1
1213

1314
def port_to_pipe(port):
1415
return port >> 7
@@ -136,11 +137,10 @@ def populate_default_fabric_entries(client, sess_hdl, dev_tgt, ipv6_enabled=0,
136137
client.nat_flow_set_default_action_nop(sess_hdl, dev_tgt)
137138

138139
def populate_default_entries(client, sess_hdl, dev_tgt, ipv6_enabled,
139-
acl_enabled, tunnel_enabled, multicast_enabled):
140+
acl_enabled, tunnel_enabled, multicast_enabled, int_enabled):
140141
index = 0
141142
action_spec = dc_set_config_parameters_action_spec_t(
142-
action_enable_dod=0,
143-
action_switch_id=0)
143+
action_enable_dod=0)
144144
client.switch_config_params_set_default_action_set_config_parameters(
145145
sess_hdl, dev_tgt, action_spec)
146146
client.validate_outer_ethernet_set_default_action_set_valid_outer_unicast_packet_untagged(
@@ -178,17 +178,17 @@ def populate_default_entries(client, sess_hdl, dev_tgt, ipv6_enabled,
178178
sess_hdl, dev_tgt)
179179
client.storm_control_set_default_action_nop(
180180
sess_hdl, dev_tgt)
181-
client.storm_control_stats_set_default_action_nop(
181+
client.storm_control_stats_set_default_action_nop(
182182
sess_hdl, dev_tgt)
183-
meter_spec = dc_bytes_meter_spec_t(
183+
meter_spec = dc_bytes_meter_spec_t(
184184
cir_kbps=0,
185185
cburst_kbits=0,
186186
pir_kbps=0,
187187
pburst_kbits=0,
188188
color_aware=False)
189-
client.meter_index_set_default_action_nop(
189+
client.meter_index_set_default_action_nop(
190190
sess_hdl, dev_tgt, meter_spec)
191-
client.meter_action_set_default_action_meter_permit(
191+
client.meter_action_set_default_action_meter_permit(
192192
sess_hdl, dev_tgt)
193193

194194
client.vlan_decap_set_default_action_nop(
@@ -217,6 +217,14 @@ def populate_default_entries(client, sess_hdl, dev_tgt, ipv6_enabled,
217217
sess_hdl, dev_tgt)
218218
client.system_acl_set_default_action_nop(
219219
sess_hdl, dev_tgt)
220+
client.adjust_lkp_fields_set_default_action_non_ip_lkp(
221+
sess_hdl, dev_tgt)
222+
match_spec = dc_adjust_lkp_fields_match_spec_t(ipv4_valid=1, ipv6_valid=0)
223+
client.adjust_lkp_fields_table_add_with_ipv4_lkp(
224+
sess_hdl, dev_tgt, match_spec)
225+
match_spec = dc_adjust_lkp_fields_match_spec_t(ipv4_valid=0, ipv6_valid=1)
226+
client.adjust_lkp_fields_table_add_with_ipv6_lkp(
227+
sess_hdl, dev_tgt, match_spec)
220228
client.sflow_ingress_set_default_action_nop(
221229
sess_hdl, dev_tgt)
222230
client.sflow_ing_take_sample_set_default_action_nop(
@@ -282,6 +290,15 @@ def populate_default_entries(client, sess_hdl, dev_tgt, ipv6_enabled,
282290
client.ipv6_multicast_route_star_g_set_default_action_multicast_route_star_g_miss(
283291
sess_hdl, dev_tgt)
284292

293+
client.egress_qos_map_set_default_action_nop(
294+
sess_hdl, dev_tgt)
295+
client.ingress_qos_map_dscp_set_default_action_nop(
296+
sess_hdl, dev_tgt)
297+
client.ingress_qos_map_pcp_set_default_action_nop(
298+
sess_hdl, dev_tgt)
299+
client.traffic_class_set_default_action_nop(
300+
sess_hdl, dev_tgt)
301+
285302
if stats_enabled:
286303
client.ingress_bd_stats_set_default_action_update_ingress_bd_stats(
287304
sess_hdl, dev_tgt)
@@ -613,7 +630,6 @@ def program_ports(client, sess_hdl, dev_tgt, port_count):
613630
match_spec, action_spec)
614631
action_spec = dc_set_ingress_port_properties_action_spec_t(
615632
action_if_label=count,
616-
action_exclusion_id=count,
617633
action_qos_group=0,
618634
action_tc_qos_group=0,
619635
action_tc=0,
@@ -665,7 +681,6 @@ def program_emulation_ports(client, sess_hdl, dev_tgt, port_count):
665681

666682
action_spec = dc_set_ingress_port_properties_action_spec_t(
667683
action_if_label=count,
668-
action_exclusion_id=count,
669684
action_qos_group=0,
670685
action_tc_qos_group=0,
671686
action_tc=0,

tests/ptf-tests/pd-tests/switch.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self):
6363
pd_base_tests.ThriftInterfaceDataPlane.__init__(self, "dc")
6464

6565
def runTest(self):
66-
sess_hdl = self.conn_mgr.client_init(16)
66+
sess_hdl = self.conn_mgr.client_init()
6767
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
6868
device = 0
6969

@@ -148,7 +148,7 @@ def __init__(self):
148148

149149
def runTest(self):
150150
print
151-
sess_hdl = self.conn_mgr.client_init(16)
151+
sess_hdl = self.conn_mgr.client_init()
152152
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
153153
device = 0
154154

@@ -270,7 +270,7 @@ def runTest(self):
270270
print "ipv6 not enabled"
271271
return
272272

273-
sess_hdl = self.conn_mgr.client_init(16)
273+
sess_hdl = self.conn_mgr.client_init()
274274
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
275275
device = 0
276276

@@ -399,7 +399,7 @@ def runTest(self):
399399
print "tunnel not enabled"
400400
return
401401

402-
sess_hdl = self.conn_mgr.client_init(16)
402+
sess_hdl = self.conn_mgr.client_init()
403403
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
404404
device = 0
405405

@@ -582,7 +582,7 @@ def runTest(self):
582582
if tunnel_enabled == 0:
583583
print "tunnel not enabled"
584584
return
585-
sess_hdl = self.conn_mgr.client_init(16)
585+
sess_hdl = self.conn_mgr.client_init()
586586
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
587587
device = 0
588588

@@ -788,7 +788,7 @@ def __init__(self):
788788
pd_base_tests.ThriftInterfaceDataPlane.__init__(self, "dc")
789789

790790
def runTest(self):
791-
sess_hdl = self.conn_mgr.client_init(16)
791+
sess_hdl = self.conn_mgr.client_init()
792792
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
793793
device = 0
794794

@@ -881,7 +881,7 @@ def __init__(self):
881881
pd_base_tests.ThriftInterfaceDataPlane.__init__(self, "dc")
882882

883883
def runTest(self):
884-
sess_hdl = self.conn_mgr.client_init(16)
884+
sess_hdl = self.conn_mgr.client_init()
885885
mc_sess_hdl = self.mc.mc_create_session()
886886
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
887887
device = 0
@@ -990,7 +990,7 @@ def __init__(self):
990990

991991
def runTest(self):
992992
print
993-
sess_hdl = self.conn_mgr.client_init(16)
993+
sess_hdl = self.conn_mgr.client_init()
994994
dev_tgt = DevTarget_t(0, hex_to_i16(0xFFFF))
995995
device = 0
996996

0 commit comments

Comments
 (0)