-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cli-sessions] unittests for ssh-server and serial-console commands.
- Loading branch information
1 parent
d571367
commit 209438b
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from click.testing import CliRunner | ||
|
||
import config.main as config | ||
import show.main as show | ||
from utilities_common.db import Db | ||
|
||
|
||
class TestCliSessionsCommands: | ||
def test_config_command(self): | ||
runner = CliRunner() | ||
|
||
db = Db() | ||
|
||
result = runner.invoke(config.config.commands['serial_console'].commands['sysrq-capabilities'], | ||
['enabled'], obj=db) | ||
assert result.exit_code == 0 | ||
|
||
result = runner.invoke(config.config.commands['serial_console'].commands['inactivity-timeout'], | ||
[180], obj=db) | ||
assert result.exit_code == 0 | ||
|
||
result = runner.invoke(show.cli.commands['serial_console'], obj=db) | ||
assert result.exit_code == 0 | ||
|
||
result = runner.invoke(config.config.commands['ssh'].commands['inactivity-timeout'], [190], obj=db) | ||
assert result.exit_code == 0 | ||
|
||
result = runner.invoke(config.config.commands['ssh'].commands['max-sessions'], [60], obj=db) | ||
assert result.exit_code == 0 | ||
|
||
result = runner.invoke(show.cli.commands['ssh'], obj=db) | ||
assert result.exit_code == 0 |