Skip to content
Merged
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
34 changes: 34 additions & 0 deletions ansible/group_vars/sonic/sku-sensors-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,40 @@ sensors_checks:
- adt7473-i2c-0-2e/+3.3V/in2_input
temp: []
psu_skips: {}

armhf-nokia_ixs7215_52x-r0:
alarms:
fan:
- adt7473-i2c-0-2e/rear fan 1/fan1_alarm
- adt7473-i2c-0-2e/rear fan 2/fan2_alarm
power:
- adt7473-i2c-0-2e/+3.3V/in2_alarm
temp:
- adt7473-i2c-0-2e/temp1/temp1_alarm
- adt7473-i2c-0-2e/temp1/temp1_fault
- adt7473-i2c-0-2e/Board Temp/temp2_alarm
- adt7473-i2c-0-2e/temp3/temp3_alarm
- adt7473-i2c-0-2e/temp3/temp3_fault
compares:
fan: []
power:
- - adt7473-i2c-0-2e/+3.3V/in2_input
- adt7473-i2c-0-2e/+3.3V/in2_max
temp:
- - adt7473-i2c-0-2e/temp1/temp1_input
- adt7473-i2c-0-2e/temp1/temp1_crit
- - adt7473-i2c-0-2e/Board Temp/temp2_input
- adt7473-i2c-0-2e/Board Temp/temp2_crit
- - adt7473-i2c-0-2e/temp3/temp3_input
- adt7473-i2c-0-2e/temp3/temp3_crit
non_zero:
fan:
- adt7473-i2c-0-2e/rear fan 1/fan1_input
- adt7473-i2c-0-2e/rear fan 2/fan2_input
power:
- adt7473-i2c-0-2e/+3.3V/in2_input
temp: []
psu_skips: {}

x86_64-juniper_qfx5210-r0:
alarms:
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/test/files/ptftests/dir_bcast_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def setUp(self):
self.setUpVlan(self.test_params['vlan_info'])
if self.test_params['testbed_type'] == 't0':
self.src_ports = range(1, 25) + range(28, 32)
if self.test_params['testbed_type'] == 't0-52':
self.src_ports = range(0, 52)
if self.test_params['testbed_type'] == 't0-64':
self.src_ports = range(0, 2) + range(4, 18) + range(20, 33) + range(36, 43) + range(48, 49) + range(52, 59)
if self.test_params['testbed_type'] == 't0-116':
Expand Down
24 changes: 12 additions & 12 deletions tests/common/platform/interface_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def parse_intf_status(lines):
return result


def check_interface_status(dut, asic_index, interfaces):
def check_interface_status(dut, asic_index, interfaces, xcvr_skip_list):
"""
@summary: Check the admin and oper status of the specified interfaces on DUT.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
Expand Down Expand Up @@ -68,10 +68,11 @@ def check_interface_status(dut, asic_index, interfaces):
return False

# Cross check the interface SFP presence status
check_presence_output = dut.command(check_intf_presence_command.format(intf))
presence_list = check_presence_output["stdout_lines"][2].split()
assert intf in presence_list, "Wrong interface name in the output: %s" % str(presence_list)
assert 'Present' in presence_list, "Status is not expected, presence status: %s" % str(presence_list)
if intf not in xcvr_skip_list:
check_presence_output = dut.command(check_intf_presence_command.format(intf))
presence_list = check_presence_output["stdout_lines"][2].split()
assert intf in presence_list, "Wrong interface name in the output: %s" % str(presence_list)
assert 'Present' in presence_list, "Status is not expected, presence status: %s" % str(presence_list)

logging.info("Check interface status using the interface_facts module")
intf_facts = dut.interface_facts(up_ports=mg_ports, namespace=namespace)["ansible_facts"]
Expand All @@ -83,27 +84,26 @@ def check_interface_status(dut, asic_index, interfaces):
return True

# This API to check the interface information actoss all front end ASIC's
def check_all_interface_information(dut, interfaces):
def check_all_interface_information(dut, interfaces, xcvr_skip_list):
for asic_index in dut.get_frontend_asic_ids():
# Get the interfaces pertaining to that asic
interface_list = get_port_map(dut, asic_index)
interfaces_per_asic = {k:v for k, v in interface_list.items() if k in interfaces}

if not all_transceivers_detected(dut, asic_index, interfaces_per_asic):
if not all_transceivers_detected(dut, asic_index, interfaces_per_asic, xcvr_skip_list):
logging.info("Not all transceivers are detected")
return False
if not check_interface_status(dut, asic_index, interfaces_per_asic):
if not check_interface_status(dut, asic_index, interfaces_per_asic, xcvr_skip_list):
logging.info("Not all interfaces are up")
return False

return True

# This API to check the interface information per asic.
def check_interface_information(dut, asic_index, interfaces):
if not all_transceivers_detected(dut, asic_index, interfaces):
def check_interface_information(dut, asic_index, interfaces, xcvr_skip_list):
if not all_transceivers_detected(dut, asic_index, interfaces, xcvr_skip_list):
logging.info("Not all transceivers are detected on asic %s" % asic_index)
return False
if not check_interface_status(dut, asic_index, interfaces):
if not check_interface_status(dut, asic_index, interfaces, xcvr_skip_list):
logging.info("Not all interfaces are up on asic %s" % asic_index)
return False

Expand Down
54 changes: 29 additions & 25 deletions tests/common/platform/transceiver_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""
import logging
import re
import json


def parse_transceiver_info(output_lines):
Expand Down Expand Up @@ -38,7 +37,7 @@ def parse_transceiver_dom_sensor(output_lines):
return result


def all_transceivers_detected(dut, asic_index, interfaces):
def all_transceivers_detected(dut, asic_index, interfaces, xcvr_skip_list):
"""
Check if transceiver information of all the specified interfaces have been detected.
"""
Expand All @@ -53,7 +52,7 @@ def all_transceivers_detected(dut, asic_index, interfaces):
return True


def check_transceiver_basic(dut, asic_index, interfaces):
def check_transceiver_basic(dut, asic_index, interfaces, xcvr_skip_list):
"""
@summary: Check whether all the specified interface are in TRANSCEIVER_INFO redis DB.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
Expand All @@ -66,10 +65,11 @@ def check_transceiver_basic(dut, asic_index, interfaces):
xcvr_info = dut.command(docker_cmd)
parsed_xcvr_info = parse_transceiver_info(xcvr_info["stdout_lines"])
for intf in interfaces:
assert intf in parsed_xcvr_info, "TRANSCEIVER INFO of %s is not found in DB" % intf
if intf not in xcvr_skip_list:
assert intf in parsed_xcvr_info, "TRANSCEIVER INFO of %s is not found in DB" % intf


