path: root/tests/
AgeCommit message (Collapse)AuthorFiles
2019-06-11Test pass-fd componentsSergey Poznyakoff1
* tests/recvfd.c: New source. * tests/.gitignore: Update. * tests/ New test. * tests/ Add new test. * tests/ Add new test. * tests/nt.c: Check all revents bits.
2019-06-11Improve the nt tool. Test inet running instance limit.Sergey Poznyakoff1
* tests/ Add new test. * tests/aux/in.test (PIESCTL): Provide the necessary options. Discontinue the use of STOPCMD environment variable. New commands: enable, sleep, touch. * tests/ (PIES_CONTROL_INIT): Rename pidfile to PIES_PIDFILE and ctlsock to PIES_CTLSOCK. Export both. Include * tests/ Use new variables. * tests/ Remove the env block. * tests/iobuf.h (iobuf_copy): Return number of bytes copied. * tests/ New file. * tests/nt.c (netcat_stream_disconnect): New function. (netcat_stream_read): Disconnect the peer stream if no more input is available and the peer is not available for output (i.e. its output buffer is empty). (netcat_stream_write): Stop polling if output buffer is empty. (netcat): Fix event mask
2019-06-09Test inetd components.Sergey Poznyakoff1
* lib/ Add urlconn.c * lib/libpies.h (url_connect): New proto. * lib/urlconn.c: New file. * src/piesctl.c (shttp_connect): Use url_connect. * tests/.gitignore: Update. * tests/ New auxtool: aux/in.test New test: * tests/aux/in.test: New file. * tests/ New file. * tests/iobuf.h: New file. * tests/nt.c: New file. * tests/ Add new test. * tests/to.c: explicitly terminate the child process on timeout.
2019-06-02Rewrite the testsuiteSergey Poznyakoff1
The aim is to run pies in foreground if possible. Limit execution time using external wrapper. * src/pies.c: (_cb_redir): Consistently return 1 on errors. * tests/aux/sleepexit: New file. * tests/aux/startcheck: New file. * tests/aux/touchfile: Change arguments. * tests/aux/respawn: Rewrite. * tests/lines.c: New noinst program. * tests/to.c: New noinst program. * tests/.gitignore: Add new programs. * tests/ Update. * tests/ Use to to avoid hanging forever. Add missing popdef. * tests/ Use echo as component program. * tests/ Run pies in foreground. Use to to limit execution time. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Use sleepexit as component program. * tests/ Likewise.
2019-06-02New configuration statement for manipulating the environment.Sergey Poznyakoff1
The "env" statement is now a compound statement. It can contain four substatements: "clear" to clear the environment, "keep" to retain certain variable while clearing it, "set" to set a variable, and "unset" to unset a variable or variables. Both "keep" and "unset" can take globbing pattern as their argument, in which case they affect all variable matching that pattern. The value part in the "set" statement is subject to variable expansion, e.g. set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man" The support for the old one-line syntax of "env" is retained for backward compatibility. This commit also fixes redirection to a file: new data are appended to the file, instead of overwriting it. * lib/ Add new files. * lib/envop.c: New file. * lib/envop.h: New file. * lib/wildmatch.c: New file. * src/comp.c (component_free): Update. * src/pies.c (argv_free): New function. (parse_legacy_env): New function. (_cb_env): Remove. (cb_env_section_parser): New function. (cb_env_keywords): New keywords for the "env" block statement: clear, keep, set, unset. (component_keywords): New compount statement: env. Old usage retained for backward compatibility. * src/pies.h: Include "envop.h" (component)<env>: Remove. <envop>: New field. * src/prog.h (prog)<env>: New field. * src/progman.c (redirect_to_file): Position to the end of file. (DEBUG_ENVIRON): Remove macro. (debug_environ): New function. (environ_setup): Remove. (prog_sockenv): Use environ_set to modify local copy of environment. (prog_start_prologue): Use environ_create + envop_exec to create and modify the environment. (prog_execute): Set environment to prog-local copy. * tests/.gitignore: Build envtest * tests/ Add new tests. * tests/ Add environment tests. * tests/ New file. * tests/envtest.c: New file. * tests/ New file. * tests/ Check first two lines of the output file.
2019-05-31Provide an option to run commands via sh -cSergey Poznyakoff1
The new flag "shell" instructs pies to run the command marked with it as '/bin/sh -c $command'. Alternative shell can be supplied ising the 'program' statement. This is useful if the command line uses shell-specific features (command or variable expansion, redirection, pipes, etc.) This commit also fixes a bug in the 'env' statement handling: a single argument with embedded whitespaces was undergoing word splitting and thus incorrectly handled as multiple arguments. * NEWS: Document changes. * doc/pies.texi: Likewise. * src/comp.c (component_free): Free command. (component_finish): Split command into argv/argc as directed by the CF_SHELL flag. * src/pies.c (_cb_command): Remove. Functionality moved to component_finish(). (_cb_env): Bugfix. Don't split arguments. * src/pies.h (CF_SHELL): New flag. (component) <command>: New member. * tests/ Add new tests. * tests/ Add new tests. * tests/aux/respawn: Change default timeout to 1 second. * tests/ Minor change. * tests/ New test.
2019-05-24Implement shutdown componentsSergey Poznyakoff1
* src/pies.h: Update comment. * src/progman.c (register_prog0): Register shutdown components in disabled state. (program_shutdown): New function. (progman_stop): Call program_shutdown. * tests/ New test. * tests/ Add new test. * tests/ Likewise. * tests/aux/startup: Rename to tests/aux/touchfile * tests/ Reflect the change.
2019-05-24Initial implementation of "startup" components.Sergey Poznyakoff1
These are components that are run at program startup. Starting other components is delayed until all startup components terminate. This is similar to SysV "bootwait" components. Upon termination, startup components are removed from the configuration. They are not renewed upon configuratuion reload. * src/comp.c (comp_array_remove): Remove from the depmap as well. (component_ref_decr): Use comp_array_remove for active components and plain component_free for inactive ones. (component_build_depmap): Use comp_array_remove. (component_config_commit): Special handling for pies_comp_startup components. * src/pies.c (modetab): New component modes: "startup" and "shutdown". (main): Run program_init_startup. * src/pies.h (pies_comp_mode): New modes: pies_comp_startup and pies_comp_shutdown. (program_init_startup): New proto. * src/progman.c (progman_waiting_p): Return 1 if a startup component is still running. (program_init_startup): New function. (progman_cleanup): Handle pies_comp_startup termination. * src/socket.c (switch_eids): Avoid unnecessary calls to setegid and seteuid. * tests/ (auxdir): New variable. * tests/mailer: Move to tests/aux/ * tests/respawn: Move to tests/aux/ * tests/retcode: Move to tests/aux/ * tests/aux/startup: New auxiliary program. * tests/ Start components from $auxdir. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ New file. * tests/ Include * tests/ Add new tests.
2019-05-23Update copyright yearsSergey Poznyakoff1
2019-05-23Revise dependency handling. Correctly display cyclic dependencies.Sergey Poznyakoff1
* src/comp.c (component_log_dep): Remove. (report_cyclic_dependency): New function. (comp_array_remove): New function. (component_build_depmap): Remove erroneous components both from the component table and dependency map. (components_dump_depmap): Avoid trailing whitespace in the output. * src/depmap.c (depmap_clear_all): Remove. (depmap_remove): New function. * src/pies.h (CF_REMOVE): New flag. (depmap_clear_all): Remove prototype. (depmap_remove): New prototype. * tests/ Add new test. * tests/ (trimws): New function. * tests/ New test. * tests/ Include new test.
2017-01-02Happy GNU YearSergey Poznyakoff1
2016-03-19Add testsuteSergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.