Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 16582f32c14d6b634e17702bb0e0d15250482016
Author: Ubuntu <isl@isl-dev-6.gccxvha3jmperpu0bogtupfduf.jx.internal.cloudapp.net>
Date:   Thu Jun 23 18:23:41 2022 +0000

    add parameter

commit 684ee051b91bb9ba1fa9adedef4abcbc8354a5c6
Author: Ubuntu <isl@isl-dev-6.gccxvha3jmperpu0bogtupfduf.jx.internal.cloudapp.net>
Date:   Thu Jun 23 18:15:45 2022 +0000

    lane swap

commit fc69fe93d6b8769e4e8737a5d39d75a80f90a956
Author: Ubuntu <isl@isl-dev-6.gccxvha3jmperpu0bogtupfduf.jx.internal.cloudapp.net>
Date:   Wed Jun 22 19:24:34 2022 +0000

    expect success for replaces lanes
  • Loading branch information
isabelmsft committed Sep 8, 2022
1 parent a7f3015 commit 3cef9af
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions tests/generic_config_updater/test_eth_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,34 @@ def test_remove_lanes(duthost, ensure_dut_readiness):
delete_tmpfile(duthost, tmpfile)


@pytest.mark.skip(reason="Bypass as it is blocking submodule update")
def test_replace_lanes(duthost, ensure_dut_readiness):
cur_lanes = check_interface_status(duthost, "Lanes")
cur_lanes = cur_lanes.split(",")
cur_lanes.sort()
update_lanes = cur_lanes
update_lanes[-1] = str(int(update_lanes[-1]) + 1)
update_lanes = ",".join(update_lanes)
config_facts = duthost.get_running_config_facts()
for port in config_facts['PORT'].keys():
if port != "Ethernet0":
swap_port = port
break
eth0_cur_lanes = check_interface_status(duthost, "Lanes", "Ethernet0").split(",")
swap_port_cur_lanes = check_interface_status(duthost, "Lanes", swap_port).split(",")
eth0_cur_lanes.sort()
swap_port_cur_lanes.sort()

tmp = eth0_cur_lanes[-1]
eth0_cur_lanes[-1] = swap_port_cur_lanes[-1]
swap_port_cur_lanes[-1] = tmp

eth0_update_lanes = ",".join(eth0_cur_lanes)
swap_port_update_lanes = ",".join(swap_port_cur_lanes)

json_patch = [
{
"op": "replace",
"path": "/PORT/Ethernet0/lanes",
"value": "{}".format(update_lanes)
"value": "{}".format(eth0_update_lanes)
},
{
"op": "replace",
"path": "/PORT/{}/lanes".format(swap_port),
"value": "{}".format(swap_port_update_lanes)
}
]

Expand All @@ -115,7 +130,7 @@ def test_replace_lanes(duthost, ensure_dut_readiness):

try:
output = apply_patch(duthost, json_data=json_patch, dest_file=tmpfile)
expect_op_failure(output)
expect_op_success(duthost, output)
finally:
delete_tmpfile(duthost, tmpfile)

Expand Down

0 comments on commit 3cef9af

Please sign in to comment.