def check_transceiver_details(dut, asic_index, interfaces):
def check_transceiver_details(dut, asic_index, interfaces, xcvr_skip_list):
"""
@summary: Check the detailed TRANSCEIVER_INFO content of all the specified interfaces.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
Expand All @@ -79,15 +79,16 @@ def check_transceiver_details(dut, asic_index, interfaces):
logging.info("Check detailed transceiver information of each connected port")
expected_fields = ["type", "hardware_rev", "serial", "manufacturer", "model"]
for intf in interfaces:
cmd = 'redis-cli -n 6 hgetall "TRANSCEIVER_INFO|%s"' % intf
docker_cmd = asichost.get_docker_cmd(cmd, "database")
port_xcvr_info = dut.command(docker_cmd)
for field in expected_fields:
assert port_xcvr_info["stdout"].find(field) >= 0, \
"Expected field %s is not found in %s while checking %s" % (field, port_xcvr_info["stdout"], intf)
if intf not in xcvr_skip_list:
cmd = 'redis-cli -n 6 hgetall "TRANSCEIVER_INFO|%s"' % intf
docker_cmd = asichost.get_docker_cmd(cmd, "database")
port_xcvr_info = dut.command(docker_cmd)
for field in expected_fields:
assert port_xcvr_info["stdout"].find(field) >= 0, \
"Expected field %s is not found in %s while checking %s" % (field, port_xcvr_info["stdout"], intf)


def check_transceiver_dom_sensor_basic(dut, asic_index, interfaces):
def check_transceiver_dom_sensor_basic(dut, asic_index, interfaces, xcvr_skip_list):
"""
@summary: Check whether all the specified interface are in TRANSCEIVER_DOM_SENSOR redis DB.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
Expand All @@ -100,10 +101,11 @@ def check_transceiver_dom_sensor_basic(dut, asic_index, interfaces):
xcvr_dom_sensor = dut.command(docker_cmd)
parsed_xcvr_dom_sensor = parse_transceiver_dom_sensor(xcvr_dom_sensor["stdout_lines"])
for intf in interfaces:
assert intf in parsed_xcvr_dom_sensor, "TRANSCEIVER_DOM_SENSOR of %s is not found in DB" % intf
if intf not in xcvr_skip_list:
assert intf in parsed_xcvr_dom_sensor, "TRANSCEIVER_DOM_SENSOR of %s is not found in DB" % intf


