Skip to content

Commit

Permalink
Get initial speed from ASIC DB (sonic-net#1390)
Browse files Browse the repository at this point in the history
Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
Co-authored-by: Vasant Patil <36455926+vasant17@users.noreply.github.com>
  • Loading branch information
samaity and vasant17 authored Aug 12, 2020
1 parent b9146b9 commit 4110acf
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/test_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TestSpeedSet:
NUM_PORTS = 32

def test_SpeedAndBufferSet(self, dvs, testlog):
configured_speed_list = ["40000"]
configured_speed_list = []
speed_list = ["10000", "25000", "40000", "50000", "100000"]

# buffers_config.j2 is used for the test and defines 3 static profiles and 1 dynamic profile:
Expand All @@ -20,6 +20,21 @@ def test_SpeedAndBufferSet(self, dvs, testlog):
cdb = dvs.get_config_db()
adb = dvs.get_asic_db()

# Get speed from the first port we hit in ASIC DB port walk, and
# assume that its the initial configured speed for all ports, and
# as new port configuration file i.e. 'platform.json' guarantees
# 100G as initial port speed for all ports and the dynamic buffer
# profile has already been created for it.
asic_port_records = adb.get_keys("ASIC_STATE:SAI_OBJECT_TYPE_PORT")
for k in asic_port_records:
fvs = adb.get_entry("ASIC_STATE:SAI_OBJECT_TYPE_PORT", k)
if "SAI_PORT_ATTR_SPEED" in fvs.keys():
configured_speed_list.append(fvs["SAI_PORT_ATTR_SPEED"])
break

if configured_speed_list:
break

# Check if the buffer profiles make it to Config DB
cdb.wait_for_n_keys("BUFFER_PROFILE", num_buffer_profiles)

Expand Down

0 comments on commit 4110acf

Please sign in to comment.