Add test cases for logging command

update-lkm
nirenjan 2022-09-22 14:23:30 -07:00
parent d96b86a817
commit 2b7c643537
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,15 @@
Logging with insufficient arguments
logging
ERR "Insufficient arguments for 'logging' command"
Get logging level with extra arguments
logging show foo bar
ERR "Unexpected arguments for 'logging show' command; got 4, expected 2 or 3"
Set logging level with insufficient arguments
logging set
ERR "Unexpected arguments for 'logging set' command; got 2, expected 3 or 4"
Invalid logging subcommand
logging foo
ERR "Unknown subcommand 'foo' for 'logging' command"

View File

@ -0,0 +1,15 @@
Set global logging level to error
logging set error
OK logging set error
Get global logging level (should be error)
logging show
DATA global error
Set global logging level to default - should return error
logging set default
ERR "'default' level is not valid without a module"
Set global logging level to unknown value - should return error
logging set foo
ERR "Unknown level 'foo' for 'logging set' command"

View File

@ -0,0 +1,27 @@
Set config module logging level to error
logging set config error
OK logging set config error
Get config module logging level
logging show config
DATA config error
Get configuration for invalid module
logging show foo
ERR "Invalid module 'foo'"
Set module logging level for invalid module
logging set foo error
ERR "Invalid module 'foo'"
Set invalid logging level for module
logging set config foo
ERR "Unknown level 'foo' for 'logging set' command"
Set module logging level to default
logging set config default
OK logging set config default
Get module logging level (should be error - same as global)
logging show config
DATA config error