Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/common/devices/sonic_asic.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def is_it_backend(self):
if self.sonichost.is_multi_asic:
sub_role_cmd = 'sudo sonic-cfggen -d -v DEVICE_METADATA.localhost.sub_role -n {}'.format(self.namespace)
sub_role = self.sonichost.shell(sub_role_cmd)["stdout_lines"][0].decode("utf-8")
if sub_role is not None and sub_role.lower() == 'backend':
if sub_role is not None and (sub_role.lower() == 'backend' or sub_role.lower == 'fabric'):
return True
return False

Expand Down
21 changes: 14 additions & 7 deletions tests/test_pretest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,21 @@ def collect_dut_info(dut):
asic_services = defaultdict(list)
for service in dut.sonichost.DEFAULT_ASIC_SERVICES:
# for multi ASIC randomly select one frontend ASIC
# and one backend ASIC
# or one backend ASIC whichever is available
# in sonic chassis -
# the supervisor will only have fabric or backend asics
# the linecards will only have frontend asics
if dut.sonichost.is_multi_asic:
fe = random.choice(front_end_asics)
be = random.choice(back_end_asics)
asic_services[service] = [
dut.get_docker_name(service, asic_index=fe),
dut.get_docker_name(service, asic_index=be)
]
if front_end_asics:
fe = random.choice(front_end_asics)
asic_services[service].append(
dut.get_docker_name(service, asic_index=fe)
)
if back_end_asics:
be = random.choice(back_end_asics)
asic_services[service].append(
dut.get_docker_name(service, asic_index=be)
)

dut_info = {
"intf_status": status,
Expand Down