Skip to content

Commit a2b987b

Browse files
authored
[vstest]: fix test_speed.py (sonic-net#780)
now, Force10-S6000 vs env has port speed set in port_config.ini. Thus, dynamic pg profile is added to the initial list. Extend the test to support this new scenario. Signed-off-by: Guohan Lu <gulv@microsoft.com>
1 parent cef4bd0 commit a2b987b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_speed.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
class TestSpeedSet(object):
1717
num_ports = 32
1818
def test_SpeedAndBufferSet(self, dvs, testlog):
19-
speed_list = ['50000', '25000', '40000', '10000', '100000']
19+
configured_speed_list = ['40000']
20+
speed_list = ['10000', '25000', '40000', '50000', '100000']
2021

2122
cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0)
2223
adb = swsscommon.DBConnector(1, dvs.redis_sock, 0)
@@ -28,11 +29,11 @@ def test_SpeedAndBufferSet(self, dvs, testlog):
2829

2930
buffer_profiles = cfg_buffer_profile_table.getKeys()
3031
expected_buffer_profiles_num = len(buffer_profiles)
31-
# buffers.json used for the test defines 4 static profiles:
32-
# "ingress_lossless_profile"
32+
# buffers_config.j2 used for the test defines 3 static profiles and 1 dynamic profiles:
3333
# "ingress_lossy_profile"
3434
# "egress_lossless_profile"
3535
# "egress_lossy_profile"
36+
# "pg_lossless_40000_300m_profile"
3637
# check if they get the DB
3738
assert expected_buffer_profiles_num == 4
3839
# and if they were successfully created on ASIC
@@ -61,7 +62,10 @@ def test_SpeedAndBufferSet(self, dvs, testlog):
6162
assert num_set == self.num_ports
6263

6364
# check number of created profiles
64-
expected_buffer_profiles_num += 1 # new speed should add new PG profile
65+
if speed not in configured_speed_list:
66+
expected_buffer_profiles_num += 1 # new speed should add new PG profile
67+
configured_speed_list.append(speed)
68+
6569
current_buffer_profiles = cfg_buffer_profile_table.getKeys()
6670
assert len(current_buffer_profiles) == expected_buffer_profiles_num
6771
# make sure the same number of profiles are created on ASIC

0 commit comments

Comments
 (0)