aboutsummaryrefslogtreecommitdiff
path: root/sudo_test.go
AgeCommit message (Collapse)Author
2026-02-15all: fix data race in Play and in integration testsShulhan
When the Play command executed from the web user interface, there is a possibility that concurrent requests set the sshConfig field in Awwan struct at the same time. In the integration tests for TestAwwan_Play_withLocal and TestExecLocal_sudo, the data race happens when writing to the same buffer for stdout and stderr, so we split them into separate buffers. There is also data race in SSE connection, when handler for ExecuteTail write to the same buffer with worker keep alive. This has been fixed on pakakeh.go module.
2024-03-22all: replace module "share" with "pakakeh.go"Shulhan
The "share" project has been moved to SourceHut with new name "pakakeh.go".
2023-12-22all: add [context.Context] to Local and PlayShulhan
Passing context allow the command Local or Play to be cancelled when running in asynchronous mode, in this case when awwan run with WUI.
2023-11-20all: do not changes the Script path in the response of HTTP ExecuteShulhan
Previously, the ExecRequest from HTTP Execute endpoint changes the Script value to the absolute script path in the system. This changes fix this issue to minimize inconsistency between request and response.
2023-11-16all: refactoring, rename Request to ExecRequestShulhan
2023-10-26all: use "mlog.MultiLogger" to log Request output and errorShulhan
By using "mlog.MultiLogger" every output or error can be written to stdout/stderr and additional log writer that can collect both of them, buffered and returned to the caller. This changes simplify the HttpResponse to use only single output that combine both stdout and stderr.
2023-10-17session: use the raw statement when adding "-S" option in ExecLocalShulhan
Previously, when refactoring ExecLocal in bf9c8226b4d to support sudo with -S option, we generate the raw command by concatenating Statement args field. This model does not works if the raw command contains double quote that needs to be executed as is. This changes fix this issue by adding "-S" option to raw command.
2023-10-14all: add integration test for executing local command with sudoShulhan