summaryrefslogtreecommitdiff
path: root/src/test/test-process-util.c
Commit message (Collapse)AuthorAge
* Prep v240: Fix tests running on systems with non-UTF-8 locales.Sven Eden2018-11-08
| | | | | | Bug: #85 Closes: #85 Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
* Prep v239: Do not test ioprio_class_from_to_string()Sven Eden2018-08-24
| | | | elogind doesn't need and thus does not support it.
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-08-24
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-08-24
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* process-util: also filter non-printable characters in get_process_com()Lennart Poettering2018-08-24
| | | | | | | | | | | | We already do that in get_process_cmdline(), which is very similar in behaviour otherwise. Hence, let's be safe and also filter them in get_process_comm(). Let's try to retain as much information as we can though and escape rather than suppress unprintable characters. Let's not increase comm names beyond the kernel limit on such names however. Also see discussion about this here: https://marc.info/?l=linux-api&m=152649570404881&w=2
* missing: define kernel internal limit TASK_COMM_LEN in userspace tooLennart Poettering2018-08-24
| | | | | We already use it at two places, and we are about to add one too. Arbitrary literally hardcoded limits suck.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* tests: make / private after creating a mount namespaceEvegeny Vereshchagin2018-06-28
| | | | | | so that the test never affects the root namespace. (cherry picked from commit c58fd466a313a1f93df1792822e358c67990bcdf)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/test (6/6)
* test-process-util: one more (void)Zbigniew Jędrzejewski-Szmek2018-05-30
|
* test: test-process-util additionsLennart Poettering2018-05-30
| | | | | Add some extra paranoia tests that PTR_TO_PID() and PID_TO_PTR() deals correctly with negative PID.
* tree-wide: use EXIT_SUCCESS/EXIT_FAILURE in exit() where we canLennart Poettering2018-05-30
|
* tree-wide: introduce new safe_fork() helper and port everything overLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new safe_fork() wrapper around fork() and makes use of it everywhere. The new wrapper does a couple of things we previously did manually and separately in a safer, more correct and automatic way: 1. Optionally resets signal handlers/mask in the child 2. Sets a name on all processes we fork off right after forking off (and the patch assigns useful names for all processes we fork off now, following a systematic naming scheme: always enclosed in () – in order to indicate that these are not proper, exec()ed processes, but only forked off children, and if the process is long-running with only our own code, without execve()'ing something else, it gets am "sd-" prefix.) 3. Optionally closes all file descriptors in the child 4. Optionally sets a PR_SET_DEATHSIG to SIGTERM in the child, in a safe way so that the parent dying before this happens being handled safely. 5. Optionally reopens the logs 6. Optionally connects stdin/stdout/stderr to /dev/null 7. Debug logs about the forked off processes.
* Prep v236 : Add missing SPDX-License-Identifier (8/9) src/testSven Eden2018-03-26
|
* test-process-util: add (void) cast to make coverity happyZbigniew Jędrzejewski-Szmek2017-11-27
| | | | | The intent is for the call to succeed only when privileged, so make that clear.
* build-sys: use #if Y instead of #ifdef Y everywhereZbigniew Jędrzejewski-Szmek2017-11-23
| | | | | | | | | | | | | | | The advantage is that is the name is mispellt, cpp will warn us. $ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/" $ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;' $ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g' $ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g' + manual changes to meson.build squash! build-sys: use #if Y instead of #ifdef Y everywhere v2: - fix incorrect setting of HAVE_LIBIDN2
* Prep v235: Add missing includes and dependencies.Sven Eden2017-08-14
|
* Prep v235: Apply upstream fixes (9/10) [src/test]Sven Eden2017-08-14
|
* Prep v233.3: Add all possible coverage tests for elogindSven Eden2017-07-20