Skip to content

Commit e80769d

Browse files
committed
Modified test cases by QOS DB reference format remove
Syntax error fix Addressed review comment
1 parent 6e98e95 commit e80769d

17 files changed

+794
-793
lines changed

ansible/roles/fanout/templates/sonic_deploy_arista_7060.j2

+18-18
Original file line numberDiff line numberDiff line change
@@ -67,52 +67,52 @@
6767
"QUEUE": {
6868
{% for alias in device_conn[inventory_hostname] %}
6969
"{{ alias }}|0": {
70-
"scheduler": "[SCHEDULER|scheduler.0]"
70+
"scheduler": "scheduler.0"
7171
},
7272
"{{ alias }}|1": {
73-
"scheduler": "[SCHEDULER|scheduler.0]"
73+
"scheduler": "scheduler.0"
7474
},
7575
"{{ alias }}|2": {
76-
"scheduler": "[SCHEDULER|scheduler.0]"
76+
"scheduler": "scheduler.0"
7777
},
7878
"{{ alias }}|3": {
79-
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
80-
"scheduler": "[SCHEDULER|scheduler.1]"
79+
"wred_profile": "AZURE_LOSSLESS",
80+
"scheduler": "scheduler.1"
8181
},
8282
"{{ alias }}|4": {
83-
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
84-
"scheduler": "[SCHEDULER|scheduler.1]"
83+
"wred_profile": "AZURE_LOSSLESS",
84+
"scheduler": "scheduler.1"
8585
},
8686
"{{ alias }}|5": {
87-
"scheduler": "[SCHEDULER|scheduler.0]"
87+
"scheduler": "scheduler.0"
8888
},
8989
"{{ alias }}|6": {
90-
"scheduler": "[SCHEDULER|scheduler.0]"
90+
"scheduler": "scheduler.0"
9191
}{% if not loop.last %},{% endif %}
9292
{% endfor %}
9393
},
9494

9595
"BUFFER_QUEUE": {
9696
{% for alias in device_conn[inventory_hostname] %}
9797
"{{ alias }}|0-2": {
98-
"profile": "[BUFFER_PROFILE|egress_lossy_profile]"
98+
"profile": "egress_lossy_profile"
9999
},
100100
"{{ alias }}|3-4": {
101-
"profile": "[BUFFER_PROFILE|egress_lossless_profile]"
101+
"profile": "egress_lossless_profile"
102102
},
103103
"{{ alias }}|5-6": {
104-
"profile": "[BUFFER_PROFILE|egress_lossy_profile]"
104+
"profile": "egress_lossy_profile"
105105
}{% if not loop.last %},{% endif %}
106106
{% endfor %}
107107
},
108108

109109
"BUFFER_PG": {
110110
{% for alias in device_conn[inventory_hostname] %}
111111
"{{ alias }}|0": {
112-
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
112+
"profile": "ingress_lossy_profile"
113113
},
114114
"{{ alias }}|3-4": {
115-
"profile": "[BUFFER_PROFILE|pg_lossless_100000_300m_profile]"
115+
"profile": "pg_lossless_100000_300m_profile"
116116
}{% if not loop.last %},{% endif %}
117117
{% endfor %}
118118
},
@@ -188,25 +188,25 @@
188188
"BUFFER_PROFILE": {
189189
"egress_lossless_profile": {
190190
"static_th": "15982720",
191-
"pool": "[BUFFER_POOL|egress_lossless_pool]",
191+
"pool": "egress_lossless_pool",
192192
"size": "1518"
193193
},
194194
"egress_lossy_profile": {
195195
"dynamic_th": "3",
196-
"pool": "[BUFFER_POOL|egress_lossy_pool]",
196+
"pool": "egress_lossy_pool",
197197
"size": "1518"
198198
},
199199
"ingress_lossy_profile": {
200200
"dynamic_th": "3",
201-
"pool": "[BUFFER_POOL|ingress_lossless_pool]",
201+
"pool": "ingress_lossless_pool",
202202
"size": "0"
203203
},
204204
"pg_lossless_100000_300m_profile": {
205205
"xon_offset": "2288",
206206
"dynamic_th": "0",
207207
"xon": "2288",
208208
"xoff": "268736",
209-
"pool": "[BUFFER_POOL|ingress_lossless_pool]",
209+
"pool": "ingress_lossless_pool",
210210
"size": "1248"
211211
}
212212
}