def check_transceiver_dom_sensor_details(dut, asic_index, interfaces):
def check_transceiver_dom_sensor_details(dut, asic_index, interfaces, xcvr_skip_list):
"""
@summary: Check the detailed TRANSCEIVER_DOM_SENSOR content of all the specified interfaces.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
Expand All @@ -114,21 +116,23 @@ def check_transceiver_dom_sensor_details(dut, asic_index, interfaces):
expected_fields = ["temperature", "voltage", "rx1power", "rx2power", "rx3power", "rx4power", "tx1bias",
"tx2bias", "tx3bias", "tx4bias", "tx1power", "tx2power", "tx3power", "tx4power"]
for intf in interfaces:
cmd = 'redis-cli -n 6 hgetall "TRANSCEIVER_DOM_SENSOR|%s"' % intf
docker_cmd = asichost.get_docker_cmd(cmd, "database")
port_xcvr_dom_sensor = dut.command(docker_cmd)
for field in expected_fields:
assert port_xcvr_dom_sensor["stdout"].find(field) >= 0, \
"Expected field %s is not found in %s while checking %s" % (field, port_xcvr_dom_sensor["stdout"], intf)
if intf not in xcvr_skip_list:
cmd = 'redis-cli -n 6 hgetall "TRANSCEIVER_DOM_SENSOR|%s"' % intf
docker_cmd = asichost.get_docker_cmd(cmd, "database")
port_xcvr_dom_sensor = dut.command(docker_cmd)
for field in expected_fields:
assert port_xcvr_dom_sensor["stdout"].find(field) >= 0, \
"Expected field %s is not found in %s while checking %s" % (
field, port_xcvr_dom_sensor["stdout"], intf)


def check_transceiver_status(dut, asic_index, interfaces):
def check_transceiver_status(dut, asic_index, interfaces, xcvr_skip_list):
"""
@summary: Check transceiver information of all the specified interfaces in redis DB.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
@param interfaces: List of interfaces that need to be checked.
"""
check_transceiver_basic(dut, asic_index, interfaces)
check_transceiver_details(dut, asic_index, interfaces)
check_transceiver_dom_sensor_basic(dut, asic_index, interfaces)
check_transceiver_dom_sensor_details(dut, asic_index, interfaces)
check_transceiver_basic(dut, asic_index, interfaces, xcvr_skip_list)
check_transceiver_details(dut, asic_index, interfaces, xcvr_skip_list)
check_transceiver_dom_sensor_basic(dut, asic_index, interfaces, xcvr_skip_list)
check_transceiver_dom_sensor_details(dut, asic_index, interfaces, xcvr_skip_list)
6 changes: 6 additions & 0 deletions tests/fib/test_fib.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ def hash_keys(duthost):
if duthost.facts['asic_type'] in ["barefoot"]:
if 'ingress-port' in hash_keys:
hash_keys.remove('ingress-port')
# removing ingress-port and ip-proto from hash_keys not supported by Marvell SAI
if duthost.facts['platform'] in ['armhf-nokia_ixs7215_52x-r0']:
Comment thread
rawal01 marked this conversation as resolved.
Outdated
if 'ip-proto' in hash_keys:
hash_keys.remove('ip-proto')
if 'ingress-port' in hash_keys:
hash_keys.remove('ingress-port')

return hash_keys

Expand Down
2 changes: 1 addition & 1 deletion tests/ipfwd/test_dir_bcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def test_dir_bcast(duthosts, rand_one_dut_hostname, ptfhost, tbinfo, fib):
duthost = duthosts[rand_one_dut_hostname]
support_testbed_types = frozenset(['t0', 't0-16', 't0-56', 't0-64', 't0-64-32', 't0-116'])
support_testbed_types = frozenset(['t0', 't0-16', 't0-52', 't0-56', 't0-64', 't0-64-32', 't0-116'])
testbed_type = tbinfo['topo']['name']
if testbed_type not in support_testbed_types:
pytest.skip("Not support given test bed type %s" % testbed_type)
Expand Down
24 changes: 23 additions & 1 deletion tests/platform_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import pytest

import json
import os
import logging
from tests.common.fixtures.advanced_reboot import get_advanced_reboot
from .args.advanced_reboot_args import add_advanced_reboot_args
from .args.cont_warm_reboot_args import add_cont_warm_reboot_args
Expand All @@ -14,6 +16,26 @@ def skip_on_simx(duthosts, rand_one_dut_hostname):
if "simx" in platform:
pytest.skip('skipped on this platform: {}'.format(platform))

@pytest.fixture(scope="module")
def xcvr_skip_list(duthosts, rand_one_dut_hostname):
duthost = duthosts[rand_one_dut_hostname]
platform = duthost.facts['platform']
hwsku = duthost.facts['hwsku']
f_path = os.path.join('/usr/share/sonic/device', platform, hwsku, 'hwsku.json')
intf_skip_list = []
try:
out = duthost.command("cat {}".format(f_path))
hwsku_info = json.loads(out["stdout"])
for int_n in hwsku_info['interfaces']:
if hwsku_info['interfaces'][int_n]['port_type'] == "RJ45":
intf_skip_list.append(int_n)

except Exception:
# hwsku.json does not exist will return empty skip list
logging.debug(
"hwsku.json absent or port_type for interfaces not included for hwsku {}".format(hwsku))

return intf_skip_list

@pytest.fixture()
def bring_up_dut_interfaces(request, duthosts, rand_one_dut_hostname, tbinfo):
Expand Down
Loading