Skip to content

Commit

Permalink
Update aaa_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
651477787 authored Feb 27, 2025
1 parent ddacd9a commit 82231f1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/aaa_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from mock import patch

import config.main as config
from swsscommon.swsscommon import ConfigDBConnector
import config.validated_config_db_connector as ValidatedConfigDBConnector
import show.main as show

test_path = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -287,8 +285,6 @@ def test_config_aaa_tacacs(self, get_cmd_module):

def test_config_aaa_tacacs_reach_maxsize(self, get_cmd_module):
(config, show) = get_cmd_module
# config_db = ValidatedConfigDBConnector(ConfigDBConnector())
# config_db.connect()
runner = CliRunner()
db = Db()
obj = {'db': db.cfgdb}
Expand All @@ -298,6 +294,7 @@ def test_config_aaa_tacacs_reach_maxsize(self, get_cmd_module):
for ip in servers:
# config tacacs add <ip>
db.cfgdb.set_entry('TACPLUS_SERVER', ip, data)
print(db.cfgdb.get_table('TACPLUS_SERVER'))
# result = runner.invoke(config.config.commands["tacacs"].commands["add"], [ip], obj=obj)
# print(result.exit_code, result.output)
# assert result.exit_code == 0
Expand All @@ -306,7 +303,7 @@ def test_config_aaa_tacacs_reach_maxsize(self, get_cmd_module):
print(result.exit_code, result.output)
result = runner.invoke(config.config.commands["tacacs"].commands["add"], ["1.1.1.9"], obj=obj)
info = runner.invoke(config.config.commands["tacacs"].commands["add"], ["1.1.1.9"], obj=db)
print(f"{str(config.config.commands['tacacs'].commands['add'])} 1.1.1.10")
print(config.config.commands['tacacs'].commands['add'])
print(result.exit_code, result.output)
print(info.exit_code, info.output)
assert result.exit_code != 0, "tacacs server reach maxsize"
Expand All @@ -328,8 +325,9 @@ def test_config_aaa_radius_reach_maxsize(self):
# result = runner.invoke(config.config.commands["radius"].commands["add"], [ip], obj=obj)
# print(result.exit_code, result.output)
# assert result.exit_code == 0
db.cfgdb.set_entry('TACPLUS_SERVER', ip, data)
result = runner.invoke(show.cli.commands["radius"], [], obj=db)
db.cfgdb.set_entry('RADIUS_SERVER', ip, data)
print(db.cfgdb.get_table('RADIUS_SERVER'))
result = runner.invoke(show.cli.commands["radius"], [], obj=obj)
print(result.exit_code, result.output)
assert result.exit_code == 0

Expand Down

0 comments on commit 82231f1

Please sign in to comment.