ansible/roles/test/tasks/qos_get_max_buff_size.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
- name: Parse buffer profile name
3030
set_fact:
31-
buffer_profile="{{buffer_profile.stdout|replace('[','')|replace(']','')}}"
31+
buffer_profile="{{buffer_profile.stdout}}"
3232

3333

3434
- name: Get {{target_buffer_profile_type}} buffer headroom size for {{target_port_name}} port
35-
shell: redis-cli -n 4 HGET "{{buffer_profile}}" size
35+
shell: redis-cli -n 4 HGET "BUFFER_PROFILE|{{buffer_profile}}" size
3636
register: buffer_headroom
3737

3838
- fail:
@@ -41,15 +41,15 @@
4141

4242

4343
- name: Get {{target_buffer_profile_type}} buffer pool profile for {{target_port_name}} port
44-
shell: redis-cli -n 4 HGET "{{buffer_profile}}" pool
44+
shell: redis-cli -n 4 HGET "BUFFER_PROFILE|{{buffer_profile}}" pool
4545
register: buffer_pool_id
4646

4747
- name: Parse {{target_buffer_profile_type}} buffer pool profile name
4848
set_fact:
49-
buffer_pool_id="{{buffer_pool_id.stdout|replace('[','')|replace(']','')}}"
49+
buffer_pool_id="{{buffer_pool_id.stdout}}"
5050

5151
- name: Get {{target_buffer_profile_type}} buffer alpha ID for {{target_port_name}} port
52-
shell: redis-cli -n 4 HGET "{{buffer_profile}}" dynamic_th
52+
shell: redis-cli -n 4 HGET "BUFFER_PROFILE|{{buffer_profile}}" dynamic_th
5353
register: buffer_alpha_raw
5454

5555
# static threshold
@@ -60,7 +60,7 @@
6060
"{{target_buffer_profile_type}} buffer uses static threshold"
6161
6262
- name: Get {{target_buffer_profile_type}} buffer alpha ID for {{target_port_name}} port
63-
shell: redis-cli -n 4 HGET "{{buffer_profile}}" static_th
63+
shell: redis-cli -n 4 HGET "BUFFER_PROFILE|{{buffer_profile}}" static_th
6464
register: buffer_static_th
6565

6666
- fail:
@@ -78,7 +78,7 @@
7878
buffer_alpha="{{2|pow(buffer_alpha_raw.stdout|int)}}"
7979

8080
- name: Get {{target_buffer_profile_type}} buffer pool size for {{target_port_name}} port
81-
shell: redis-cli -n 4 HGET "{{buffer_pool_id}}" size
81+
shell: redis-cli -n 4 HGET "BUFFER_POOL|{{buffer_pool_id}}" size
8282
register: buffer_pool_size
8383

8484
- fail:
@@ -93,7 +93,7 @@
9393

9494
# ingress lossless specific
9595
- name: Get XON for {{target_port_name}} port
96-
shell: redis-cli -n 4 HGET "{{buffer_profile}}" xon
96+
shell: redis-cli -n 4 HGET "BUFFER_PROFILE|{{buffer_profile}}" xon
9797
register: buffer_xon
9898
when: buffer_profile != "" and "pg_lossless" in buffer_profile
9999

@@ -104,7 +104,7 @@
104104

105105
# ingress lossless specific
106106
- name: Get XOFF for {{target_port_name}} port
107-
shell: redis-cli -n 4 HGET "{{buffer_profile}}" xoff
107+
shell: redis-cli -n 4 HGET "BUFFER_PROFILE|{{buffer_profile}}" xoff
108108
register: buffer_xoff
109109
when: buffer_profile != "" and 'pg_lossless' in buffer_profile
110110

