plugins/python/regress: add tests for approval plugin
This commit is contained in:

committed by
Todd C. Miller

parent
80b3d86d6e
commit
43e256e34f
1
plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stderr
vendored
Normal file
1
plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stderr
vendored
Normal file
@@ -0,0 +1 @@
|
||||
sudo: loading more than 8 sudo python approval plugins is not supported
|
67
plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stdout
vendored
Normal file
67
plugins/python/regress/testdata/check_multiple_approval_plugin_and_arguments.stdout
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
(APPROVAL 1) Constructed:
|
||||
{
|
||||
"plugin_options": [
|
||||
"ModulePath=SRC_DIR/regress/plugin_approval_test.py",
|
||||
"ClassName=ApprovalTestPlugin",
|
||||
"Id=1"
|
||||
],
|
||||
"version": "1.15",
|
||||
"settings": [
|
||||
"SETTING1=VALUE1",
|
||||
"setting2=value2"
|
||||
],
|
||||
"user_env": [
|
||||
"USER_ENV1=VALUE1",
|
||||
"USER_ENV2=value2"
|
||||
],
|
||||
"user_info": [
|
||||
"INFO1=VALUE1",
|
||||
"info2=value2"
|
||||
],
|
||||
"submit_optind": 3,
|
||||
"submit_argv": [
|
||||
"sudo",
|
||||
"-u",
|
||||
"user",
|
||||
"whoami",
|
||||
"--help"
|
||||
],
|
||||
"_id": "(APPROVAL 1)"
|
||||
}
|
||||
(APPROVAL 2) Constructed:
|
||||
{
|
||||
"plugin_options": [
|
||||
"ModulePath=SRC_DIR/regress/plugin_approval_test.py",
|
||||
"ClassName=ApprovalTestPlugin",
|
||||
"Id=2"
|
||||
],
|
||||
"version": "1.15",
|
||||
"settings": [
|
||||
"SETTING1=VALUE1",
|
||||
"setting2=value2"
|
||||
],
|
||||
"user_env": [
|
||||
"USER_ENV1=VALUE1",
|
||||
"USER_ENV2=value2"
|
||||
],
|
||||
"user_info": [
|
||||
"INFO1=VALUE1",
|
||||
"info2=value2"
|
||||
],
|
||||
"submit_optind": 3,
|
||||
"submit_argv": [
|
||||
"sudo",
|
||||
"-u",
|
||||
"user",
|
||||
"whoami",
|
||||
"--help"
|
||||
],
|
||||
"_id": "(APPROVAL 2)"
|
||||
}
|
||||
(APPROVAL 1) Show version was called with arguments: (0,)
|
||||
Python approval plugin API version 1.0
|
||||
(APPROVAL 2) Show version was called with arguments: (1,)
|
||||
(APPROVAL 1) Check was called with arguments: (('CMDINFO1=value1', 'CMDINFO2=VALUE2'), ('whoami', '--help'), ('USER_ENV1=VALUE1', 'USER_ENV2=value2'))
|
||||
(APPROVAL 2) Check was called with arguments: (('CMDINFO1=value1', 'CMDINFO2=VALUE2'), ('whoami', '--help'), ('USER_ENV1=VALUE1', 'USER_ENV2=value2'))
|
||||
(APPROVAL 1) Destructed successfully
|
||||
(APPROVAL 2) Destructed successfully
|
Reference in New Issue
Block a user