summaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Add parser and printer for coredump filter maskZbigniew Jędrzejewski-Szmek2020-04-092-0/+82
|
* basic/parse-util: add safe_atoux64()Zbigniew Jędrzejewski-Szmek2020-04-091-0/+39
|
* string-util: make sure we eat even half complete words in split()Lennart Poettering2020-04-021-0/+6
| | | | | | | | | split() and FOREACH_WORD really should die, and everything be moved to extract_first_word() and friends, but let's at least make sure that for the remaining code using it we can't deadlock by not progressing in the word iteration. Fixes: #15305
* Merge pull request #15251 from keszybz/coverity-fixesLennart Poettering2020-03-301-1/+1
|\ | | | | A few small fixups for stuff found by coverity
| * test-strv: add missing oom checkZbigniew Jędrzejewski-Szmek2020-03-281-1/+1
| | | | | | | | CID#1420259.
* | Merge pull request #14338 from keszybz/functional-test-reworkFrantisek Sumsal2020-03-3011-24/+43
|\ \ | | | | | | Functional test rework
| * | test-fileio: fix bogus error when /proc/cmdline contains newlinesZbigniew Jędrzejewski-Szmek2020-03-281-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel does not sanitize /proc/cmdline. E.g. when running under qemu, it is easy to pass a string with newline by mistake. We use read_one_line_file(), so we would read only the first list of the file, and write_string_file(WRITE_STRING_FILE_VERIFY_ON_FAILURE) would fail because the target file is obviously different. Change to a kernel-generated file to avoid the issue. v2: - use /proc/version instead of /proc/uptime for attempted writes, so the test test passes even if test_write_string_file_verify() takes more than 10 ms ;]
| * | tests: move unit files to units/ subdirectoryZbigniew Jędrzejewski-Szmek2020-03-1910-16/+35
| | | | | | | | | | | | | | | We have a bazillion of those unit files, and keeping them all directly in tests/ has become rather unwieldy.
* | | ci: turn off FuzzBuzzEvgeny Vereshchagin2020-03-301-4/+1
| | | | | | | | | | | | I don't think anyone uses it.
* | | sd-path: handle case of missing runtime dir in testZbigniew Jędrzejewski-Szmek2020-03-271-4/+12
| | | | | | | | | | | | Also document it in the man page.
* | | Rename _PATH variables to _DIR when they refer to a directoryZbigniew Jędrzejewski-Szmek2020-03-271-51/+51
| | | | | | | | | | | | | | | We were very inconsistent in this, but in general _PATH signifies a search path (separated with :), and _DIR signifies a single directory.
* | | sd-path: rename the two functionsZbigniew Jędrzejewski-Szmek2020-03-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think the two names were both pretty bad. They did not give a proper hint what the difference between the two functions is, and sd_path_home sounds like it is somehow related to /home or home directories or whatever, when in fact both functions return the same set of paths as either a colon-delimited string or a strv. "_strv" suffix is used by various functions in sd-bus, so let's reuse that. Those functions are not public yet, so let's rename.
* | | test-sd-path: basic test for the sd-path APIZbigniew Jędrzejewski-Szmek2020-03-272-0/+65
| |/ |/|
* | user-util: Allow names starting with a digitBalint Reczey2020-03-271-2/+2
|/ | | | | | | | In 1a29610f5fa1bcb2eeb37d2c6b79d8d1a6dbb865 the change inadvertedly disabled names with digit as the first character. This follow-up change allows a digit as the first character in compat mode. Fixes: #15141
* core: add support for setting CPUAffinity= to special "numa" valueMichal Sekletár2020-03-161-3/+3
| | | | | | | systemd will automatically derive CPU affinity mask from NUMA node mask. Fixes #13248
* Merge pull request #14901 from w-simon/fix-testsChris Down2020-03-112-52/+95
|\ | | | | test: fix some failures in test-cgroup
| * meson: mark test-cgroup as standardZbigniew Jędrzejewski-Szmek2020-03-101-2/+1
| |
| * test-cgroup: do not require root to passZbigniew Jędrzejewski-Szmek2020-03-101-29/+54
| | | | | | | | | | Nowadays with delegation to the user instance, we can make this work as non-root easily. If we still get access denied, just skip the test.
| * test-cgroup: fix memleakZbigniew Jędrzejewski-Szmek2020-03-101-0/+3
| | | | | | | | https://github.com/systemd/systemd/pull/14901#issuecomment-587924705.
| * test-cgroup: split into functions as usualZbigniew Jędrzejewski-Szmek2020-03-101-24/+38
| |
| * test: fix some failures in test-cgroupWen Yang2020-02-181-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following issues in test-cgroup: 1, commit 65be7e06528a ("pid1: do not reset subtree_control on already-existing units with delegation") changed the return value of cg_create () as follows: "Returns 0 if the group already existed, 1 on success, negative otherwise." So we need to modify the test cases related to cg_create (). 2, commit efdb02375beb ("core: unified cgroup hierarchy support") changed cg_delete () to cg_rmdir (), so the test cases also need to be adjusted a bit. 3. There is no cleanup of "test-a". If we execute test-cgroup multiple times, we will encounter an error. Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
* | Merge pull request #15033 from yuwata/state-directory-migrate-issueZbigniew Jędrzejewski-Szmek2020-03-091-0/+1
|\ \ | | | | | | execute: Fix migration from DynamicUser=yes to no
| * | test: add a test case for migrating DynamicUser=yes to noYu Watanabe2020-03-061-0/+1
| | |
* | | test: Add test for setting generator paths via environmentBenjamin Berg2020-03-041-6/+45
|/ /
* | make namespace_flags_to_string() not return empty stringYu Watanabe2020-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | This improves the following debug log. Before: systemd[1162]: Restricting namespace to: . After: systemd[1162]: Restricting namespace to: n/a.
* | Merge pull request #15009 from keszybz/version-and-doc-updatesZbigniew Jędrzejewski-Szmek2020-03-032-2/+2
|\ \ | | | | | | Version and doc updates
| * | tree-wide: fix spelling of lookup and setup verbsZbigniew Jędrzejewski-Szmek2020-03-032-2/+2
| | | | | | | | | | | | "set up" and "look up" are the verbs, "setup" and "lookup" are the nouns.
* | | basic/fs-util: add a version of chmod_and_chown that doesn not use /procZbigniew Jędrzejewski-Szmek2020-03-031-0/+45
|/ /
* | test-sizeof: print size socklen_tZbigniew Jędrzejewski-Szmek2020-03-021-0/+3
| | | | | | | | | | | | It returns 32 bits, unsigned on amd64, so it's probably similar everywhere with glibc. But let's make the code generic, without assuming specific size or signedness.
* | execute: Make '+' exec prefix ignore PrivateTmp=yesNate Jones2020-02-291-0/+1
| | | | | | | | | | | | | | | | The man pages state that the '+' prefix in Exec* directives should ignore filesystem namespacing options such as PrivateTmp. Now it does. This is very similar to #8842, just with PrivateTmp instead of PrivateDevices.
* | shared/ask-password-api: show "(press TAB for no echo)"Zbigniew Jędrzejewski-Szmek2020-02-061-1/+1
| | | | | | | | | | | | | | | | For #8495: it is arguably useful to not show the length of the password in public spaces. It is possible to press TAB or BS to cancel the asterisks, but this is not very discoverable. Let's make it discoverable by showing a message (in gray). The message is "erased" after the first character is entered.
* | shared/ask-password-api: return "error" when dialogue is cancelledZbigniew Jędrzejewski-Szmek2020-02-061-9/+11
| | | | | | | | | | | | | | | | test-ask-password-api would crash if ^D was pressed. If think the callers generally expect a non-empty strv as reply. Let's return an error if we have nothing to return. Also modernize test-ask-password-api a bit.
* | Merge pull request #14589 from keszybz/sysctl-downgrade-messagesZbigniew Jędrzejewski-Szmek2020-02-042-0/+48
|\ \ | | | | | | sysctl: add glob patterns to set network settings more flexibly
| * | shared/sysctl-util: normalize repeated slashes or dots to a single valueZbigniew Jędrzejewski-Szmek2020-01-302-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | We use those strings as hash keys. While writing "a...b" looks strange, "a///b" does not look so strange. Both syntaxes would actually result in the value being correctly written to the file, but they would confuse our de-deplication over keys. So let's normalize. Output also becomes nicer. Add test.
* | | util: uid_t, gid_t, and pid_t must be 32bitYu Watanabe2020-02-021-2/+0
| | | | | | | | | | | | | | | We already have assert_cc(sizeof(uid_t) == sizeof(uint32_t)) or friends at various places.
* | | Merge pull request #14178 from poettering/journal-namespaceLennart Poettering2020-02-013-0/+5
|\ \ \ | | | | | | | | journal: add concept of "journal namespaces"
| * | | journal: properly mark two definitions that are deprecated with GCC ↵Lennart Poettering2020-01-311-0/+3
| | | | | | | | | | | | | | | | attributes for that
| * | | core: add new LogNamespace= execution settingLennart Poettering2020-01-312-0/+2
| | | |
* | | | test: also check the result of merge_gid_lists()Yu Watanabe2020-01-311-0/+4
|/ / / | | | | | | | | | Fixes CID#1412354.
* | | test: fix rename_noreplace() testLennart Poettering2020-01-281-2/+2
| | | | | | | | | | | | | | | This corrects the fix b81b9d406de, making the test operate like it was originally.
* | | test: make sure chase_symlink() returns normalized pathsLennart Poettering2020-01-281-0/+1
| | |
* | | test: add test for the non-resolving of chase_symlink() root prefixLennart Poettering2020-01-281-0/+9
| | |
* | | test: add tests for UNESCAPE_ACCEPT_NULYu Watanabe2020-01-271-0/+16
| | |
* | | network,udev: use uint64_t for bit rateYu Watanabe2020-01-211-16/+16
| | | | | | | | | | | | Fixes #14620.
* | | test: add test for https://github.com/systemd/systemd/issues/14560Lennart Poettering2020-01-201-0/+2
|/ /
* | shared: split out crypt() specific helpers into its own .c/.h in src/shared/Lennart Poettering2020-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | This way we can use libxcrypt specific functionality such as crypt_gensalt() and thus take benefit of the newer algorithms libxcrypt implements. (Also adds support for a new env var $SYSTEMD_CRYPT_PREFIX which may be used to select the hash algorithm to use for libxcrypt.) Also, let's move the weird crypt.h inclusion into libcrypt.h so that there's a single place for it.
* | Merge pull request #14562 from yuwata/table-strvZbigniew Jędrzejewski-Szmek2020-01-152-10/+130
|\ \ | | | | | | introduce TABLE_STRV and use it in networkctl and resolvectl
| * | test-format-table: add tests for TABLE_STRVYu Watanabe2020-01-151-0/+114
| | |
| * | strv: introduce strv_compare()Yu Watanabe2020-01-151-10/+16
| | |
* | | Merge pull request #14547 from keszybz/networkctl-matchingYu Watanabe2020-01-151-4/+6
|\ \ \ | |/ / |/| | networkctl: return error or warning when interfaces are not matched