@@ -117,7 +117,7 @@
117117
# This is perhaps the only useful section in this yaml play
118118
- block:
119119
- set_fact:
120-
buffer_pool_name="{{buffer_pool_id|replace('BUFFER_POOL|','')}}"
120+
buffer_pool_name="{{buffer_pool_id}}"
121121

122122
- name: Get {{buffer_pool_name}} VOID
123123
shell: redis-cli -n 2 HGET COUNTERS_BUFFER_POOL_NAME_MAP "{{buffer_pool_name}}"

ansible/roles/test/tasks/qos_sai.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
defined_asic_list: ['td2', 'th', 'th2', 'spc1', 'spc2', 'spc3']
3434
speed_cablelen: "{{ lossless_buffer_profile }}"
3535

36-
- set_fact: speed_cablelen="{{speed_cablelen | regex_replace('BUFFER_PROFILE\|pg_lossless_(.*)_profile', '\\1')}}"
36+
- set_fact: speed_cablelen="{{speed_cablelen | regex_replace('pg_lossless_(.*)_profile', '\\1')}}"
3737

3838
- name: Get asic type
3939
set_fact: asic_type="{{ item }}"

ansible/roles/test/templates/qos_lossy_profile.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"BUFFER_PROFILE": {
44
"pg_lossy_TEST_profile": {
55
"dynamic_th": "-8",
6-
"pool": "[{{ buffer_pool_id }}]",
6+
"pool": "{{ buffer_pool_id }}",
77
{% if buffer_headroom.stdout != '0' %}
88
"size": "{{ buffer_headroom.stdout }}"
99
{% else %}
@@ -15,9 +15,9 @@
1515
"BUFFER_PG": {
1616
"{{ dut_switch_ports[src_port_id|int] }}|0-1": {
1717
{% if pfc_generate_buffer_profile == 'True' %}
18-
"profile": "[BUFFER_PROFILE|pg_lossy_TEST_profile]"
18+
"profile": "pg_lossy_TEST_profile"
1919
{% else %}
20-
"profile": "[{{ buffer_profile }}]"
20+
"profile": "{{ buffer_profile }}"
2121
{% endif %}
2222
}
2323
}

ansible/roles/test/templates/qos_pfc_profile.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"xon": "{{ buffer_xon.stdout }}",
66
"dynamic_th": "-8",
77
"xoff": "{{ buffer_xoff.stdout }}",
8-
"pool": "[{{ buffer_pool_id }}]",
8+
"pool": "{{ buffer_pool_id }}",
99
"size": "{{ buffer_headroom.stdout }}"
1010
}
1111
},
1212
{% endif %}
1313
"BUFFER_PG": {
1414
"{{ dut_switch_ports[src_port_id|int] }}|3-4": {
1515
{% if pfc_generate_buffer_profile == 'True' %}
16-
"profile": "[BUFFER_PROFILE|pg_lossless_PFC_TEST_profile]"
16+
"profile": "pg_lossless_PFC_TEST_profile"
1717
{% else %}
18-
"profile": "[{{ buffer_profile }}]"
18+
"profile": "{{ buffer_profile }}"
1919
{% endif %}
2020
}
2121
}

