aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile.am
AgeCommit message (Collapse)AuthorFiles
2023-01-22Update copyright yearsSergey Poznyakoff1
2022-08-06Fix component shutdown.Sergey Poznyakoff1
* NEWS: Document changes. * doc/pies.texi: Document changes. * src/cmdline.opt: New option --list-shutdown-sequence * src/comp.c (compute_shutdown_sequence) (component_shutdown_list,components_list_shutdown_sequence) (components_shutdown_sequence_numbers): New functions. (component_config_commit): Compute shutdown sequences for each component. * src/pies.c: Handle the --list-shutdown-sequence option. * src/pies.h (component) <shutdown_seqno>: New field. (components_list_shutdown_sequence) (components_shutdown_sequence_numbers): New prototypes. * src/progman.c (progman_gc): Rewrite. (progman_stop): Rewrite. * tests/shdnseq.at: New test. * tests/sigwait.c: Take options -n and -f FILE. Open file in append mode. Lock it before writing. * tests/Makefile.am: Add new test. * tests/testsuite.at: Include new test.
2022-08-04Configurable termination signalSergey Poznyakoff1
* NEWS: Document changes. * doc/pies.texi: Document changes. * src/comp.c (component_create): Initialize sigterm field. * src/pies.h (component): New field: sigterm. * src/pies.c (strtosignum): New function. (create_action): Use strtosignum. (_cb_signal): New callback. (component_keywords): New keyword "sigterm". * src/progman.c (prog_sigterm): New function. (link_prog, progman_cleanup) (progman_stop_component): Use prog_sigterm. (print_status): Change semantics of expect_term: it means termination signal, if not 0. * tests/sigterm.at: New test. * tests/sigwait.c: New test program. * tests/Makefile.am: Add new test. (noinst_PROGRAMS): Add sigwait. * tests/testsuite.at: Include new test.
2022-01-02Update copyright yearSergey Poznyakoff1
2021-01-06Update copyright yearsSergey Poznyakoff1
2020-12-08Global env statement.Sergey Poznyakoff1
* NEWS: Update. * doc/pies.texi: Document the global env statement. * src/pies.c: Modify "env" callbacks to expect a envop_t ** as modifiable target. Introduce global env statement. * tests/envglobal.at: New test. * tests/Makefile.am: Add new file.
2020-12-02New component flag: expandenvSergey Poznyakoff1
* NEWS: Update. * doc/pies.texi: Document the expandenv flag. * src/comp.c (component_finish): Warn if both "shell" and "expandenv" are used together. Expand command to argc/argv only unless the CF_EXPANDENV flag is given. * src/pies.c (str_to_cf): New flag: expandenv * src/pies.h (CF_EXPANDENV): New define. * src/prog.h (struct prog): New member: argv. * src/progman.c (destroy_prog): Free argv. (prog_start_prologue): Expand the command line taking into account the current environment if CF_EXPANDENV flag is given. Otherwise, copy the component argv to the prog. (prog_execute): Use prog->v.p.argv * tests/Makefile.am: Add expandenv.at * tests/testsuite.at: Likewise. * tests/expandenv.at: New file.
2020-10-17Update copyright yearsSergey Poznyakoff1
2019-06-24Add missing libintl libraries in testsSergey Poznyakoff1
2019-06-12Check accept components and inet built-in services.Sergey Poznyakoff1
* src/comp.c (component_verify,component_finish): Fix check for the presense of the "command" statement. * src/pies.c (component_keywords): Reorder some entries for the consistency of config-help output. * tests/.gitignore: Add new files. * tests/Makefile.am: Add new tests and noinst programs. * tests/accept.at: New test. * tests/builtin.at: New test. * tests/chargen.c: New file. * tests/readtime.c: New file. * tests/recvfd.c: Rewrite for testing both accept and pass-fd components. * tests/passfd.at: Pass -s option to recvfd * tests/testsuite.at: Add new tests. * tests/lines.c: Minor changes. * tests/nt.c: Minor changes. * tests/to.c: Minor changes.
2019-06-11Test pass-fd componentsSergey Poznyakoff1
* tests/recvfd.c: New source. * tests/.gitignore: Update. * tests/passfd.at: New test. * tests/Makefile.am: Add new test. * tests/testsuite.at: Add new test. * tests/nt.c: Check all revents bits.
2019-06-11Improve the nt tool. Test inet running instance limit.Sergey Poznyakoff1
* tests/Makefile.am: 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/testsuite.at (PIES_CONTROL_INIT): Rename pidfile to PIES_PIDFILE and ctlsock to PIES_CTLSOCK. Export both. Include maxinst.at * tests/control.at: Use new variables. * tests/inet.at: Remove the env block. * tests/iobuf.h (iobuf_copy): Return number of bytes copied. * tests/maxinst.at: 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/Makefile.am: 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/Makefile.am: New auxtool: aux/in.test New test: inet.at * tests/aux/in.test: New file. * tests/inet.at: New file. * tests/iobuf.h: New file. * tests/nt.c: New file. * tests/testsuite.at: 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/Makefile.am: Update. * tests/env.at: Use to to avoid hanging forever. Add missing popdef. * tests/redirect.at: Use echo as component program. * tests/respawn.at: Run pies in foreground. Use to to limit execution time. * tests/shell.at: Likewise. * tests/shutdown.at: Likewise. * tests/startup.at: Likewise. * tests/ret-exec.at: Use sleepexit as component program. * tests/ret-notify.at: 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/Makefile.am: 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/Makefile.am: Add new tests. * tests/testsuite.at: Add environment tests. * tests/envop.at: New file. * tests/envtest.c: New file. * tests/env.at: New file. * tests/redirect.at: 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/Makefile.am: Add new tests. * tests/testsuite.at: Add new tests. * tests/aux/respawn: Change default timeout to 1 second. * tests/respawn.at: Minor change. * tests/shell.at: 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/shutdown.at: New test. * tests/Makefile.am: Add new test. * tests/testsuite.at: Likewise. * tests/aux/startup: Rename to tests/aux/touchfile * tests/startup.at: 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/atlocal.in (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/redirect.at: Start components from $auxdir. * tests/respawn.at: Likewise. * tests/ret-exec.at: Likewise. * tests/ret-notify.at: Likewise. * tests/startup.at: New file. * tests/testsuite.at: Include startup.at * tests/Makefile.am: 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/Makefile.am: Add new test. * tests/atlocal.in (trimws): New function. * tests/cyclic.at: New test. * tests/testsuite.at: 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.