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 Aug 6, 2022
1 parent 0281112 commit 83aa7d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,6 @@ def config(ctx):
if asic_type == 'cisco-8000':
from sonic_platform.cli.cisco import cisco
platform.add_command(cisco)
from sonic_platform.cli.cisco2 import cisco2

# Load database config files
load_db_config()
Expand Down
10 changes: 9 additions & 1 deletion tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,13 @@ def teardown_class(cls):
print("TEARDOWN")
os.environ['UTILITIES_UNIT_TESTING'] = "0"

@pytest.fixture(scope='module')
def ctx(scope='module'):
db = Db()
obj = {'config_db':db.cfgdb, 'namespace': ''}
yield obj


class TestConfigPlatorm(object):
@classmethod
def setup_class(cls):
Expand All @@ -1595,8 +1602,9 @@ def setup_class(cls):
importlib.reload(config.main)


def test_config_platform(self, get_cmd_module, setup_single_cisco_asic):
def test_config_platform(self, ctx, get_cmd_module, setup_single_cisco_asic):
expected_output = "cisco"
config.config(ctx)
runner = CliRunner()
result = runner.invoke(config.config.commands["platform"], ['--help'])

Expand Down

0 comments on commit 83aa7d2

Please sign in to comment.