ansible/vars/configlet/t1-64-lag-clet/clet-add.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -121,59 +121,59 @@
121121
{
122122
"QUEUE": {
123123
"Ethernet63|0": {
124-
"scheduler": "[SCHEDULER|scheduler.0]"
124+
"scheduler": "scheduler.0"
125125
},
126126
"Ethernet63|1": {
127-
"scheduler": "[SCHEDULER|scheduler.0]"
127+
"scheduler": "scheduler.0"
128128
},
129129
"Ethernet63|2": {
130-
"scheduler": "[SCHEDULER|scheduler.0]"
130+
"scheduler": "scheduler.0"
131131
},
132132
"Ethernet63|3": {
133-
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
134-
"scheduler": "[SCHEDULER|scheduler.1]"
133+
"wred_profile": "AZURE_LOSSLESS",
134+
"scheduler": "scheduler.1"
135135
},
136136
"Ethernet63|4": {
137-
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
138-
"scheduler": "[SCHEDULER|scheduler.1]"
137+
"wred_profile": "AZURE_LOSSLESS",
138+
"scheduler": "scheduler.1"
139139
},
140140
"Ethernet63|5": {
141-
"scheduler": "[SCHEDULER|scheduler.0]"
141+
"scheduler": "scheduler.0"
142142
},
143143
"Ethernet63|6": {
144-
"scheduler": "[SCHEDULER|scheduler.0]"
144+
"scheduler": "scheduler.0"
145145
}
146146
}
147147
},
148148
{
149149
"BUFFER_PG": {
150150
"Ethernet63|0": {
151-
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
151+
"profile": "ingress_lossy_profile"
152152
}
153153
}
154154
},
155155
{
156156
"BUFFER_QUEUE": {
157157
"Ethernet63|0-2": {
158-
"profile": "[BUFFER_PROFILE|egress_lossy_profile]"
158+
"profile": "egress_lossy_profile"
159159
},
160160
"Ethernet63|3-4": {
161-
"profile": "[BUFFER_PROFILE|egress_lossless_profile]"
161+
"profile": "egress_lossless_profile"
162162
},
163163
"Ethernet63|5-6": {
164-
"profile": "[BUFFER_PROFILE|egress_lossy_profile]"
164+
"profile": "egress_lossy_profile"
165165
}
166166

167167
}
168168
},
169169
{
170170
"PORT_QOS_MAP": {
171171
"Ethernet63": {
172-
"tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
173-
"tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]",
172+
"tc_to_pg_map": "AZURE",
173+
"tc_to_queue_map": "AZURE",
174174
"pfc_enable": "3,4",
175-
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
176-
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]"
175+
"pfc_to_queue_map": "AZURE",
176+
"dscp_to_tc_map": "AZURE"
177177
}
178178
}
179179
},

spytest/apis/qos/cos.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def config_port_qos_map(dut, obj_name, interface, **kwargs):
1515
st.log("Please provide obj_name like 'AZURE' and interface like 'Ethernet0,Ethernet1'")
1616
return False
1717
else:
18-
cos_specific_dict = {"tc_to_queue_map": "[TC_TO_QUEUE_MAP|" + obj_name + "]", "dscp_to_tc_map": "[DSCP_TO_TC_MAP|" + obj_name + "]" }
18+
cos_specific_dict = {"tc_to_queue_map": obj_name, "dscp_to_tc_map": obj_name}
1919
temp_data[interface] = cos_specific_dict
2020
final_data['PORT_QOS_MAP'] = temp_data
2121
final_data = json.dumps(final_data)
@@ -64,19 +64,19 @@ def config_port_qos_map_all(dut, qos_maps, cli_type=''):
6464
if qos_map['port'] not in temp_data:
6565
temp_data[qos_map['port']] = {}
6666
if qos_map['map'] == 'dot1p_to_tc_map':
67-
temp_data[qos_map['port']].update(dot1p_to_tc_map="[DOT1P_TO_TC_MAP|{}]".format(qos_map['obj_name']))
67+
temp_data[qos_map['port']].update(dot1p_to_tc_map="{}".format(qos_map['obj_name']))
6868
elif qos_map['map'] == 'dscp_to_tc_map':
69-
temp_data[qos_map['port']].update(dscp_to_tc_map="[DSCP_TO_TC_MAP|{}]".format(qos_map['obj_name']))
69+
temp_data[qos_map['port']].update(dscp_to_tc_map="{}".format(qos_map['obj_name']))
7070
elif qos_map['map'] == 'pfc_to_queue_map':
71-
temp_data[qos_map['port']].update(pfc_to_queue_map="[MAP_PFC_PRIORITY_TO_QUEUE|{}]".format(qos_map['obj_name']))
71+
temp_data[qos_map['port']].update(pfc_to_queue_map="{}".format(qos_map['obj_name']))
7272
elif qos_map['map'] == 'tc_to_dot1p_map':
73-
temp_data[qos_map['port']].update(tc_to_dot1p_map="[TC_TO_DOT1P_MAP|{}]".format(qos_map['obj_name']))
73+
temp_data[qos_map['port']].update(tc_to_dot1p_map="{}".format(qos_map['obj_name']))
7474
elif qos_map['map'] == 'tc_to_dscp_map':
75-
temp_data[qos_map['port']].update(tc_to_dscp_map="[TC_TO_DSCP_MAP|{}]".format(qos_map['obj_name']))
75+
temp_data[qos_map['port']].update(tc_to_dscp_map="{}".format(qos_map['obj_name']))
7676
elif qos_map['map'] == 'tc_to_pg_map':
77-
temp_data[qos_map['port']].update(tc_to_pg_map="[TC_TO_PRIORITY_GROUP_MAP|{}]".format(qos_map['obj_name']))
77+
temp_data[qos_map['port']].update(tc_to_pg_map="{}".format(qos_map['obj_name']))
7878
elif qos_map['map'] == 'tc_to_queue_map':
79-
temp_data[qos_map['port']].update(tc_to_queue_map="[TC_TO_QUEUE_MAP|{}]".format(qos_map['obj_name']))
79+
temp_data[qos_map['port']].update(tc_to_queue_map="{}".format(qos_map['obj_name']))
8080
else:
8181
st.error('Invalid map: {}'.format(qos_map['map']))
8282
return False
@@ -840,4 +840,4 @@ def get_non_range_map_data_from_range_map_data(dict_data):
840840
temp.extend(re.findall(r"\d+", key))
841841
retval.update({i:value for i in temp})
842842
st.debug("The updated non-range map data is: {}".format(retval))
843-
return retval
843+
return retval

