From 8af80570b74ed60ac89e42ac9c34fee1f789cbaf Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Fri, 13 Dec 2019 14:10:42 -0800 Subject: [PATCH 1/8] DPB Breakout Cli Test with proper setup Signed-off-by: Sangita Maity --- platform/vs/docker-sonic-vs/Dockerfile.j2 | 5 +- platform/vs/docker-sonic-vs/hwsku.json | 100 ++++++++ platform/vs/docker-sonic-vs/platform.json | 196 ++++++++++++++++ .../sample_output/sample_new_port_config.json | 213 ++++++++++++++++++ .../vs/tests/breakout/test_breakout_cli.py | 148 ++++++++++++ 5 files changed, 661 insertions(+), 1 deletion(-) create mode 100644 platform/vs/docker-sonic-vs/hwsku.json create mode 100644 platform/vs/docker-sonic-vs/platform.json create mode 100644 platform/vs/tests/breakout/sample_output/sample_new_port_config.json create mode 100755 platform/vs/tests/breakout/test_breakout_cli.py diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 3adab568bc8a..47c2f4fe95a1 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -46,7 +46,8 @@ RUN apt-get install -y net-tools \ python-scapy \ conntrack \ iptables \ - python3-pip + python3-pip \ + jq RUN pip install setuptools RUN pip install py2_ipaddress @@ -127,6 +128,8 @@ COPY ["files/arp_update", "/usr/bin/"] COPY ["files/buffers_config.j2", "files/qos_config.j2", "/usr/share/sonic/templates/"] COPY ["files/sonic_version.yml", "/etc/sonic/"] COPY ["database_config.json", "/etc/default/sonic-db/"] +COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] +COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"] # Workaround the tcpdump issue RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump diff --git a/platform/vs/docker-sonic-vs/hwsku.json b/platform/vs/docker-sonic-vs/hwsku.json new file mode 100644 index 000000000000..daaa5625f3f0 --- /dev/null +++ b/platform/vs/docker-sonic-vs/hwsku.json @@ -0,0 +1,100 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet8": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet12": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet16": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet20": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet24": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet28": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet32": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet36": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet40": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet44": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet48": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet52": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet56": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet60": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet64": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet68": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet72": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet76": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet80": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet84": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet88": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet92": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet96": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet100": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet104": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet108": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet112": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet116": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet120": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet124": { + "default_brkout_mode": "1x100G[40G]" + } + } +} diff --git a/platform/vs/docker-sonic-vs/platform.json b/platform/vs/docker-sonic-vs/platform.json new file mode 100644 index 000000000000..c9f5982ca938 --- /dev/null +++ b/platform/vs/docker-sonic-vs/platform.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "Ethernet0": { + "index": "0,0,0,0", + "lanes": "25,26,27,28", + "alias_at_lanes": "Eth0/1,Eth0/2,Eth0/3,Eth0/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet4": { + "index": "1,1,1,1", + "lanes": "29,30,31,32", + "alias_at_lanes": "Eth1/1,Eth1/2,Eth1/3,Eth1/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet8": { + "index": "2,2,2,2", + "lanes": "33,34,35,36", + "alias_at_lanes": "Eth2/1,Eth2/2,Eth2/3,Eth2/4", + "breakout_modes": "1x100G[40G],2x50G,2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet12": { + "index": "3,3,3,3", + "lanes": "37,38,39,40", + "alias_at_lanes": "Eth3/1,Eth3/2,Eth3/3,Eth3/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet16": { + "index": "4,4,4,4", + "lanes": "45,46,47,48", + "alias_at_lanes": "Eth4/1,Eth4/2,Eth4/3,Eth4/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet20": { + "index": "5,5,5,5", + "lanes": "41,42,43,44", + "alias_at_lanes": "Eth5/1,Eth5/2,Eth5/3,Eth5/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet24": { + "index": "6,6,6,6", + "lanes": "1,2,3,4", + "alias_at_lanes": "Eth6/1,Eth6/2,Eth6/3,Eth6/4", + "breakout_modes": "1x100G[40G],4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet28": { + "index": "7,7,7,7", + "lanes": "5,6,7,8", + "alias_at_lanes": "Eth7/1,Eth7/2,Eth7/3,Eth7/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet32": { + "index": "8,8,8,8", + "lanes": "13,14,15,16", + "alias_at_lanes": "Eth8/1,Eth8/2,Eth8/3,Eth8/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet36": { + "index": "9,9,9,9", + "lanes": "9,10,11,12", + "alias_at_lanes": "Eth9/1,Eth9/2,Eth9/3,Eth9/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet40": { + "index": "10,10,10,10", + "lanes": "17,18,19,20", + "alias_at_lanes": "Eth10/1,Eth10/2,Eth10/3,Eth10/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet44": { + "index": "11,11,11,11", + "lanes": "21,22,23,24", + "alias_at_lanes": "Eth11/1,Eth11/2,Eth11/3,Eth11/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet48": { + "index": "12,12,12,12", + "lanes": "53,54,55,56", + "alias_at_lanes": "Eth12/1,Eth12/2,Eth12/3,Eth12/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet52": { + "index": "13,13,13,13", + "lanes": "49,50,51,52", + "alias_at_lanes": "Eth13/1,Eth13/2,Eth13/3,Eth13/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet56": { + "index": "14,14,14,14", + "lanes": "57,58,59,60", + "alias_at_lanes": "Eth14/1,Eth14/2,Eth14/3,Eth14/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet60": { + "index": "15,15,15,15", + "lanes": "61,62,63,64", + "alias_at_lanes": "Eth15/1,Eth15/2,Eth15/3,Eth15/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet64": { + "index": "16,16,16,16", + "lanes": "69,70,71,72", + "alias_at_lanes": "Eth16/1,Eth16/2,Eth16/3,Eth16/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet68": { + "index": "17,17,17,17", + "lanes": "65,66,67,68", + "alias_at_lanes": "Eth17/1,Eth17/2,Eth17/3,Eth17/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet72": { + "index": "18,18,18,18", + "lanes": "73,74,75,76", + "alias_at_lanes": "Eth18/1,Eth18/2,Eth18/3,Eth18/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet76": { + "index": "19,19,19,19", + "lanes": "77,78,79,80", + "alias_at_lanes": "Eth19/1,Eth19/2,Eth19/3,Eth19/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet80": { + "index": "20,20,20,20", + "lanes": "109,110,111,112", + "alias_at_lanes": "Eth20/1,Eth20/2,Eth20/3,Eth20/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet84": { + "index": "21,21,21,21", + "lanes": "105,106,107,108", + "alias_at_lanes": "Eth21/1,Eth21/2,Eth21/3,Eth21/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet88": { + "index": "22,22,22,22", + "lanes": "113,114,115,116", + "alias_at_lanes": "Eth22/1,Eth22/2,Eth22/3,Eth22/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet92": { + "index": "23,23,23,23", + "lanes": "117,118,119,120", + "alias_at_lanes": "Eth23/1,Eth23/2,Eth23/3,Eth23/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet96": { + "index": "24,24,24,24", + "lanes": "125,126,127,128", + "alias_at_lanes": "Eth24/1,Eth24/2,Eth24/3,Eth24/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet100": { + "index": "25,25,25,25", + "lanes": "121,122,123,124", + "alias_at_lanes": "Eth25/1,Eth25/2,Eth25/3,Eth25/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet104": { + "index": "26,26,26,26", + "lanes": "81,82,83,84", + "alias_at_lanes": "Eth26/1,Eth26/2,Eth26/3,Eth26/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet108": { + "index": "27,27,27,27", + "lanes": "85,86,87,88", + "alias_at_lanes": "Eth27/1,Eth27/2,Eth27/3,Eth27/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet112": { + "index": "28,28,28,28", + "lanes": "93,94,95,96", + "alias_at_lanes": "Eth28/1,Eth28/2,Eth28/3,Eth28/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet116": { + "index": "29,29,29,29", + "lanes": "89,90,91,92", + "alias_at_lanes": "Eth29/1,Eth29/2,Eth29/3,Eth29/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet120": { + "index": "30,30,30,30", + "lanes": "101,102,103,104", + "alias_at_lanes": "Eth30/1,Eth30/2,Eth30/3,Eth30/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet124": { + "index": "31,31,31,31", + "lanes": "97,98,99,100", + "alias_at_lanes": "Eth31/1,Eth31/2,Eth31/3,Eth31/4", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + } + } +} diff --git a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json new file mode 100644 index 000000000000..13dcc096376d --- /dev/null +++ b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json @@ -0,0 +1,213 @@ +{ + "Ethernet0_2x50G": { + "Ethernet2": { + "alias": "Eth0/3", + "admin_status": "up", + "lanes": "27,28", + "speed": "50000", + "index": "0" + }, + "Ethernet0": { + "alias": "Eth0/1", + "admin_status": "up", + "lanes": "25,26", + "speed": "50000", + "index": "0" + } + }, + "Ethernet0_1x100G": { + "Ethernet0": { + "alias": "Eth0/1", + "admin_status": "up", + "lanes": "25,26,27,28", + "speed": "100000", + "index": "0" + } + }, + "Ethernet0_4x25G": { + "Ethernet2": { + "alias": "Eth0/3", + "admin_status": "up", + "lanes": "27", + "speed": "25000", + "index": "0" + }, + "Ethernet3": { + "alias": "Eth0/4", + "admin_status": "up", + "lanes": "28", + "speed": "25000", + "index": "0" + }, + "Ethernet0": { + "alias": "Eth0/1", + "admin_status": "up", + "lanes": "25", + "speed": "25000", + "index": "0" + }, + "Ethernet1": { + "alias": "Eth0/2", + "admin_status": "up", + "lanes": "26", + "speed": "25000", + "index": "0" + } + }, + "Ethernet0_2x25G_1x50G": { + "Ethernet2": { + "alias": "Eth0/3", + "admin_status": "up", + "lanes": "27,28", + "speed": "50000", + "index": "0" + }, + "Ethernet0": { + "alias": "Eth0/1", + "admin_status": "up", + "lanes": "25", + "speed": "25000", + "index": "0" + }, + "Ethernet1": { + "alias": "Eth0/2", + "admin_status": "up", + "lanes": "26", + "speed": "25000", + "index": "0" + } + }, + "Ethernet0_1x50G_2x25G": { + "Ethernet2": { + "alias": "Eth0/3", + "admin_status": "up", + "lanes": "27", + "speed": "25000", + "index": "0" + }, + "Ethernet3": { + "alias": "Eth0/4", + "admin_status": "up", + "lanes": "28", + "speed": "25000", + "index": "0" + }, + "Ethernet0": { + "alias": "Eth0/1", + "admin_status": "up", + "lanes": "25,26", + "speed": "50000", + "index": "0" + } + }, + "Ethernet4_4x25G": { + "Ethernet6": { + "alias": "Eth1/3", + "admin_status": "up", + "lanes": "31", + "speed": "25000", + "index": "1" + }, + "Ethernet7": { + "alias": "Eth1/4", + "admin_status": "up", + "lanes": "32", + "speed": "25000", + "index": "1" + }, + "Ethernet4": { + "alias": "Eth1/1", + "admin_status": "up", + "lanes": "29", + "speed": "25000", + "index": "1" + }, + "Ethernet5": { + "alias": "Eth1/2", + "admin_status": "up", + "lanes": "30", + "speed": "25000", + "index": "1" + } + }, + "Ethernet4_2x50G": { + "Ethernet6": { + "alias": "Eth1/3", + "admin_status": "up", + "lanes": "31,32", + "speed": "50000", + "index": "1" + }, + "Ethernet4": { + "alias": "Eth1/1", + "admin_status": "up", + "lanes": "29,30", + "speed": "50000", + "index": "1" + } + }, + "Ethernet8_2x50G": { + "Ethernet8": { + "alias": "Eth2/1", + "admin_status": "up", + "lanes": "33,34", + "speed": "50000", + "index": "2" + }, + "Ethernet10": { + "alias": "Eth2/3", + "admin_status": "up", + "lanes": "35,36", + "speed": "50000", + "index": "2" + } + }, + "Ethernet8_1x50G_2x25G": { + "Ethernet10": { + "alias": "Eth2/3", + "admin_status": "up", + "lanes": "35", + "speed": "25000", + "index": "2" + }, + "Ethernet11": { + "alias": "Eth2/4", + "admin_status": "up", + "lanes": "36", + "speed": "25000", + "index": "2" + } + }, + "Ethernet8_2x25G_1x50G": { + "Ethernet8": { + "alias": "Eth2/1", + "admin_status": "up", + "lanes": "33", + "speed": "25000", + "index": "2" + }, + "Ethernet9": { + "alias": "Eth2/2", + "admin_status": "up", + "lanes": "34", + "speed": "25000", + "index": "2" + }, + "Ethernet10": { + "alias": "Eth2/3", + "admin_status": "up", + "lanes": "35,36", + "speed": "50000", + "index": "2" + } + }, + "Ethernet8_1x100G": { + "Ethernet8": { + "alias": "Eth2/1", + "admin_status": "up", + "lanes": "33,34,35,36", + "speed": "100000", + "index": "2" + } + } +} diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py new file mode 100755 index 000000000000..e36fefaf5bf2 --- /dev/null +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -0,0 +1,148 @@ +from swsscommon import swsscommon +import time +import os +import json +import ast +import pytest +import collections + +@pytest.mark.usefixtures('dpb_setup_fixture') +class TestBreakoutCli(object): + def setup_db(self, dvs): + self.cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0) + + def read_Json(self, dvs): + test_dir = os.path.dirname(os.path.realpath(__file__)) + sample_output_file = os.path.join(test_dir, 'sample_output', 'sample_new_port_config.json') + fh = open(sample_output_file, 'rb') + fh_data = json.load(fh) + fh.close() + + if not fh_data: + return False + expected = ast.literal_eval(json.dumps(fh_data)) + return expected + + def breakout(self, dvs, interface, brkout_mode): + (exitcode, result) = dvs.runcmd("config interface breakout {} {} -y".format(interface, brkout_mode)) + + if result.strip("\n")[0] == "[ERROR] Breakout feature is not available without platform.json file" : + pytest.exit("**** This test is not needed ****") + root_dir = os.path.dirname('/') + (exitcode, output_dict) = dvs.runcmd("jq '.' new_port_config.json") + if output_dict is None: + raise Exception("Breakout output cant be None") + + output_dict = ast.literal_eval(output_dict.strip()) + return output_dict + + # Check Initial Brakout Mode + def test_InitialBreakoutMode(self, dvs, testlog): + self.setup_db(dvs) + + output_dict = {} + brkoutTbl = swsscommon.Table(self.cdb, "BREAKOUT_CFG") + brkout_entries = brkoutTbl.getKeys() + assert len(brkout_entries) == 32 + + for key in brkout_entries: + (status, fvs) = brkoutTbl.get(key) + assert(status == True) + + brkout_mode = fvs[0][1] + output_dict[key] = brkout_mode + output = collections.OrderedDict(sorted(output_dict.items(), key=lambda t: t[0])) + expected_dict = \ + {'Ethernet8': '1x100G[40G]', 'Ethernet0': '1x100G[40G]', 'Ethernet4': '1x100G[40G]', \ + 'Ethernet108': '1x100G[40G]', 'Ethernet100': '1x100G[40G]', 'Ethernet104': '1x100G[40G]', \ + 'Ethernet68': '1x100G[40G]', 'Ethernet96': '1x100G[40G]', 'Ethernet124': '1x100G[40G]', \ + 'Ethernet92': '1x100G[40G]', 'Ethernet120': '1x100G[40G]', 'Ethernet52': '1x100G[40G]', \ + 'Ethernet56': '1x100G[40G]', 'Ethernet76': '1x100G[40G]', 'Ethernet72': '1x100G[40G]', \ + 'Ethernet32': '1x100G[40G]', 'Ethernet16': '1x100G[40G]', 'Ethernet36': '1x100G[40G]', \ + 'Ethernet12': '1x100G[40G]', 'Ethernet28': '1x100G[40G]', 'Ethernet88': '1x100G[40G]', \ + 'Ethernet116': '1x100G[40G]', 'Ethernet80': '1x100G[40G]', 'Ethernet112': '1x100G[40G]', \ + 'Ethernet84': '1x100G[40G]', 'Ethernet48': '1x100G[40G]', 'Ethernet44': '1x100G[40G]', \ + 'Ethernet40': '1x100G[40G]', 'Ethernet64': '1x100G[40G]', 'Ethernet60': '1x100G[40G]', \ + 'Ethernet20': '1x100G[40G]', 'Ethernet24': '1x100G[40G]'} + expected = collections.OrderedDict(sorted(expected_dict.items(), key=lambda t: t[0])) + assert output == expected + + # Breakout Cli Test Mode + def test_breakout_modes(self, dvs): + expected = self.read_Json(dvs) + assert expected + + print "**** Breakout Cli test Starts ****" + output_dict = self.breakout(dvs, 'Ethernet0', '2x50G') + expected_dict = expected["Ethernet0_2x50G"] + assert output_dict == expected_dict + print "**** 1X100G --> 2x50G passed ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print "**** 2x50G --> 1x100G[40G] passed ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '4x25G[10G]') + expected_dict = expected["Ethernet0_4x25G"] + assert output_dict == expected_dict + print "**** 1X100G --> 4x25G[10G] passed ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print "**** 4x25G[10G] --> 1x100G[40G] passed ****" + + output_dict = self.breakout(dvs, 'Ethernet4', '2x50G') + print "**** 1X100G --> 2x50G mode change ****" + + output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') + expected_dict = expected["Ethernet4_4x25G"] + assert output_dict == expected_dict + print "**** 2X50G --> 4x25G[10G] passed ****" + + output_dict = self.breakout(dvs, 'Ethernet4', '2x50G') + expected_dict = expected["Ethernet4_2x50G"] + assert output_dict == expected_dict + print "**** 4x25G[10G] --> 2X50G passed ****" + + output_dict = self.breakout(dvs, 'Ethernet4', '1x100G[40G]') + print "**** 2x50G -- > 1X100G mode change ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '2x25G(2)+1x50G(2)') + expected_dict = expected["Ethernet0_2x25G_1x50G"] + assert output_dict == expected_dict + print "**** 1x100G[40G] --> 2x25G(2)+1x50G(2) passed ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print "**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '1x50G(2)+2x25G(2)') + expected_dict = expected["Ethernet0_1x50G_2x25G"] + assert output_dict == expected_dict + print "**** 1x100G[40G] --> 1x50G(2)+2x25G(2) passed ****" + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print "**** 1x50G(2)+2x25G(2) --> 1x100G[40G] passed ****" + + output_dict = self.breakout(dvs, 'Ethernet8', '2x50G') + print "**** 1x100G[40G] --> 2x50G mode change ****" + + output_dict = self.breakout(dvs, 'Ethernet8', '1x50G(2)+2x25G(2)') + expected_dict = expected["Ethernet8_1x50G_2x25G"] + assert output_dict == expected_dict + print "**** 2x50G --> 2x25G(2)+1x50G(2) passed ****" + + output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') + expected_dict = expected["Ethernet8_2x25G_1x50G"] + assert output_dict == expected_dict + print "**** 1x50G(2)+2x25G(2) --> 2x25G(2)+1x50G(2) passed ****" + + output_dict = self.breakout(dvs, 'Ethernet8', '1x100G[40G]') + expected_dict = expected["Ethernet8_1x100G"] + assert output_dict == expected_dict + print "**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****" From 730629ff5d2be1f241b1ade02711b757ba169477 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Wed, 3 Jun 2020 02:10:10 +0000 Subject: [PATCH 2/8] Addressing review comments Signed-off-by: Sangita Maity --- platform/vs/tests/breakout/test_breakout_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py index e36fefaf5bf2..f9e9850fbe65 100755 --- a/platform/vs/tests/breakout/test_breakout_cli.py +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -27,7 +27,7 @@ def breakout(self, dvs, interface, brkout_mode): (exitcode, result) = dvs.runcmd("config interface breakout {} {} -y".format(interface, brkout_mode)) if result.strip("\n")[0] == "[ERROR] Breakout feature is not available without platform.json file" : - pytest.exit("**** This test is not needed ****") + pytest.skip("**** This test is not needed ****") root_dir = os.path.dirname('/') (exitcode, output_dict) = dvs.runcmd("jq '.' new_port_config.json") if output_dict is None: From e4ca662e3842152b77cca4fba5b9a941b1fddc97 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Thu, 23 Jul 2020 17:45:43 +0000 Subject: [PATCH 3/8] Fixed a python syntax issue Signed-off-by: Sangita Maity --- .../vs/tests/breakout/test_breakout_cli.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py index f9e9850fbe65..d622c44a58f8 100755 --- a/platform/vs/tests/breakout/test_breakout_cli.py +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -72,77 +72,77 @@ def test_breakout_modes(self, dvs): expected = self.read_Json(dvs) assert expected - print "**** Breakout Cli test Starts ****" + print("**** Breakout Cli test Starts ****") output_dict = self.breakout(dvs, 'Ethernet0', '2x50G') expected_dict = expected["Ethernet0_2x50G"] assert output_dict == expected_dict - print "**** 1X100G --> 2x50G passed ****" + print("**** 1X100G --> 2x50G passed ****") output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') expected_dict = expected["Ethernet0_1x100G"] assert output_dict == expected_dict - print "**** 2x50G --> 1x100G[40G] passed ****" + print("**** 2x50G --> 1x100G[40G] passed ****") output_dict = self.breakout(dvs, 'Ethernet0', '4x25G[10G]') expected_dict = expected["Ethernet0_4x25G"] assert output_dict == expected_dict - print "**** 1X100G --> 4x25G[10G] passed ****" + print("**** 1X100G --> 4x25G[10G] passed ****") output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') expected_dict = expected["Ethernet0_1x100G"] assert output_dict == expected_dict - print "**** 4x25G[10G] --> 1x100G[40G] passed ****" + print("**** 4x25G[10G] --> 1x100G[40G] passed ****") output_dict = self.breakout(dvs, 'Ethernet4', '2x50G') - print "**** 1X100G --> 2x50G mode change ****" + print("**** 1X100G --> 2x50G mode change ****") output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') expected_dict = expected["Ethernet4_4x25G"] assert output_dict == expected_dict - print "**** 2X50G --> 4x25G[10G] passed ****" + print("**** 2X50G --> 4x25G[10G] passed ****") output_dict = self.breakout(dvs, 'Ethernet4', '2x50G') expected_dict = expected["Ethernet4_2x50G"] assert output_dict == expected_dict - print "**** 4x25G[10G] --> 2X50G passed ****" + print("**** 4x25G[10G] --> 2X50G passed ****") output_dict = self.breakout(dvs, 'Ethernet4', '1x100G[40G]') - print "**** 2x50G -- > 1X100G mode change ****" + print("**** 2x50G -- > 1X100G mode change ****") output_dict = self.breakout(dvs, 'Ethernet0', '2x25G(2)+1x50G(2)') expected_dict = expected["Ethernet0_2x25G_1x50G"] assert output_dict == expected_dict - print "**** 1x100G[40G] --> 2x25G(2)+1x50G(2) passed ****" + print("**** 1x100G[40G] --> 2x25G(2)+1x50G(2) passed ****") output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') expected_dict = expected["Ethernet0_1x100G"] assert output_dict == expected_dict - print "**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****" + print("**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****") output_dict = self.breakout(dvs, 'Ethernet0', '1x50G(2)+2x25G(2)') expected_dict = expected["Ethernet0_1x50G_2x25G"] assert output_dict == expected_dict - print "**** 1x100G[40G] --> 1x50G(2)+2x25G(2) passed ****" + print("**** 1x100G[40G] --> 1x50G(2)+2x25G(2) passed ****") output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') expected_dict = expected["Ethernet0_1x100G"] assert output_dict == expected_dict - print "**** 1x50G(2)+2x25G(2) --> 1x100G[40G] passed ****" + print("**** 1x50G(2)+2x25G(2) --> 1x100G[40G] passed ****") output_dict = self.breakout(dvs, 'Ethernet8', '2x50G') - print "**** 1x100G[40G] --> 2x50G mode change ****" + print("**** 1x100G[40G] --> 2x50G mode change ****") output_dict = self.breakout(dvs, 'Ethernet8', '1x50G(2)+2x25G(2)') expected_dict = expected["Ethernet8_1x50G_2x25G"] assert output_dict == expected_dict - print "**** 2x50G --> 2x25G(2)+1x50G(2) passed ****" + print("**** 2x50G --> 2x25G(2)+1x50G(2) passed ****)" output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') expected_dict = expected["Ethernet8_2x25G_1x50G"] assert output_dict == expected_dict - print "**** 1x50G(2)+2x25G(2) --> 2x25G(2)+1x50G(2) passed ****" + print("**** 1x50G(2)+2x25G(2) --> 2x25G(2)+1x50G(2) passed ****") output_dict = self.breakout(dvs, 'Ethernet8', '1x100G[40G]') expected_dict = expected["Ethernet8_1x100G"] assert output_dict == expected_dict - print "**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****" + print("**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****") From 8b1b6c820d328425fc2e4863bd6bbff22c316463 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Thu, 23 Jul 2020 20:11:51 +0000 Subject: [PATCH 4/8] update sonic-utilities submodule Signed-off-by: Sangita Maity --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 995cf3988c07..aa1b072aa712 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 995cf3988c0754a1627b98e90c7e6f3ac4fd106e +Subproject commit aa1b072aa712e7e6663998f19c88b90048febb12 From 8d2908c652d6fbd5ef90bbc962e603fb1f29a4ed Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Fri, 24 Jul 2020 16:19:42 +0000 Subject: [PATCH 5/8] Fixed another syntax issue Signed-off-by: Sangita Maity --- platform/vs/tests/breakout/test_breakout_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py index d622c44a58f8..c12815134b79 100755 --- a/platform/vs/tests/breakout/test_breakout_cli.py +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -135,7 +135,7 @@ def test_breakout_modes(self, dvs): output_dict = self.breakout(dvs, 'Ethernet8', '1x50G(2)+2x25G(2)') expected_dict = expected["Ethernet8_1x50G_2x25G"] assert output_dict == expected_dict - print("**** 2x50G --> 2x25G(2)+1x50G(2) passed ****)" + print("**** 2x50G --> 2x25G(2)+1x50G(2) passed ****") output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') expected_dict = expected["Ethernet8_2x25G_1x50G"] From dbe1d4237cd65797214526865213e7ef7801501a Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Mon, 27 Jul 2020 07:17:02 +0000 Subject: [PATCH 6/8] adding platform.json file capability to VS docker Signed-off-by: Sangita Maity --- platform/vs/docker-sonic-vs/Dockerfile.j2 | 1 + platform/vs/docker-sonic-vs/platform.json | 64 +++++++++++------------ platform/vs/docker-sonic-vs/start.sh | 2 +- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 47c2f4fe95a1..62eea71a45aa 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -130,6 +130,7 @@ COPY ["files/sonic_version.yml", "/etc/sonic/"] COPY ["database_config.json", "/etc/default/sonic-db/"] COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"] +COPY ["platform.json", "/usr/share/sonic/platform/"] # Workaround the tcpdump issue RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump diff --git a/platform/vs/docker-sonic-vs/platform.json b/platform/vs/docker-sonic-vs/platform.json index c9f5982ca938..14875a6a5a42 100644 --- a/platform/vs/docker-sonic-vs/platform.json +++ b/platform/vs/docker-sonic-vs/platform.json @@ -3,193 +3,193 @@ "Ethernet0": { "index": "0,0,0,0", "lanes": "25,26,27,28", - "alias_at_lanes": "Eth0/1,Eth0/2,Eth0/3,Eth0/4", + "alias_at_lanes": "fortyGig0/0,fortyGig0/1,fortyGig0/2,fortyGig0/3", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet4": { "index": "1,1,1,1", "lanes": "29,30,31,32", - "alias_at_lanes": "Eth1/1,Eth1/2,Eth1/3,Eth1/4", + "alias_at_lanes": "fortyGig0/4,fortyGig0/5,fortyGig0/6,fortyGig0/7", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" }, "Ethernet8": { "index": "2,2,2,2", "lanes": "33,34,35,36", - "alias_at_lanes": "Eth2/1,Eth2/2,Eth2/3,Eth2/4", + "alias_at_lanes": "fortyGig0/8,fortyGig0/9,fortyGig0/10,fortyGig0/11", "breakout_modes": "1x100G[40G],2x50G,2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet12": { "index": "3,3,3,3", "lanes": "37,38,39,40", - "alias_at_lanes": "Eth3/1,Eth3/2,Eth3/3,Eth3/4", + "alias_at_lanes": "fortyGig0/12,fortyGig0/13,fortyGig0/14,fortyGig0/15", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet16": { "index": "4,4,4,4", "lanes": "45,46,47,48", - "alias_at_lanes": "Eth4/1,Eth4/2,Eth4/3,Eth4/4", + "alias_at_lanes": "fortyGig0/16,fortyGig0/17,fortyGig0/18,fortyGig0/19", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet20": { "index": "5,5,5,5", "lanes": "41,42,43,44", - "alias_at_lanes": "Eth5/1,Eth5/2,Eth5/3,Eth5/4", + "alias_at_lanes": "fortyGig0/20,fortyGig0/21,fortyGig0/22,fortyGig0/23", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet24": { "index": "6,6,6,6", "lanes": "1,2,3,4", - "alias_at_lanes": "Eth6/1,Eth6/2,Eth6/3,Eth6/4", + "alias_at_lanes": "fortyGig0/24,fortyGig0/25,fortyGig0/26,fortyGig0/27", "breakout_modes": "1x100G[40G],4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet28": { "index": "7,7,7,7", "lanes": "5,6,7,8", - "alias_at_lanes": "Eth7/1,Eth7/2,Eth7/3,Eth7/4", + "alias_at_lanes": "fortyGig0/28,fortyGig0/29,fortyGig0/30,fortyGig0/31", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet32": { "index": "8,8,8,8", "lanes": "13,14,15,16", - "alias_at_lanes": "Eth8/1,Eth8/2,Eth8/3,Eth8/4", + "alias_at_lanes": "fortyGig0/32,fortyGig0/33,fortyGig0/34,fortyGig0/35", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet36": { "index": "9,9,9,9", "lanes": "9,10,11,12", - "alias_at_lanes": "Eth9/1,Eth9/2,Eth9/3,Eth9/4", + "alias_at_lanes": "fortyGig0/36,fortyGig0/37,fortyGig0/38,fortyGig0/39", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet40": { "index": "10,10,10,10", "lanes": "17,18,19,20", - "alias_at_lanes": "Eth10/1,Eth10/2,Eth10/3,Eth10/4", + "alias_at_lanes": "fortyGig0/40,fortyGig0/41,fortyGig0/42,fortyGig0/43", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet44": { "index": "11,11,11,11", "lanes": "21,22,23,24", - "alias_at_lanes": "Eth11/1,Eth11/2,Eth11/3,Eth11/4", + "alias_at_lanes": "fortyGig0/44,fortyGig0/45,fortyGig0/46,fortyGig0/47", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet48": { "index": "12,12,12,12", "lanes": "53,54,55,56", - "alias_at_lanes": "Eth12/1,Eth12/2,Eth12/3,Eth12/4", + "alias_at_lanes": "fortyGig0/48,fortyGig0/49,fortyGig0/50,fortyGig0/51", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet52": { "index": "13,13,13,13", "lanes": "49,50,51,52", - "alias_at_lanes": "Eth13/1,Eth13/2,Eth13/3,Eth13/4", + "alias_at_lanes": "fortyGig0/52,fortyGig0/53,fortyGig0/54,fortyGig0/55", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet56": { "index": "14,14,14,14", "lanes": "57,58,59,60", - "alias_at_lanes": "Eth14/1,Eth14/2,Eth14/3,Eth14/4", + "alias_at_lanes": "fortyGig0/56,fortyGig0/57,fortyGig0/58,fortyGig0/59", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet60": { "index": "15,15,15,15", "lanes": "61,62,63,64", - "alias_at_lanes": "Eth15/1,Eth15/2,Eth15/3,Eth15/4", + "alias_at_lanes": "fortyGig0/60,fortyGig0/61,fortyGig0/62,fortyGig0/63", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet64": { "index": "16,16,16,16", "lanes": "69,70,71,72", - "alias_at_lanes": "Eth16/1,Eth16/2,Eth16/3,Eth16/4", + "alias_at_lanes": "fortyGig0/64,fortyGig0/65,fortyGig0/66,fortyGig0/67", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet68": { "index": "17,17,17,17", "lanes": "65,66,67,68", - "alias_at_lanes": "Eth17/1,Eth17/2,Eth17/3,Eth17/4", + "alias_at_lanes": "fortyGig0/68,fortyGig0/69,fortyGig0/70,fortyGig0/71", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet72": { "index": "18,18,18,18", "lanes": "73,74,75,76", - "alias_at_lanes": "Eth18/1,Eth18/2,Eth18/3,Eth18/4", + "alias_at_lanes": "fortyGig0/72,fortyGig0/73,fortyGig0/74,fortyGig0/75", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet76": { "index": "19,19,19,19", "lanes": "77,78,79,80", - "alias_at_lanes": "Eth19/1,Eth19/2,Eth19/3,Eth19/4", + "alias_at_lanes": "fortyGig0/76,fortyGig0/77,fortyGig0/78,fortyGig0/79", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet80": { "index": "20,20,20,20", "lanes": "109,110,111,112", - "alias_at_lanes": "Eth20/1,Eth20/2,Eth20/3,Eth20/4", + "alias_at_lanes": "fortyGig0/80,fortyGig0/81,fortyGig0/82,fortyGig0/83", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet84": { "index": "21,21,21,21", "lanes": "105,106,107,108", - "alias_at_lanes": "Eth21/1,Eth21/2,Eth21/3,Eth21/4", + "alias_at_lanes": "fortyGig0/84,fortyGig0/85,fortyGig0/86,fortyGig0/87", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet88": { "index": "22,22,22,22", "lanes": "113,114,115,116", - "alias_at_lanes": "Eth22/1,Eth22/2,Eth22/3,Eth22/4", + "alias_at_lanes": "fortyGig0/88,fortyGig0/89,fortyGig0/90,fortyGig0/91", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet92": { "index": "23,23,23,23", "lanes": "117,118,119,120", - "alias_at_lanes": "Eth23/1,Eth23/2,Eth23/3,Eth23/4", + "alias_at_lanes": "fortyGig0/92,fortyGig0/93,fortyGig0/94,fortyGig0/95", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet96": { "index": "24,24,24,24", "lanes": "125,126,127,128", - "alias_at_lanes": "Eth24/1,Eth24/2,Eth24/3,Eth24/4", + "alias_at_lanes": "fortyGig0/96,fortyGig0/97,fortyGig0/98,fortyGig0/99", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet100": { "index": "25,25,25,25", "lanes": "121,122,123,124", - "alias_at_lanes": "Eth25/1,Eth25/2,Eth25/3,Eth25/4", + "alias_at_lanes": "fortyGig0/100,fortyGig0/101,fortyGig0/102,fortyGig0/103", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet104": { "index": "26,26,26,26", "lanes": "81,82,83,84", - "alias_at_lanes": "Eth26/1,Eth26/2,Eth26/3,Eth26/4", + "alias_at_lanes": "fortyGig0/104,fortyGig0/105,fortyGig0/106,fortyGig0/107", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet108": { "index": "27,27,27,27", "lanes": "85,86,87,88", - "alias_at_lanes": "Eth27/1,Eth27/2,Eth27/3,Eth27/4", + "alias_at_lanes": "fortyGig0/108,fortyGig0/109,fortyGig0/110,fortyGig0/111", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet112": { "index": "28,28,28,28", "lanes": "93,94,95,96", - "alias_at_lanes": "Eth28/1,Eth28/2,Eth28/3,Eth28/4", + "alias_at_lanes": "fortyGig0/112,fortyGig0/113,fortyGig0/114,fortyGig0/115", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet116": { "index": "29,29,29,29", "lanes": "89,90,91,92", - "alias_at_lanes": "Eth29/1,Eth29/2,Eth29/3,Eth29/4", + "alias_at_lanes": "fortyGig0/116,fortyGig0/117,fortyGig0/118,fortyGig0/119", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet120": { "index": "30,30,30,30", "lanes": "101,102,103,104", - "alias_at_lanes": "Eth30/1,Eth30/2,Eth30/3,Eth30/4", + "alias_at_lanes": "fortyGig0/120,fortyGig0/121,fortyGig0/122,fortyGig0/123", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet124": { "index": "31,31,31,31", "lanes": "97,98,99,100", - "alias_at_lanes": "Eth31/1,Eth31/2,Eth31/3,Eth31/4", + "alias_at_lanes": "fortyGig0/124,fortyGig0/125,fortyGig0/126,fortyGig0/127", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" } } diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 54d585f29e23..4a1de88e98b1 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -36,7 +36,7 @@ else # generate and merge buffers configuration into config file sonic-cfggen -k $HWSKU -p /usr/share/sonic/hwsku/port_config.ini -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json - sonic-cfggen -p /usr/share/sonic/hwsku/port_config.ini -k $HWSKU --print-data > /tmp/ports.json + sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/platform.json -k $HWSKU --print-data > /tmp/ports.json sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/qos.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json fi From ebf1d68c07cb7db6b44e55f4b7989993636d5819 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Thu, 30 Jul 2020 17:17:38 +0000 Subject: [PATCH 7/8] update sonic-utilities submodule Signed-off-by: Sangita Maity --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index aa1b072aa712..c0c3cce6bee0 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit aa1b072aa712e7e6663998f19c88b90048febb12 +Subproject commit c0c3cce6bee0e335cf1b5528f1172b511d48ee12 From 73d1a7ef7fa4838b559f8cea3e044c1d3244c13c Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Thu, 30 Jul 2020 18:40:25 +0000 Subject: [PATCH 8/8] changed the way of testing nad fixed the input data Signed-off-by: Sangita Maity --- platform/vs/docker-sonic-vs/platform.json | 64 ++++++------- .../sample_output/sample_new_port_config.json | 93 +++++++++++++------ .../vs/tests/breakout/test_breakout_cli.py | 18 ++++ 3 files changed, 116 insertions(+), 59 deletions(-) diff --git a/platform/vs/docker-sonic-vs/platform.json b/platform/vs/docker-sonic-vs/platform.json index 14875a6a5a42..053fed5516ed 100644 --- a/platform/vs/docker-sonic-vs/platform.json +++ b/platform/vs/docker-sonic-vs/platform.json @@ -3,193 +3,193 @@ "Ethernet0": { "index": "0,0,0,0", "lanes": "25,26,27,28", - "alias_at_lanes": "fortyGig0/0,fortyGig0/1,fortyGig0/2,fortyGig0/3", + "alias_at_lanes": "fortyGigE0/0,fortyGigE0/1,fortyGigE0/2,fortyGigE0/3", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet4": { "index": "1,1,1,1", "lanes": "29,30,31,32", - "alias_at_lanes": "fortyGig0/4,fortyGig0/5,fortyGig0/6,fortyGig0/7", + "alias_at_lanes": "fortyGigE0/4,fortyGigE0/5,fortyGigE0/6,fortyGigE0/7", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" }, "Ethernet8": { "index": "2,2,2,2", "lanes": "33,34,35,36", - "alias_at_lanes": "fortyGig0/8,fortyGig0/9,fortyGig0/10,fortyGig0/11", + "alias_at_lanes": "fortyGigE0/8,fortyGigE0/9,fortyGigE0/10,fortyGigE0/11", "breakout_modes": "1x100G[40G],2x50G,2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet12": { "index": "3,3,3,3", "lanes": "37,38,39,40", - "alias_at_lanes": "fortyGig0/12,fortyGig0/13,fortyGig0/14,fortyGig0/15", + "alias_at_lanes": "fortyGigE0/12,fortyGigE0/13,fortyGigE0/14,fortyGigE0/15", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet16": { "index": "4,4,4,4", "lanes": "45,46,47,48", - "alias_at_lanes": "fortyGig0/16,fortyGig0/17,fortyGig0/18,fortyGig0/19", + "alias_at_lanes": "fortyGigE0/16,fortyGigE0/17,fortyGigE0/18,fortyGigE0/19", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet20": { "index": "5,5,5,5", "lanes": "41,42,43,44", - "alias_at_lanes": "fortyGig0/20,fortyGig0/21,fortyGig0/22,fortyGig0/23", + "alias_at_lanes": "fortyGigE0/20,fortyGigE0/21,fortyGigE0/22,fortyGigE0/23", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet24": { "index": "6,6,6,6", "lanes": "1,2,3,4", - "alias_at_lanes": "fortyGig0/24,fortyGig0/25,fortyGig0/26,fortyGig0/27", + "alias_at_lanes": "fortyGigE0/24,fortyGigE0/25,fortyGigE0/26,fortyGigE0/27", "breakout_modes": "1x100G[40G],4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet28": { "index": "7,7,7,7", "lanes": "5,6,7,8", - "alias_at_lanes": "fortyGig0/28,fortyGig0/29,fortyGig0/30,fortyGig0/31", + "alias_at_lanes": "fortyGigE0/28,fortyGigE0/29,fortyGigE0/30,fortyGigE0/31", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet32": { "index": "8,8,8,8", "lanes": "13,14,15,16", - "alias_at_lanes": "fortyGig0/32,fortyGig0/33,fortyGig0/34,fortyGig0/35", + "alias_at_lanes": "fortyGigE0/32,fortyGigE0/33,fortyGigE0/34,fortyGigE0/35", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet36": { "index": "9,9,9,9", "lanes": "9,10,11,12", - "alias_at_lanes": "fortyGig0/36,fortyGig0/37,fortyGig0/38,fortyGig0/39", + "alias_at_lanes": "fortyGigE0/36,fortyGigE0/37,fortyGigE0/38,fortyGigE0/39", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet40": { "index": "10,10,10,10", "lanes": "17,18,19,20", - "alias_at_lanes": "fortyGig0/40,fortyGig0/41,fortyGig0/42,fortyGig0/43", + "alias_at_lanes": "fortyGigE0/40,fortyGigE0/41,fortyGigE0/42,fortyGigE0/43", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet44": { "index": "11,11,11,11", "lanes": "21,22,23,24", - "alias_at_lanes": "fortyGig0/44,fortyGig0/45,fortyGig0/46,fortyGig0/47", + "alias_at_lanes": "fortyGigE0/44,fortyGigE0/45,fortyGigE0/46,fortyGigE0/47", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet48": { "index": "12,12,12,12", "lanes": "53,54,55,56", - "alias_at_lanes": "fortyGig0/48,fortyGig0/49,fortyGig0/50,fortyGig0/51", + "alias_at_lanes": "fortyGigE0/48,fortyGigE0/49,fortyGigE0/50,fortyGigE0/51", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet52": { "index": "13,13,13,13", "lanes": "49,50,51,52", - "alias_at_lanes": "fortyGig0/52,fortyGig0/53,fortyGig0/54,fortyGig0/55", + "alias_at_lanes": "fortyGigE0/52,fortyGigE0/53,fortyGigE0/54,fortyGigE0/55", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet56": { "index": "14,14,14,14", "lanes": "57,58,59,60", - "alias_at_lanes": "fortyGig0/56,fortyGig0/57,fortyGig0/58,fortyGig0/59", + "alias_at_lanes": "fortyGigE0/56,fortyGigE0/57,fortyGigE0/58,fortyGigE0/59", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet60": { "index": "15,15,15,15", "lanes": "61,62,63,64", - "alias_at_lanes": "fortyGig0/60,fortyGig0/61,fortyGig0/62,fortyGig0/63", + "alias_at_lanes": "fortyGigE0/60,fortyGigE0/61,fortyGigE0/62,fortyGigE0/63", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet64": { "index": "16,16,16,16", "lanes": "69,70,71,72", - "alias_at_lanes": "fortyGig0/64,fortyGig0/65,fortyGig0/66,fortyGig0/67", + "alias_at_lanes": "fortyGigE0/64,fortyGigE0/65,fortyGigE0/66,fortyGigE0/67", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet68": { "index": "17,17,17,17", "lanes": "65,66,67,68", - "alias_at_lanes": "fortyGig0/68,fortyGig0/69,fortyGig0/70,fortyGig0/71", + "alias_at_lanes": "fortyGigE0/68,fortyGigE0/69,fortyGigE0/70,fortyGigE0/71", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet72": { "index": "18,18,18,18", "lanes": "73,74,75,76", - "alias_at_lanes": "fortyGig0/72,fortyGig0/73,fortyGig0/74,fortyGig0/75", + "alias_at_lanes": "fortyGigE0/72,fortyGigE0/73,fortyGigE0/74,fortyGigE0/75", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet76": { "index": "19,19,19,19", "lanes": "77,78,79,80", - "alias_at_lanes": "fortyGig0/76,fortyGig0/77,fortyGig0/78,fortyGig0/79", + "alias_at_lanes": "fortyGigE0/76,fortyGigE0/77,fortyGigE0/78,fortyGigE0/79", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet80": { "index": "20,20,20,20", "lanes": "109,110,111,112", - "alias_at_lanes": "fortyGig0/80,fortyGig0/81,fortyGig0/82,fortyGig0/83", + "alias_at_lanes": "fortyGigE0/80,fortyGigE0/81,fortyGigE0/82,fortyGigE0/83", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet84": { "index": "21,21,21,21", "lanes": "105,106,107,108", - "alias_at_lanes": "fortyGig0/84,fortyGig0/85,fortyGig0/86,fortyGig0/87", + "alias_at_lanes": "fortyGigE0/84,fortyGigE0/85,fortyGigE0/86,fortyGigE0/87", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet88": { "index": "22,22,22,22", "lanes": "113,114,115,116", - "alias_at_lanes": "fortyGig0/88,fortyGig0/89,fortyGig0/90,fortyGig0/91", + "alias_at_lanes": "fortyGigE0/88,fortyGigE0/89,fortyGigE0/90,fortyGigE0/91", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet92": { "index": "23,23,23,23", "lanes": "117,118,119,120", - "alias_at_lanes": "fortyGig0/92,fortyGig0/93,fortyGig0/94,fortyGig0/95", + "alias_at_lanes": "fortyGigE0/92,fortyGigE0/93,fortyGigE0/94,fortyGigE0/95", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet96": { "index": "24,24,24,24", "lanes": "125,126,127,128", - "alias_at_lanes": "fortyGig0/96,fortyGig0/97,fortyGig0/98,fortyGig0/99", + "alias_at_lanes": "fortyGigE0/96,fortyGigE0/97,fortyGigE0/98,fortyGigE0/99", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet100": { "index": "25,25,25,25", "lanes": "121,122,123,124", - "alias_at_lanes": "fortyGig0/100,fortyGig0/101,fortyGig0/102,fortyGig0/103", + "alias_at_lanes": "fortyGigE0/100,fortyGigE0/101,fortyGigE0/102,fortyGigE0/103", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet104": { "index": "26,26,26,26", "lanes": "81,82,83,84", - "alias_at_lanes": "fortyGig0/104,fortyGig0/105,fortyGig0/106,fortyGig0/107", + "alias_at_lanes": "fortyGigE0/104,fortyGigE0/105,fortyGigE0/106,fortyGigE0/107", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet108": { "index": "27,27,27,27", "lanes": "85,86,87,88", - "alias_at_lanes": "fortyGig0/108,fortyGig0/109,fortyGig0/110,fortyGig0/111", + "alias_at_lanes": "fortyGigE0/108,fortyGigE0/109,fortyGigE0/110,fortyGigE0/111", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet112": { "index": "28,28,28,28", "lanes": "93,94,95,96", - "alias_at_lanes": "fortyGig0/112,fortyGig0/113,fortyGig0/114,fortyGig0/115", + "alias_at_lanes": "fortyGigE0/112,fortyGigE0/113,fortyGigE0/114,fortyGigE0/115", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet116": { "index": "29,29,29,29", "lanes": "89,90,91,92", - "alias_at_lanes": "fortyGig0/116,fortyGig0/117,fortyGig0/118,fortyGig0/119", + "alias_at_lanes": "fortyGigE0/116,fortyGigE0/117,fortyGigE0/118,fortyGigE0/119", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet120": { "index": "30,30,30,30", "lanes": "101,102,103,104", - "alias_at_lanes": "fortyGig0/120,fortyGig0/121,fortyGig0/122,fortyGig0/123", + "alias_at_lanes": "fortyGigE0/120,fortyGigE0/121,fortyGigE0/122,fortyGigE0/123", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" }, "Ethernet124": { "index": "31,31,31,31", "lanes": "97,98,99,100", - "alias_at_lanes": "fortyGig0/124,fortyGig0/125,fortyGig0/126,fortyGig0/127", + "alias_at_lanes": "fortyGigE0/124,fortyGigE0/125,fortyGigE0/126,fortyGigE0/127", "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" } } diff --git a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json index 13dcc096376d..7c5c190a3330 100644 --- a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json +++ b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json @@ -1,23 +1,62 @@ { "Ethernet0_2x50G": { "Ethernet2": { - "alias": "Eth0/3", + "alias": "fortyGigE0/2", "admin_status": "up", "lanes": "27,28", "speed": "50000", "index": "0" }, "Ethernet0": { - "alias": "Eth0/1", + "alias": "fortyGigE0/0", "admin_status": "up", "lanes": "25,26", "speed": "50000", "index": "0" } }, + "Ethernet12_1x50G_2x25G": { + "Ethernet12": { + "alias": "fortyGigE0/12", + "admin_status": "up", + "lanes": "37,38", + "speed": "50000", + "index": "3" + }, + "Ethernet14": { + "alias": "fortyGigE0/14", + "admin_status": "up", + "lanes": "39", + "speed": "25000", + "index": "3" + }, + "Ethernet15": { + "alias": "fortyGigE0/15", + "admin_status": "up", + "lanes": "40", + "speed": "25000", + "index": "3" + } + }, + "Ethernet0_2x50G": { + "Ethernet2": { + "alias": "fortyGigE0/2", + "admin_status": "up", + "lanes": "27,28", + "speed": "50000", + "index": "0" + }, + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25,26", + "speed": "50000", + "index": "0" + } + }, "Ethernet0_1x100G": { "Ethernet0": { - "alias": "Eth0/1", + "alias": "fortyGigE0/0", "admin_status": "up", "lanes": "25,26,27,28", "speed": "100000", @@ -26,28 +65,28 @@ }, "Ethernet0_4x25G": { "Ethernet2": { - "alias": "Eth0/3", + "alias": "fortyGigE0/2", "admin_status": "up", "lanes": "27", "speed": "25000", "index": "0" }, "Ethernet3": { - "alias": "Eth0/4", + "alias": "fortyGigE0/3", "admin_status": "up", "lanes": "28", "speed": "25000", "index": "0" }, "Ethernet0": { - "alias": "Eth0/1", + "alias": "fortyGigE0/0", "admin_status": "up", "lanes": "25", "speed": "25000", "index": "0" }, "Ethernet1": { - "alias": "Eth0/2", + "alias": "fortyGigE0/1", "admin_status": "up", "lanes": "26", "speed": "25000", @@ -56,21 +95,21 @@ }, "Ethernet0_2x25G_1x50G": { "Ethernet2": { - "alias": "Eth0/3", + "alias": "fortyGigE0/2", "admin_status": "up", "lanes": "27,28", "speed": "50000", "index": "0" }, "Ethernet0": { - "alias": "Eth0/1", + "alias": "fortyGigE0/0", "admin_status": "up", "lanes": "25", "speed": "25000", "index": "0" }, "Ethernet1": { - "alias": "Eth0/2", + "alias": "fortyGigE0/1", "admin_status": "up", "lanes": "26", "speed": "25000", @@ -79,21 +118,21 @@ }, "Ethernet0_1x50G_2x25G": { "Ethernet2": { - "alias": "Eth0/3", + "alias": "fortyGigE0/2", "admin_status": "up", "lanes": "27", "speed": "25000", "index": "0" }, "Ethernet3": { - "alias": "Eth0/4", + "alias": "fortyGigE0/3", "admin_status": "up", "lanes": "28", "speed": "25000", "index": "0" }, "Ethernet0": { - "alias": "Eth0/1", + "alias": "fortyGigE0/0", "admin_status": "up", "lanes": "25,26", "speed": "50000", @@ -102,28 +141,28 @@ }, "Ethernet4_4x25G": { "Ethernet6": { - "alias": "Eth1/3", + "alias": "fortyGigE0/6", "admin_status": "up", "lanes": "31", "speed": "25000", "index": "1" }, "Ethernet7": { - "alias": "Eth1/4", + "alias": "fortyGigE0/7", "admin_status": "up", "lanes": "32", "speed": "25000", "index": "1" }, "Ethernet4": { - "alias": "Eth1/1", + "alias": "fortyGigE0/4", "admin_status": "up", "lanes": "29", "speed": "25000", "index": "1" }, "Ethernet5": { - "alias": "Eth1/2", + "alias": "fortyGigE0/5", "admin_status": "up", "lanes": "30", "speed": "25000", @@ -132,14 +171,14 @@ }, "Ethernet4_2x50G": { "Ethernet6": { - "alias": "Eth1/3", + "alias": "fortyGigE0/6", "admin_status": "up", "lanes": "31,32", "speed": "50000", "index": "1" }, "Ethernet4": { - "alias": "Eth1/1", + "alias": "fortyGigE0/4", "admin_status": "up", "lanes": "29,30", "speed": "50000", @@ -148,14 +187,14 @@ }, "Ethernet8_2x50G": { "Ethernet8": { - "alias": "Eth2/1", + "alias": "fortyGigE0/8", "admin_status": "up", "lanes": "33,34", "speed": "50000", "index": "2" }, "Ethernet10": { - "alias": "Eth2/3", + "alias": "fortyGigE0/10", "admin_status": "up", "lanes": "35,36", "speed": "50000", @@ -164,14 +203,14 @@ }, "Ethernet8_1x50G_2x25G": { "Ethernet10": { - "alias": "Eth2/3", + "alias": "fortyGigE0/10", "admin_status": "up", "lanes": "35", "speed": "25000", "index": "2" }, "Ethernet11": { - "alias": "Eth2/4", + "alias": "fortyGigE0/11", "admin_status": "up", "lanes": "36", "speed": "25000", @@ -180,21 +219,21 @@ }, "Ethernet8_2x25G_1x50G": { "Ethernet8": { - "alias": "Eth2/1", + "alias": "fortyGigE0/8", "admin_status": "up", "lanes": "33", "speed": "25000", "index": "2" }, "Ethernet9": { - "alias": "Eth2/2", + "alias": "fortyGigE0/9", "admin_status": "up", "lanes": "34", "speed": "25000", "index": "2" }, "Ethernet10": { - "alias": "Eth2/3", + "alias": "fortyGigE0/10", "admin_status": "up", "lanes": "35,36", "speed": "50000", @@ -203,7 +242,7 @@ }, "Ethernet8_1x100G": { "Ethernet8": { - "alias": "Eth2/1", + "alias": "fortyGigE0/8", "admin_status": "up", "lanes": "33,34,35,36", "speed": "100000", diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py index c12815134b79..9208e159b1d5 100755 --- a/platform/vs/tests/breakout/test_breakout_cli.py +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -78,6 +78,23 @@ def test_breakout_modes(self, dvs): assert output_dict == expected_dict print("**** 1X100G --> 2x50G passed ****") + output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') + expected_dict = expected["Ethernet4_4x25G"] + assert output_dict == expected_dict + print("**** 1X100G --> 4x25G[10G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') + expected_dict = expected["Ethernet8_2x25G_1x50G"] + assert output_dict == expected_dict + print("**** 1X100G --> 2x25G(2)+1x50G(2) passed ****") + + output_dict = self.breakout(dvs, 'Ethernet12', '1x50G(2)+2x25G(2)') + expected_dict = expected["Ethernet12_1x50G_2x25G"] + assert output_dict == expected_dict + print("**** 1X100G --> 1x50G(2)+2x25G(2) passed ****") + + #TODOFIX: remove comments once #4442 PR got merged. + """ output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') expected_dict = expected["Ethernet0_1x100G"] assert output_dict == expected_dict @@ -146,3 +163,4 @@ def test_breakout_modes(self, dvs): expected_dict = expected["Ethernet8_1x100G"] assert output_dict == expected_dict print("**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****") + """