Lines Matching +full:class +full:- +full:d

2 # SPDX-License-Identifier: GPL-2.0
9 class SkipTest(Exception):
13 class RandomValuePicker:
15 Class for storing shared buffer configuration. Can handle 3 different
19 - random size
22 - random pool number
23 - random threshold
26 - random threshold
37 # For threshold of 16, this works out to be about 12MB on Spectrum-1,
38 # and about 17MB on Spectrum-2.
67 return arr[random.randint(0, len(arr) - 1)]
93 class RecordValuePickerException(Exception):
97 class RecordValuePicker:
99 Class for storing shared buffer configuration. Can handle 2 different
135 print("TEST: %-80s [FAIL]" % test_name)
137 print("TEST: %-80s [ OK ]" % test_name)
140 class CommonItem(dict):
159 class CommonList(list):
172 class Pool(CommonItem):
181 class PoolList(CommonList):
186 d = run_json_cmd("devlink sb pool show -j")
188 for pooldict in d["pool"][dlname]:
230 class TcBind(CommonItem):
233 def __init__(self, port, d): argument
234 super(TcBind, self).__init__(d)
245 class TcBindList(CommonList):
250 d = run_json_cmd("devlink sb tc bind show -j -n")
254 if port.name not in d["tc_bind"] or len(d["tc_bind"][port.name]) == 0:
257 for tcbinddict in d["tc_bind"][port.name]:
285 log_test("tc bind {}-{} of sb {} set verification".format(tcbind["dlportname"],
304 class PortPool(CommonItem):
307 def __init__(self, port, d): argument
308 super(PortPool, self).__init__(d)
317 class PortPoolList(CommonList):
322 d = run_json_cmd("devlink sb port pool -j -n")
326 if port.name not in d["port_pool"] or len(d["port_pool"][port.name]) == 0:
329 for portpooldict in d["port_pool"][port.name]:
352 log_test("port pool {}-{} of sb {} set verification".format(portpool["dlportname"],
370 class Port:
375 class PortList(list):
380 d = run_json_cmd("devlink port show -j")
382 for name in d["port"]:
383 if name.find(dlname) == 0 and d["port"][name]["flavour"] == "physical":
389 devices_info = run_json_cmd("devlink -j dev info")["info"]
390 for d in devices_info:
391 if "mlxsw_spectrum" in devices_info[d]["driver"]:
392 return d
396 class UnavailableDevlinkNameException(Exception):