summaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAge
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
| | | | | | | | | | | | | | This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.
* Prep v220: Remove all source files, taht are not needed to build elogind.Sven Eden2017-03-14
| | | | | | | | | | Prep v220: Remove not needed headers, round 1 Prep v220: Remove not needed headers, round 2 Prep v220: Remove not needed headers, round 3 Prep v220: Remove empty source directories Prep v220: Remove non-empty source directories, that aren't needed by elogind Prep v220: Remove all root directories that aren't referenced by the elogind build chain. Prep v220: remove superfluous src/import directory and systemd configurations and policies.
* resolved: never attempt to resolve loopback addresses via DNS/LLMNR/mDNSLennart Poettering2017-03-14
| | | | | We already refuse to resolve "localhost", hence we should also refuse resolving "127.0.0.1" and friends.
* shared: dns-name - introduce dns_label_unescape_suffix()Tom Gundersen2017-03-14
| | | | | | | | | | Intended to be called repeatedly, and returns then successive unescaped labels from the most to the least significant (left to right). This is slightly inefficient as it scans the string three times (two would be sufficient): once to find the end of the string, once to find the beginning of each label and lastly once to do the actual unescaping. The latter two could be done in one go, but that seemed unnecessarily convoluted.
* shared: dns-name - add dns_name_between()Tom Gundersen2017-03-14
| | | | | | | Given three DNS names this function indicates if the second argument lies strictly between the first and the third according to the canonical DNS name order. Note that the order is circular, so the last name is considered to be before the first.
* firewall: rename fw-util.[ch] → firewall-util.[ch]Daniel Mack2017-03-14
| | | | | The names fw-util.[ch] are too ambiguous, better rename the files to firewall-util.[ch]. Also rename the test accordingly.
* sd-netlink: rename from sd-rtnlTom Gundersen2017-03-14
|
* resolve: move dns routines into sharedNick Owens2017-03-14
|
* sd-bus: properly handle creds that are known but undefined for a processLennart Poettering2017-03-14
| | | | | | | | | | | | | | | A number of fields do not apply to all processes, including: there a processes without a controlling tty, without parent process, without service, user services or session. To distuingish these cases from the case where we simply don't have the data, always return ENXIO for them, while returning ENODATA for the case where we really lack the information. Also update the credentials dumping code to show this properly. Fields that are known but do not apply are now shown as "n/a". Note that this also changes some of the calls in process-util.c and cgroup-util.c to return ENXIO for these cases.
* shared: add terminal-util.[ch]Ronny Chevalier2017-03-14
|
* shared: add process-util.[ch]Ronny Chevalier2017-03-14
|
* Remove src/testAndy Wingo2015-04-19
|
* fix gcc warnings about uninitialized variablesHarald Hoyer2015-03-27
| | | | | | | | | | | | | like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
* util: rework word parsing and c unescaping codeLennart Poettering2015-03-26
| | | | | | | | | | | When parsing words from input files, optionally automatically unescape the passed strings, controllable via a new flags parameter. Make use of this in tmpfiles, and port everything else over, too. This improves parsing quite a bit, since we no longer have to process the same string multiple times with different calls, where an earlier call might corrupt the input for a later call.
* libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen2015-03-18
| | | | This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev.
* shared: add path_compare(), an ordering path comparisonMichal Schmidt2015-03-16
| | | | ... and make path_equal() a simple wrapper around it.
* bus: stop using EDEADLOCKDavid Herrmann2015-03-13
| | | | | | | The error code is called EDEADLK, stop using legacy names like EDEADLOCK. Note that _some_ weird architectures define them differently (namely, mips and sparc), but on all sane architectures they're exactly the same. So stay with the widely used code, which is EDEADLK.
* shared: the btrfs quota field is called "referenced" not "referred"Lennart Poettering2015-03-10
|
* test-hashmap: fix gcc5 warningDaniel Mack2015-02-24
| | | | | | | | gcc5 spits out a warning about test-hashmap.c: CC src/test/test-hashmap.o src/test/test-hashmap.c: In function ‘test_string_compare_func’: src/test/test-hashmap.c:76:79: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
* test-time: test "infinity" parsing in nanosecondsDaniel Mack2015-02-24
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* test: utf8 - fix utf16 tests on BE machinesTom Gundersen2015-02-18
|
* test-util: remove superfluous constThomas Hindoe Paaboel Andersen2015-02-12
|
* cg_path_get_user_unit(): Did not correctly parse user-unit templates.Luke Shumaker2015-02-04
| | | | | | | It ran either skip_session() or skip_user_manager(), then ran skip_slices() iff skip_session() ran. It needs to run skip_slices() in either case. Included is a test case demonstrating why.
* shared/async: simplify asynchronous_job a bitZbigniew Jędrzejewski-Szmek2015-02-02
|
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* test: duplicate LIST_FOREACH_OTHERS test to check for corner cases of end ↵Lennart Poettering2015-01-28
| | | | and start of list
* list: add macro for iterating through a list an item is in, skipping the itemLennart Poettering2015-01-28
|
* tests: use assert_se instead of assertRonny Chevalier2015-01-22
| | | | Otherwise they can be optimized away with -DNDEBUG
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* util: make http url validity checks more generic, and move them to util.cLennart Poettering2015-01-20
|
* import-raw: when downloading raw images, generate sparse files if we canLennart Poettering2015-01-19
|
* Revert "test-exec: do not skip all the tests"David Herrmann2015-01-18
| | | | | | | | | | This reverts commit 68e68ca8106e7cd874682ae425843b48579c6539. We *need* root access to create cgroups. The only exception is if it is run from within a cgroup with "Delegate=yes". However, this is not always true and we really shouldn't rely on this. If your terminal runs from within a systemd --user instance, you're fine. Everyone else is not (like running from ssh, VTs, and so on..).
* remove unneeded libgen.h includesCristian Rodríguez2015-01-17
|
* test-path: do not skip tests if we are not rootRonny Chevalier2015-01-15
| | | | We can properly run the tests without being root
* test-exec: do not skip all the testsRonny Chevalier2015-01-15
| | | | | Only 5 tests cannot be executed if we are not root, so just skip them but not the whole set.
* test: hashmap_put behaviour for equal keysMartin Pitt2015-01-14
| | | | | Check string ops hashmap_put() for keys with a different pointer but the same value.
* shared: add minimal firewall manipulation helpers for establishing NAT ↵Lennart Poettering2015-01-13
| | | | rules, using libiptc
* fstab-util: fix priority parsing and add testZbigniew Jędrzejewski-Szmek2015-01-11
|
* shared/util: respect buffer boundary on incomplete escape sequencesZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | cunescape_length_with_prefix() is called with the length as an argument, so it cannot rely on the buffer being NUL terminated. Move the length check before accessing the memory. When an incomplete escape sequence was given at the end of the buffer, c_l_w_p() would read past the end of the buffer. Fix this and add a test.
* core/load-fragment: avoid allocating 0 bytes when given an invalid commandZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | With a command line like "@/something" we would allocate an array with 0 elements. Avoid that, and add a test too.
* test-unit-file: don't access out-of-bounds memoryZbigniew Jędrzejewski-Szmek2015-01-11
| | | | Fixes an error introduced by me when the test was added.
* Support negated fstab optionsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | We would ignore options like "fail" and "auto", and for any option which takes a value the first assignment would win. Repeated and options equivalent to the default are rarely used, but they have been documented forever, and people might use them. Especially on the kernel command line it is easier to append a repeated or negated option at the end.
* Add new function to filter fstab optionsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | | | | | | | | | | | This fixes parsing of options in shared/generator.c. Existing code had some issues: - it would treate whitespace and semicolons as seperators. fstab(5) is pretty clear that only commas matter. And the syntax does not allow for spaces to be inserted in the field in fstab. Whitespace might be escaped, but then it should not seperate options. Treat whitespace and semicolons as any other character. - it assumed that x-systemd.device-timeout would always be followed by "=". But this is not guaranteed, hasmntopt will return this option even if there's no value. Uninitialized memory could be read. - some error paths would log, and inconsistently, some would just return an error code. Filtering is split out to a separate function and tests are added. Similar code paths in other places are adjusted to use the new function.
* shared/list: add LIST_APPENDZbigniew Jędrzejewski-Szmek2015-01-11
|
* test-path-lookup: add simple test for path lookup functionsZbigniew Jędrzejewski-Szmek2015-01-11
|
* test-util: make sure that masking and overriding worksZbigniew Jędrzejewski-Szmek2015-01-11
|
* Implement masking and overriding of generatorsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | | | | | | | | | | | | | Sometimes it is necessary to stop a generator from running. Either because of a bug, or for testing, or some other reason. The only way to do that would be to rename or chmod the generator binary, which is inconvenient and does not survive upgrades. Allow masking and overriding generators similarly to units and other configuration files. For the systemd instance, masking would be more common, rather than overriding generators. For the user instances, it may also be useful for users to have generators in $XDG_CONFIG_HOME to augment or override system-wide generators. Directories are searched according to the usual scheme (/usr/lib, /usr/local/lib, /run, /etc), and files with the same name in higher priority directories override files with the same name in lower priority directories. Empty files and links to /dev/null mask a given name. https://bugs.freedesktop.org/show_bug.cgi?id=87230
* Simplify execute_directory()Zbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | Remove the optional sepearate opening of the directory, it would be just too complicated with the change to multiple directories. Move the middle of execute_directory() to a seperate function to make it easier to grok.
* logind: unify how we cast between uid_t and pointers for hashmap keysLennart Poettering2015-01-09
|