aboutsummaryrefslogtreecommitdiff
path: root/awwan_play_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.
2025-10-03all: add option "$noparse" for magic "#put" commandShulhan
The "$noparse" option allow copying file without reading and parsing the input file.
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-12-22all: check script file is a directoryShulhan
This changes we make sure that the passed script path is not a directory to prevent error when running play with unknown host name.
2023-11-16all: refactoring, rename Request to ExecRequestShulhan
2023-10-30all: pass Request when creating new SSH clientShulhan
Instead of passing stdout and stderr as "io.Writer", pass the Request, so we can log using the Request mlog. While at it, return error from sshClient rmdirAll so the caller can log the error.
2023-10-30all: log all execution into fileShulhan
For each script execution, a file suffixed with ".log" will be created in the same directory with the same name as script file. For example, if the script is path is "a/b/c.aww" then the log file would named "a/b/c.aww.log". This is to provides history and audit in the future.
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-22all: add magic command "#local"Shulhan
The magic command "#local" define the command to be executed using shell in local environment. Its have effect and can only be used in script that executed using "play". In script that is executed using "local" it does nothing.
2023-10-21all: implement remote "#get!" and "#put!" with owner and modeShulhan
When script with magic command "#get!" or "#put!" executed using "play" command, one can changes the owner and/or permission mode by setting the user/group and permission bits after the magic command, for example, #get!user:group+0600 src dst Will changes the owner of dst in local into "user:group" with permission "0600", while #put!user:group+0600 src dst Will changes the owner of dst in remote into "user:group" with permission "0600".
2023-10-21all: implement remote "#get:" and "#put:" with owner and modeShulhan
In remote environment, using magic command "#get:" or "#put:" with owner and mode like "#get:$OWNER+$MODE" or "#put:$OWNER+MODE" will changes the file owner to $USER or $GROUP and/or permission to $MODE. The file owner will not works if user does not have permission.