Skip to content

Commit

Permalink
Merge branch '202305' of https://github.com/sonic-net/sonic-utilities
Browse files Browse the repository at this point in the history
…into 202305
  • Loading branch information
mssonicbld committed Mar 1, 2024
2 parents 123f775 + 514f432 commit dd93326
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sfputil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from utilities_common.sfp_helper import covert_application_advertisement_to_output_string
from utilities_common.sfp_helper import QSFP_DATA_MAP
from tabulate import tabulate
from utilities_common.general import load_db_config

VERSION = '3.0'

Expand Down Expand Up @@ -548,6 +549,7 @@ def load_sfputilhelper():


def load_port_config():
load_db_config()
try:
if multi_asic.is_multi_asic():
# For multi ASIC platforms we pass DIR of port_config_file_path and the number of asics
Expand Down
12 changes: 11 additions & 1 deletion tests/sfputil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,4 +999,14 @@ def test_target_firmware(self, mock_chassis):
assert result.output == 'Target Mode set failed!\n'
assert result.exit_code == EXIT_FAIL


@patch('sfputil.main.multi_asic.is_multi_asic')
@patch('sfputil.main.platform_sfputil', MagicMock())
@patch('sfputil.main.device_info.get_paths_to_platform_and_hwsku_dirs',
MagicMock(return_value=(None, None)))
@patch('sfputil.main.device_info.get_path_to_port_config_file', MagicMock(return_value=('')))
def test_load_port_config(self, mock_is_multi_asic):
mock_is_multi_asic.return_value = True
assert sfputil.load_port_config() == True

mock_is_multi_asic.return_value = False
assert sfputil.load_port_config() == True

0 comments on commit dd93326

Please sign in to comment.