Skip to content

Commit

Permalink
Added cisco config platform commands
Browse files Browse the repository at this point in the history
Signed-off-by: Yucai Gu <yucgu@cisco.com>
  • Loading branch information
yucgu committed Sep 9, 2022
1 parent 3dcb1cf commit 75c3775
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5990,6 +5990,10 @@ def size(db, size):
def platform():
"""Platform-related configuration tasks"""

if asic_type == 'cisco-8000':
from sonic_platform.cli.cisco import cisco
platform.add_command(cisco)

# 'firmware' subgroup ("config platform firmware ...")
@platform.group(cls=clicommon.AbbreviationGroup)
def firmware():
Expand Down
5 changes: 3 additions & 2 deletions tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ def setup_class(cls):

def test_config_platform(self, ctx, get_cmd_module, setup_single_cisco_asic):
#expected_output = "Enabling TX"
expected_output = "update"
expected_output = "interface"
(config, show) = get_cmd_module
db = Db()
runner = CliRunner()
Expand All @@ -1643,7 +1643,8 @@ def test_config_platform(self, ctx, get_cmd_module, setup_single_cisco_asic):
#config.config(ctx)
#result = runner.invoke(config.config.commands["platform"], ['--help'])
#result = runner.invoke(config.config.commands["platform"].commands['cisco'].commands['interface'].commands['tx'].commands['enable'], ['Ethernet60'])
result = runner.invoke(config.config.commands["platform"].commands['firmware'], ['--help'])
config.asic_type = mock.MagicMock(return_value="cisco-8000")
result = runner.invoke(config.config.commands["platform"].commands['cisco'], ['--help'])

print(result.exit_code)
print(result.output)
Expand Down

0 comments on commit 75c3775

Please sign in to comment.