spytest/apis/qos/qos_shaper.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def apply_port_shaping_config(dut, shaper_data, **kwargs):
3939
json_data = {"PORT_QOS_MAP": {}, "SCHEDULER": {policy_name: {}}}
4040
if shaper_data.get("port"):
4141
ports = make_list(shaper_data["port"])
42-
json_data["PORT_QOS_MAP"] = {port: {"scheduler": "[SCHEDULER|{}]".format(policy_name)} for port in ports}
42+
json_data["PORT_QOS_MAP"] = {port: {"scheduler": "{}".format(policy_name)} for port in ports}
4343
else:
4444
json_data.pop("PORT_QOS_MAP")
4545
if ("pir" in shaper_data) or ("pbs" in shaper_data) or shaper_data.get("meter_type"):
@@ -146,7 +146,7 @@ def apply_queue_shaping_config(dut, shaper_data, **kwargs):
146146
config_data["SCHEDULER"].update(temp)
147147
if ports:
148148
queue_map = dict()
149-
queue_map = {"{}|{}".format(port, ent['queue']): {"scheduler": "[SCHEDULER|{}]".format(policy)} for port in ports}
149+
queue_map = {"{}|{}".format(port, ent['queue']): {"scheduler": "{}".format(policy)} for port in ports}
150150
config_data["QUEUE"].update(queue_map)
151151
config_data2 = {key: value for key, value in config_data.items()}
152152
for key, value in config_data2.items():
@@ -303,7 +303,7 @@ def apply_queue_shcheduling_config(dut, scheduler_data, **kwargs):
303303
if ent.get('type'):
304304
temp[policy].update(type = ent['type'].upper())
305305
if ports:
306-
queue_map = {"{}|{}".format(port, ent['queue']) : {"scheduler": "[SCHEDULER|{}]".format(policy)} for port in ports}
306+
queue_map = {"{}|{}".format(port, ent['queue']) : {"scheduler": "{}".format(policy)} for port in ports}
307307
if temp[policy]:
308308
config_data['SCHEDULER'].update(temp)
309309
if queue_map:

spytest/apis/qos/wred.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def apply_wred_ecn_config(dut, config, cli_type=''):
8888
temp['queue'] = list(range(int(queue1), int(queue2)+1))
8989
else:
9090
temp['queue'] = q.split(',')
91-
temp['wred_profile'] = wred_map['wred_profile'][14:-1]
91+
temp['wred_profile'] = wred_map['wred_profile']
9292
config_apply_list.append(temp)
9393
st.debug('port map data is: {}'.format(config_apply_list))
9494
for entry in config_apply_list:

0 commit comments

Comments
 (0)