From 383ca803332b66de47c5318e63f28cd22d418bf7 Mon Sep 17 00:00:00 2001 From: Robert Manner Date: Tue, 7 Jan 2020 16:08:15 +0100 Subject: [PATCH] plugins/python/regress/testdata: generated data for the pyplugin tests --- ...lugin_reason_log_with_suspend.conversation | 3 +++ ...tion_plugin_reason_log_with_suspend.stderr | 0 ...tion_plugin_reason_log_with_suspend.stdout | 3 +++ ...tion_plugin_reason_log_with_suspend.stored | 3 +++ ...in_reason_log_without_suspend.conversation | 3 +++ ...n_plugin_reason_log_without_suspend.stderr | 0 ...n_plugin_reason_log_without_suspend.stdout | 1 + ...n_plugin_reason_log_without_suspend.stored | 3 +++ ...e_conversation_plugin_user_interrupts.conv | 2 ++ ...sation_plugin_user_interrupts.conversation | 2 ++ ...conversation_plugin_user_interrupts.stderr | 1 + ...conversation_plugin_user_interrupts.stdout | 1 + .../check_example_debugging_c_calls@diag.log | 4 +++ .../check_example_debugging_c_calls@info.log | 7 ++++++ .../check_example_debugging_load@diag.log | 4 +++ .../check_example_debugging_plugin@err.log | 1 + .../check_example_debugging_plugin@info.log | 4 +++ .../check_example_debugging_py_calls@diag.log | 2 ++ .../check_example_debugging_py_calls@info.log | 10 ++++++++ .../check_example_debugging_sudo_cb@info.log | 1 + ..._example_group_plugin_is_able_to_debug.log | 4 +++ ...check_example_io_plugin_command_log.stderr | 0 ...check_example_io_plugin_command_log.stdout | 1 + ...check_example_io_plugin_command_log.stored | 16 ++++++++++++ ...e_io_plugin_failed_to_start_command.stderr | 0 ...e_io_plugin_failed_to_start_command.stdout | 1 + ...e_io_plugin_failed_to_start_command.stored | 8 ++++++ ..._plugin_fails_with_python_backtrace.stderr | 1 + ..._plugin_fails_with_python_backtrace.stdout | 7 ++++++ ...k_example_io_plugin_version_display.stderr | 0 ...k_example_io_plugin_version_display.stdout | 2 ++ ...k_example_io_plugin_version_display.stored | 2 ++ ...le_policy_plugin_accepted_execution.stderr | 0 ...le_policy_plugin_accepted_execution.stdout | 1 + ...mple_policy_plugin_denied_execution.stderr | 1 + ...mple_policy_plugin_denied_execution.stdout | 0 ...mple_policy_plugin_failed_execution.stderr | 1 + ...mple_policy_plugin_failed_execution.stdout | 0 .../check_example_policy_plugin_list.stderr | 0 .../check_example_policy_plugin_list.stdout | 25 +++++++++++++++++++ ...mple_policy_plugin_validate_invalidate.log | 8 ++++++ ...ample_policy_plugin_version_display.stderr | 0 ...ample_policy_plugin_version_display.stdout | 1 + ...eck_loading_fails_missing_classname.stderr | 2 ++ ...eck_loading_fails_missing_classname.stdout | 0 .../check_loading_fails_missing_path.stderr | 2 ++ .../check_loading_fails_missing_path.stdout | 0 ...eck_loading_fails_not_owned_by_root.stderr | 1 + ...eck_loading_fails_not_owned_by_root.stdout | 0 ...check_loading_fails_wrong_classname.stderr | 2 ++ ...check_loading_fails_wrong_classname.stdout | 0 .../check_loading_fails_wrong_path.stderr | 1 + .../check_loading_fails_wrong_path.stdout | 0 53 files changed, 142 insertions(+) create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stderr create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stderr create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr create mode 100644 plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout create mode 100644 plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_c_calls@info.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_load@diag.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_plugin@err.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_plugin@info.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_py_calls@info.log create mode 100644 plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log create mode 100644 plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_command_log.stderr create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_command_log.stored create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stderr create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_version_display.stderr create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout create mode 100644 plugins/python/regress/testdata/check_example_io_plugin_version_display.stored create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stderr create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stdout create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stdout create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_list.stderr create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_list.stdout create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_version_display.stderr create mode 100644 plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout create mode 100644 plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr create mode 100644 plugins/python/regress/testdata/check_loading_fails_missing_classname.stdout create mode 100644 plugins/python/regress/testdata/check_loading_fails_missing_path.stderr create mode 100644 plugins/python/regress/testdata/check_loading_fails_missing_path.stdout create mode 100644 plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr create mode 100644 plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stdout create mode 100644 plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr create mode 100644 plugins/python/regress/testdata/check_loading_fails_wrong_classname.stdout create mode 100644 plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr create mode 100644 plugins/python/regress/testdata/check_loading_fails_wrong_path.stdout diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation new file mode 100644 index 000000000..43bd2e7c8 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.conversation @@ -0,0 +1,3 @@ +Question count: 2 +Question 0: <> (timeout: 120, msg_type=2) +Question 1: <> (timeout: 120, msg_type=5) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stderr b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout new file mode 100644 index 000000000..991c7de62 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stdout @@ -0,0 +1,3 @@ +Please provide your reason for executing ('/bin/whoami',) +conversation suspend: signal SIGTSTP (20) +conversation resume: signal was SIGCONT (18) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored new file mode 100644 index 000000000..c0ab85701 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_with_suspend.stored @@ -0,0 +1,3 @@ +Executed /bin/whoami +Reason: my fake reason +Hidden reason: my real secret reason diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation new file mode 100644 index 000000000..43bd2e7c8 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.conversation @@ -0,0 +1,3 @@ +Question count: 2 +Question 0: <> (timeout: 120, msg_type=2) +Question 1: <> (timeout: 120, msg_type=5) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stderr b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout new file mode 100644 index 000000000..7bbfa3f35 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stdout @@ -0,0 +1 @@ +Please provide your reason for executing ('/bin/whoami',) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored new file mode 100644 index 000000000..c0ab85701 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_reason_log_without_suspend.stored @@ -0,0 +1,3 @@ +Executed /bin/whoami +Reason: my fake reason +Hidden reason: my real secret reason diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv new file mode 100644 index 000000000..59d720241 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conv @@ -0,0 +1,2 @@ +Question count: 2 +Question 0: <> (timeout: 120, msg_type=2) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation new file mode 100644 index 000000000..59d720241 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.conversation @@ -0,0 +1,2 @@ +Question count: 2 +Question 0: <> (timeout: 120, msg_type=2) diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr new file mode 100644 index 000000000..8a4a52810 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stderr @@ -0,0 +1 @@ +You did not answer in time diff --git a/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout new file mode 100644 index 000000000..7bbfa3f35 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_conversation_plugin_user_interrupts.stdout @@ -0,0 +1 @@ +Please provide your reason for executing ('/bin/whoami',) diff --git a/plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log b/plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log new file mode 100644 index 000000000..0ecf740a9 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_c_calls@diag.log @@ -0,0 +1,4 @@ +sudo.debug was called with arguments: (2, 'My demo purpose plugin shows this ERROR level debug message') +sudo.debug was called with arguments: (6, 'My demo purpose plugin shows this INFO level debug message') +sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) +sudo.options_as_dict returned result: {'ModulePath': 'SRC_DIR/example_debugging.py', 'ClassName': 'DebugDemoPlugin'} diff --git a/plugins/python/regress/testdata/check_example_debugging_c_calls@info.log b/plugins/python/regress/testdata/check_example_debugging_c_calls@info.log new file mode 100644 index 000000000..77ca47638 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_c_calls@info.log @@ -0,0 +1,7 @@ +__init__ @ SRC_DIR/example_debugging.py:45 calls C function: +sudo.debug was called with arguments: (2, 'My demo purpose plugin shows this ERROR level debug message') +__init__ @ SRC_DIR/example_debugging.py:48 calls C function: +sudo.debug was called with arguments: (6, 'My demo purpose plugin shows this INFO level debug message') +__init__ @ SRC_DIR/example_debugging.py:58 calls C function: +sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) +sudo.options_as_dict returned result: {'ModulePath': 'SRC_DIR/example_debugging.py', 'ClassName': 'DebugDemoPlugin'} diff --git a/plugins/python/regress/testdata/check_example_debugging_load@diag.log b/plugins/python/regress/testdata/check_example_debugging_load@diag.log new file mode 100644 index 000000000..5e2bece2f --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_load@diag.log @@ -0,0 +1,4 @@ +importing module: SRC_DIR/example_debugging.py +Extending python 'path' with 'SRC_DIR' +Closing: 0 python plugins left open +Closing: deinit python interpreter diff --git a/plugins/python/regress/testdata/check_example_debugging_plugin@err.log b/plugins/python/regress/testdata/check_example_debugging_plugin@err.log new file mode 100644 index 000000000..ffadfe2e6 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_plugin@err.log @@ -0,0 +1 @@ +My demo purpose plugin shows this ERROR level debug message diff --git a/plugins/python/regress/testdata/check_example_debugging_plugin@info.log b/plugins/python/regress/testdata/check_example_debugging_plugin@info.log new file mode 100644 index 000000000..0a540a4ba --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_plugin@info.log @@ -0,0 +1,4 @@ +__init__ @ SRC_DIR/example_debugging.py:45 debugs: +My demo purpose plugin shows this ERROR level debug message +__init__ @ SRC_DIR/example_debugging.py:48 debugs: +My demo purpose plugin shows this INFO level debug message diff --git a/plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log b/plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log new file mode 100644 index 000000000..8c40f67c3 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_py_calls@diag.log @@ -0,0 +1,2 @@ +DebugDemoPlugin.__init__ was called with arguments: () {'version': '1.0', 'settings': ('debug_flags=/tmp/sudo_check_python_exampleXXXXXX/debug.log py_calls@diag', 'plugin_path=python_plugin.so'), 'user_env': (), 'user_info': (), 'plugin_options': ('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin')} +DebugDemoPlugin.__init__ returned result: diff --git a/plugins/python/regress/testdata/check_example_debugging_py_calls@info.log b/plugins/python/regress/testdata/check_example_debugging_py_calls@info.log new file mode 100644 index 000000000..e235d9853 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_py_calls@info.log @@ -0,0 +1,10 @@ +DebugDemoPlugin.__init__ was called with arguments: () {'version': '1.0', 'settings': ('debug_flags=/tmp/sudo_check_python_exampleXXXXXX/debug.log py_calls@info', 'plugin_path=python_plugin.so'), 'user_env': (), 'user_info': (), 'plugin_options': ('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin')} +DebugDemoPlugin.__init__ returned result: +DebugDemoPlugin function 'show_version' is not implemented +DebugDemoPlugin function 'log_ttyin' is not implemented +DebugDemoPlugin function 'log_ttyout' is not implemented +DebugDemoPlugin function 'log_stdin' is not implemented +DebugDemoPlugin function 'log_stdout' is not implemented +DebugDemoPlugin function 'log_stderr' is not implemented +DebugDemoPlugin function 'change_winsize' is not implemented +DebugDemoPlugin function 'log_suspend' is not implemented diff --git a/plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log b/plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log new file mode 100644 index 000000000..908066b57 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_debugging_sudo_cb@info.log @@ -0,0 +1 @@ +Skipping close call, because there was no command run diff --git a/plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log b/plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log new file mode 100644 index 000000000..83c7be1b5 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_group_plugin_is_able_to_debug.log @@ -0,0 +1,4 @@ +SudoGroupPlugin.__init__ was called with arguments: () {'args': ('ModulePath=SRC_DIR/example_group_plugin.py', 'ClassName=SudoGroupPlugin'), 'version': '1.0'} +SudoGroupPlugin.__init__ returned result: +SudoGroupPlugin.query was called with arguments: ('user', 'group', ('pw_name', 'pw_passwd', 1001, 101, 'pw_gecos', 'pw_dir', 'pw_shell')) +SudoGroupPlugin.query returned result: 0 diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log.stderr b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout new file mode 100644 index 000000000..7e94c91f4 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stdout @@ -0,0 +1 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log diff --git a/plugins/python/regress/testdata/check_example_io_plugin_command_log.stored b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stored new file mode 100644 index 000000000..2a7411aa0 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_command_log.stored @@ -0,0 +1,16 @@ + -- Plugin STARTED -- +EXEC id --help +EXEC info [ + "command=/bin/id", + "runas_uid=0" +] +STD IN some standard input +STD OUT some standard output +STD ERR some standard error +SUSPEND SIGTSTP (20) +SUSPEND SIGCONT (18) +WINSIZE 200x100 +TTY IN some tty input +TTY OUT some tty output +CLOSE Command returned 1 + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stderr b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout new file mode 100644 index 000000000..7e94c91f4 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stdout @@ -0,0 +1 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log diff --git a/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored new file mode 100644 index 000000000..1b99398be --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_failed_to_start_command.stored @@ -0,0 +1,8 @@ + -- Plugin STARTED -- +EXEC cmd +EXEC info [ + "command=/usr/share/cmd", + "runas_uid=0" +] +CLOSE Failed to execute, execve returned 1 (EPERM) + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr new file mode 100644 index 000000000..97226385c --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stderr @@ -0,0 +1 @@ +Failed to construct plugin instance: (FileNotFoundError) [Errno 2] No such file or directory: '/some/not/writable/directory/sudo.log' diff --git a/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout new file mode 100644 index 000000000..4bdfc6a7a --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_fails_with_python_backtrace.stdout @@ -0,0 +1,7 @@ +Example sudo python plugin will log to /some/not/writable/directory/sudo.log +Traceback: + File "SRC_DIR/example_io_plugin.py", line 60, in __init__ + self._open_log_file(path.join(log_path, "sudo.log")) + File "SRC_DIR/example_io_plugin.py", line 132, in _open_log_file + self._log_file = open(log_path, "a") + diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display.stderr b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout new file mode 100644 index 000000000..07e998acb --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stdout @@ -0,0 +1,2 @@ +Example sudo python plugin will log to /tmp/sudo_check_python_exampleXXXXXX/sudo.log +Python Example IO Plugin version: 1.0 diff --git a/plugins/python/regress/testdata/check_example_io_plugin_version_display.stored b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stored new file mode 100644 index 000000000..45f9b9eca --- /dev/null +++ b/plugins/python/regress/testdata/check_example_io_plugin_version_display.stored @@ -0,0 +1,2 @@ + -- Plugin STARTED -- + -- Plugin DESTROYED -- diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout new file mode 100644 index 000000000..c63a26e81 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_accepted_execution.stdout @@ -0,0 +1 @@ +The command returned with exit_status 3 diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr new file mode 100644 index 000000000..6db9b2cad --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stderr @@ -0,0 +1 @@ +You are not allowed to run this command! diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_denied_execution.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr new file mode 100644 index 000000000..e8d703424 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stderr @@ -0,0 +1 @@ +Failed to execute command, execve syscall returned 2 (ENOENT) diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_failed_execution.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_list.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_list.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_list.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_list.stdout new file mode 100644 index 000000000..48c5baf51 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_list.stdout @@ -0,0 +1,25 @@ +-- minimal -- +Only the following commands are allowed: id, whoami + +-- minimal (verbose) -- +Only the following commands are allowed: id, whoami + +-- with user -- +Only the following commands are allowed: id, whoami as user 'testuser' + +-- with user (verbose) -- +Only the following commands are allowed: id, whoami as user 'testuser' + +-- with allowed program -- +You are allowed to execute command '/bin/id' + +-- with allowed program (verbose) -- +You are allowed to execute command '/bin/id' +Only the following commands are allowed: id, whoami + +-- with denied program -- +You are NOT allowed to execute command '/bin/passwd' + +-- with denied program (verbose) -- +You are NOT allowed to execute command '/bin/passwd' +Only the following commands are allowed: id, whoami diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log b/plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log new file mode 100644 index 000000000..a6f684492 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_validate_invalidate.log @@ -0,0 +1,8 @@ +SudoPolicyPlugin.__init__ was called with arguments: () {'version': '1.0', 'settings': (), 'user_env': (), 'user_info': (), 'plugin_options': ('ModulePath=SRC_DIR/example_policy_plugin.py', 'ClassName=SudoPolicyPlugin')} +SudoPolicyPlugin.__init__ returned result: +SudoPolicyPlugin.validate was called with arguments: () +SudoPolicyPlugin.validate returned result: None +SudoPolicyPlugin.invalidate was called with arguments: (1,) +SudoPolicyPlugin.invalidate returned result: None +SudoPolicyPlugin.invalidate was called with arguments: (0,) +SudoPolicyPlugin.invalidate returned result: None diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stderr b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout new file mode 100644 index 000000000..1cc1edd60 --- /dev/null +++ b/plugins/python/regress/testdata/check_example_policy_plugin_version_display.stdout @@ -0,0 +1 @@ +Python Example Policy Plugin version: 1.0 diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr new file mode 100644 index 000000000..b76ba36ad --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stderr @@ -0,0 +1,2 @@ +No plugin class is specified for python module 'SRC_DIR/example_debugging.py'. Use 'ClassName' configuration option in 'sudo.conf' +Failed during loading plugin class diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_classname.stdout b/plugins/python/regress/testdata/check_loading_fails_missing_classname.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_path.stderr b/plugins/python/regress/testdata/check_loading_fails_missing_path.stderr new file mode 100644 index 000000000..05bc634db --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_missing_path.stderr @@ -0,0 +1,2 @@ +No python module path is specified. Use 'ModulePath' plugin config option in 'sudo.conf' +Failed during loading plugin class diff --git a/plugins/python/regress/testdata/check_loading_fails_missing_path.stdout b/plugins/python/regress/testdata/check_loading_fails_missing_path.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr new file mode 100644 index 000000000..e2e090e3c --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stderr @@ -0,0 +1 @@ +Failed during loading plugin class: (ImportError) File 'SRC_DIR/example_debugging.py' must be owned by uid 0 diff --git a/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stdout b/plugins/python/regress/testdata/check_loading_fails_not_owned_by_root.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr new file mode 100644 index 000000000..bf246e3b4 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stderr @@ -0,0 +1,2 @@ +Failed to find plugin class 'MispelledPluginName' +Failed during loading plugin class: (AttributeError) module 'example_debugging' has no attribute 'MispelledPluginName' diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stdout b/plugins/python/regress/testdata/check_loading_fails_wrong_classname.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr new file mode 100644 index 000000000..64a3b2897 --- /dev/null +++ b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stderr @@ -0,0 +1 @@ +Failed during loading plugin class: (ModuleNotFoundError) No module named 'wrong_path' diff --git a/plugins/python/regress/testdata/check_loading_fails_wrong_path.stdout b/plugins/python/regress/testdata/check_loading_fails_wrong_path.stdout new file mode 100644 index 000000000..e69de29bb