Skip to content

Commit

Permalink
[xcvrd] change firmware information fields name inside MUX_CABLE_INFO…
Browse files Browse the repository at this point in the history
… table for Y cable (sonic-net#165)

This PR fixes the naming convention for firmware related fields for Y cable.
In particular all the fields are now named as tor_self and tor_peer in place of tor1 and tor 2

Signed-off-by: vaibhav-dahiya [email protected]

Description
This PR fixes the naming convention for firmware related fields for Y cable.
In particular all the fields are now named as tor_self and tor_peer in place of tor1 and tor 2

Motivation and Context
Required by telemetry team as part of their initial schema

Signed-off-by: vaibhav-dahiya <[email protected]>
  • Loading branch information
vdahiya12 authored Mar 22, 2021
1 parent cfa600f commit 260cf2d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 42 deletions.
40 changes: 20 additions & 20 deletions sonic-xcvrd/tests/test_xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,26 +252,26 @@ def test_init_port_sfp_status_tbl(self):
'commit_slot2_nic': 'False',
'empty_slot1_nic': 'True',
'empty_slot2_nic': 'False',
'build_slot1_tor1': 'MS',
'build_slot2_tor1': 'MS',
'version_slot1_tor1': '1.7',
'version_slot2_tor1': '1.7',
'run_slot1_tor1': 'True',
'run_slot2_tor1': 'False',
'commit_slot1_tor1': 'True',
'commit_slot2_tor1': 'False',
'empty_slot1_tor1': 'True',
'empty_slot2_tor1': 'False',
'build_slot1_tor2': 'MS',
'build_slot2_tor2': 'MS',
'version_slot1_tor2': '1.7',
'version_slot2_tor2': '1.7',
'run_slot1_tor2': 'True',
'run_slot2_tor2': 'False',
'commit_slot1_tor2': 'True',
'commit_slot2_tor2': 'False',
'empty_slot1_tor2': 'True',
'empty_slot2_tor2': 'False'}))
'build_slot1_tor_self': 'MS',
'build_slot2_tor_self': 'MS',
'version_slot1_tor_self': '1.7',
'version_slot2_tor_self': '1.7',
'run_slot1_tor_self': 'True',
'run_slot2_tor_self': 'False',
'commit_slot1_tor_self': 'True',
'commit_slot2_tor_self': 'False',
'empty_slot1_tor_self': 'True',
'empty_slot2_tor_self': 'False',
'build_slot1_tor_peer': 'MS',
'build_slot2_tor_peer': 'MS',
'version_slot1_tor_peer': '1.7',
'version_slot2_tor_peer': '1.7',
'run_slot1_tor_peer': 'True',
'run_slot2_tor_peer': 'False',
'commit_slot1_tor_peer': 'True',
'commit_slot2_tor_peer': 'False',
'empty_slot1_tor_peer': 'True',
'empty_slot2_tor_peer': 'False'}))
def test_post_port_mux_info_to_db(self):
logical_port_name = "Ethernet0"
mux_tbl = Table("STATE_DB", y_cable_helper.MUX_CABLE_INFO_TABLE)
Expand Down
48 changes: 26 additions & 22 deletions sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,12 @@ def get_muxcable_info(physical_port, logical_port_name):
mux_info_dict["link_status_nic"] = "down"

get_firmware_dict(physical_port, 0, "nic", mux_info_dict)
get_firmware_dict(physical_port, 1, "tor1", mux_info_dict)
get_firmware_dict(physical_port, 2, "tor2", mux_info_dict)
if read_side == 1:
get_firmware_dict(physical_port, 1, "tor_self", mux_info_dict)
get_firmware_dict(physical_port, 2, "tor_peer", mux_info_dict)
else:
get_firmware_dict(physical_port, 1, "tor_peer", mux_info_dict)
get_firmware_dict(physical_port, 2, "tor_self", mux_info_dict)

res = y_cable.get_internal_voltage_temp(physical_port)

