summaryrefslogtreecommitdiffstats
path: root/src/test/test-cgroup-setup.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test: use ASSERT_OK_ERRNO() for setenv() and unsetenv()Yu Watanabe2024-08-011-15/+15
|
* I made more unit test to use the test macroUsman Akinyemi2024-04-081-13/+13
|
* meson: drop default-hierarchy= option, always use unifiedMike Yuan2024-02-271-3/+1
|
* tree-wide: drop unnecessary inclusion of version.hYu Watanabe2023-07-291-1/+0
|
* test: allow to set NULL to intro or outroYu Watanabe2022-02-021-1/+1
| | | | Addresses https://github.com/systemd/systemd/pull/22338#discussion_r796741033.
* tests: rework test macros to not take code as parametersLennart Poettering2022-02-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | C macros are nasty. We use them, but we try to be conservative with them. In particular passing literal, complex code blocks as argument is icky, because of "," handling of C, and also because it's quite a challange for most code highlighters and similar. Hence, let's avoid that. Using macros for genreating functions is OK but if so, the parameters should be simple words, not full code blocks. hence, rework DEFINE_CUSTOM_TEST_MAIN() to take a function name instead of code block as argument. As side-effect this also fixes a bunch of cases where we might end up returning a negative value from main(). Some uses of DEFINE_CUSTOM_TEST_MAIN() inserted local variables into the main() functions, these are replaced by static variables, and their destructors by the static destructor logic. This doesn't fix any bugs or so, it's just supposed to make the code easier to work with and improve it easthetically. Or in other words: let's use macros where it really makes sense, but let's not go overboard with it. (And yes, FOREACH_DIRENT() is another one of those macros that take code, and I dislike that too and regret I ever added that.)
* test: Use TEST macro in more casesJan Janssen2021-11-251-20/+20
| | | | | | | | | | | | | | | This converts to TEST macro in less trivial cases. This is mostly due to having an intro or outro before/after the actual tests. Some notable changes: - add a "test" to make sure the hashmap and ordered_hashmap tests from different compilation units are actually run in test-hashmap.c - make root arg a global var in test-install-root.c - slightly rework an EFI specific test in test-proc-cmdline.c - usage of saved_argv/saved_argc in test-process-util.c - splitting test-rlimit-util.c into several tests - moving the hwdb open check into intro in test-sd-hwdb.c - condense several "tests" into one in test-udev-util.c
* meson: simplify the BUILD_MODE conditionalZbigniew Jędrzejewski-Szmek2021-04-141-1/+1
| | | | | | | Using a enum is all nice and generic, but at this point it seems unlikely that we'll add further build modes. But having an enum means that we need to include the header file with the enumeration whenerever the conditional is used. I want to use the conditional in log.h, which makes it hard to avoid circular imports.
* shared/build: make the version string definition less terribleZbigniew Jędrzejewski-Szmek2020-12-031-1/+1
| | | | | | | | | | | | | | | | | | | The BLKID and ELFUTILS strings were present twice. Let's reaarange things so that each times requires definition in exactly one place. Also let's sort things a bit: the "heavy hitters" like PAM/MAC first, then crypto libs, then other libs, alphabetically, compressors, and external compat integrations. I think it's useful for users to group similar concepts together to some extent. For example, when checking what compression is available, it helps a lot to have them listed together. FDISK is renamed to LIBFDISK to make it clear that this is about he library and the executable.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* tests: various small fixes for strict systemsTopi Miettinen2020-04-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | Don't assume that 4MB can be allocated from stack since there could be smaller DefaultLimitSTACK= in force, so let's use malloc(). NUL terminate the huge strings by hand, also ensure termination in test_lz4_decompress_partial() and optimize the memset() for the string. Some items in /proc and /etc may not be accessible to poor unprivileged users due to e.g. SELinux, BOFH or both, so check for EACCES and EPERM. /var/tmp may be a symlink to /tmp and then path_compare() will always fail, so let's stick to /tmp like elsewhere. /tmp may be mounted with noexec option and then trying to execute scripts from there would fail. Detect and warn if seccomp is already in use, which could make seccomp test fail if the syscalls are already blocked. Unset $TMPDIR so it will not break specifier tests where %T is assumed to be /tmp and %V /var/tmp.
* util-lib: move some functions from basic/cgroup-util to shared/cgroup-setupZbigniew Jędrzejewski-Szmek2019-09-161-0/+67
This way less stuff needs to be in basic. Initially, I wanted to move all the parts of cgroup-utils.[ch] that depend on efivars.[ch] to shared, because efivars.[ch] is in shared/. Later on, I decide to split efivars.[ch], so the move done in this patch is not necessary anymore. Nevertheless, it is still valid on its own. If at some point we want to expose libbasic, it is better to to not have stuff that belong in libshared there.