Expand Down Expand Up @@ -885,26 +889,26 @@ def post_port_mux_info_to_db(logical_port_name, table):
('commit_slot2_nic', str(mux_info_dict["commit_slot2_nic"])),
('empty_slot1_nic', str(mux_info_dict["empty_slot1_nic"])),
('empty_slot2_nic', str(mux_info_dict["empty_slot2_nic"])),
('build_slot1_tor1', str(mux_info_dict["build_slot1_tor1"])),
('build_slot2_tor1', str(mux_info_dict["build_slot2_tor1"])),
('version_slot1_tor1', str(mux_info_dict["version_slot1_tor1"])),
('version_slot2_tor1', str(mux_info_dict["version_slot2_tor1"])),
('run_slot1_tor1', str(mux_info_dict["run_slot1_tor1"])),
('run_slot2_tor1', str(mux_info_dict["run_slot2_tor1"])),
('commit_slot1_tor1', str(mux_info_dict["commit_slot1_tor1"])),
('commit_slot2_tor1', str(mux_info_dict["commit_slot2_tor1"])),
('empty_slot1_tor1', str(mux_info_dict["empty_slot1_tor1"])),
('empty_slot2_tor1', str(mux_info_dict["empty_slot2_tor1"])),
('build_slot1_tor2', str(mux_info_dict["build_slot1_tor2"])),
('build_slot2_tor2', str(mux_info_dict["build_slot2_tor2"])),
('version_slot1_tor2', str(mux_info_dict["version_slot1_tor2"])),
('version_slot2_tor2', str(mux_info_dict["version_slot2_tor2"])),
('run_slot1_tor2', str(mux_info_dict["run_slot1_tor2"])),
('run_slot2_tor2', str(mux_info_dict["run_slot2_tor2"])),
('commit_slot1_tor2', str(mux_info_dict["commit_slot1_tor2"])),
('commit_slot2_tor2', str(mux_info_dict["commit_slot2_tor2"])),
('empty_slot1_tor2', str(mux_info_dict["empty_slot1_tor2"])),
('empty_slot2_tor2', str(mux_info_dict["empty_slot2_tor2"]))
('build_slot1_tor_self', str(mux_info_dict["build_slot1_tor_self"])),
('build_slot2_tor_self', str(mux_info_dict["build_slot2_tor_self"])),
('version_slot1_tor_self', str(mux_info_dict["version_slot1_tor_self"])),
('version_slot2_tor_self', str(mux_info_dict["version_slot2_tor_self"])),
('run_slot1_tor_self', str(mux_info_dict["run_slot1_tor_self"])),
('run_slot2_tor_self', str(mux_info_dict["run_slot2_tor_self"])),
('commit_slot1_tor_self', str(mux_info_dict["commit_slot1_tor_self"])),
('commit_slot2_tor_self', str(mux_info_dict["commit_slot2_tor_self"])),
('empty_slot1_tor_self', str(mux_info_dict["empty_slot1_tor_self"])),
('empty_slot2_tor_self', str(mux_info_dict["empty_slot2_tor_self"])),
('build_slot1_tor_peer', str(mux_info_dict["build_slot1_tor_peer"])),
('build_slot2_tor_peer', str(mux_info_dict["build_slot2_tor_peer"])),
('version_slot1_tor_peer', str(mux_info_dict["version_slot1_tor_peer"])),
('version_slot2_tor_peer', str(mux_info_dict["version_slot2_tor_peer"])),
('run_slot1_tor_peer', str(mux_info_dict["run_slot1_tor_peer"])),
('run_slot2_tori_peer', str(mux_info_dict["run_slot2_tor_peer"])),
('commit_slot1_tor_peer', str(mux_info_dict["commit_slot1_tor_peer"])),
('commit_slot2_tor_peer', str(mux_info_dict["commit_slot2_tor_peer"])),
('empty_slot1_tor_peer', str(mux_info_dict["empty_slot1_tor_peer"])),
('empty_slot2_tor_peer', str(mux_info_dict["empty_slot2_tor_peer"]))
])
table.set(logical_port_name, fvs)
else:
Expand Down

0 comments on commit 260cf2d

Please sign in to comment.