summaryrefslogtreecommitdiffstats
path: root/src/test/test-unit-name.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-7/+8
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* util: split all hostname related calls into hostname-util.cLennart Poettering2015-05-181-0/+1
|
* core: rename SystemdRunningAs to ManagerRunningAsLennart Poettering2015-05-111-1/+1
| | | | | | It's primarily just a property of the Manager object after all, and we try to refer to PID 1 as "manager" instead of "systemd", hence let's to stick to this here too.
* core: be more strict when manipulating slices names and unescaping paths ↵Lennart Poettering2015-05-061-0/+60
| | | | | | from unit names Let's better be safe then sorry.
* core: rework unit name validation and manipulation logicLennart Poettering2015-05-061-123/+179
| | | | | | | | | | | | | | | A variety of changes: - Make sure all our calls distuingish OOM from other errors if OOM is not the only error possible. - Be much stricter when parsing escaped paths, do not accept trailing or leading escaped slashes. - Change unit validation to take a bit mask for allowing plain names, instance names or template names or an combination thereof. - Refuse manipulating invalid unit name
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-2/+0
| | | | | | 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-unit-name: add more testsRonny Chevalier2014-12-131-0/+35
| | | | | | | | | | Add more test cases for: - unit_name_is_instance - unit_name_to_instance Add tests for: - unit_name_template - unit_name_is_template
* test-unit-name: add tests for %fRonny Chevalier2014-12-111-0/+2
|
* tests: fix minor memory leakLennart Poettering2014-11-201-1/+1
|
* test: only use assert_seThomas Hindoe Paaboel Andersen2014-10-041-6/+6
| | | | | The asserts used in the tests should never be allowed to be optimized away
* test-engine: fix access to unit load pathZbigniew Jędrzejewski-Szmek2014-07-211-1/+1
| | | | | | | | Also add a bit of debugging output to help diagnose problems, add missing units, and simplify cppflags. Move test-engine to normal tests from manual tests, it should now work without destroying the system.
* tests: add missing XDG_RUNTIME_DIR env variableRonny Chevalier2014-06-301-0/+1
| | | | | Otherwise the test fails because specifier_runtime() returns -ENOTSUP when XDG_RUNTIME_DIR is not set.
* tests: add tests to test-unit-nameRonny Chevalier2014-06-241-0/+127
| | | | | | | | | | | | add tests for: - unit_instance_is_valid - unit_prefix_is_valid - unit_name_change_suffix - unit_name_build - unit_name_is_instance - build_subslice - unit_name_to_instance - unit_name_escape
* make gcc shut upLennart Poettering2014-02-191-1/+1
| | | | | | | If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter.
* Use enums to make it obvious what boolean params meanZbigniew Jędrzejewski-Szmek2013-12-261-13/+13
| | | | Suggested-by: Russ Allbery <rra@debian.org>
* systemctl: allow globbing in commands which take multiple unit namesZbigniew Jędrzejewski-Szmek2013-12-261-2/+2
|
* tests: fix buildLennart Poettering2013-12-181-3/+0
|
* core: allocate a kdbus bus for each systemd instance, if we canLennart Poettering2013-11-301-1/+1
|
* test: exit early if we would conflict with running user systemdLennart Poettering2013-11-201-1/+1
|
* specifier: rework specifier calls to return proper error messageLennart Poettering2013-09-171-4/+4
| | | | | | Previously the specifier calls could only indicate OOM by returning NULL. With this change they will return negative errno-style error codes like everything else.
* test: Make testing work on systems without or old systemdHolger Hans Peter Freyther2013-08-221-1/+4
| | | | | | | | | | | | | | * Introduce a macro to conditionally execute tests. This avoids skipping the entire test if some parts require systemd * Skip the journal tests when no /etc/machine-id is present * Change test-catalog to load the catalog from the source directory of systemd. * /proc/PID/comm got introduced in v2.6.33 but travis is still using v2.6.32. * Enable make check and make distcheck on the travis build * Use -D"CATALOG_DIR=STR($(abs_top_srcdir)/catalog)" as a STRINGIY would result in the path '/home/ich/source/linux' to be expanded to '/home/ich/source/1' as linux is defined to 1.
* tests: skip tests when executed without privileges but which require themKay Sievers2013-07-181-1/+1
|
* test-path-util,test-sched-prio: uninitialize manager to appease valgrindZbigniew Jędrzejewski-Szmek2013-07-121-0/+2
|
* core: serialize/deserialize bus subscribersLennart Poettering2013-07-101-1/+1
|
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-181-6/+6
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* tests: skip bus test if bus cannot be openedZbigniew Jędrzejewski-Szmek2013-03-271-5/+5
| | | | | | To make the result more visible, special return value is used to tell automake that the test was skipped. While at it, use the same return value in other skipped tests.
* Simplify the meaning of %sZbigniew Jędrzejewski-Szmek2013-03-271-2/+2
| | | | | | | | | | | | | | | | | | | The rules governing %s where just too complicated. First of all, looking at $SHELL is dangerous. For systemd --system, it usually wouldn't be set. But it could be set if the admin first started a debug shell, let's say /sbin/sash, and then launched systemd from it. This shouldn't influence how daemons are started later on, so is better ignored. Similar reasoning holds for session mode. Some shells set $SHELL, while other set it only when it wasn't set previously (e.g. zsh). This results in fragility that is better avoided by ignoring $SHELL totally. With $SHELL out of the way, simplify things by saying that %s==/bin/sh for root, and the configured shell otherwise. get_shell() is the only caller, so it can be inlined. Fixes one issue seen with 'make check'.
* tests: skip tests if manager cannot be createdZbigniew Jędrzejewski-Szmek2013-02-071-2/+8
| | | | When running without a user session, tests fail.
* tests: run manager in session modeZbigniew Jędrzejewski-Szmek2013-02-061-4/+8
| | | | | | | | | | | False positives pop up otherwise. FAIL: test-unit-name (exit: 134) ================================ Failed to open /dev/tty0: Permission denied Failed to create root cgroup hierarchy: Permission denied Assertion 'manager_new(SYSTEMD_SYSTEM, &m) == 0' failed at src/test/test-unit-name.c:125, function test_unit_printf(). Aborting.
* tests: add test for unit name printingZbigniew Jędrzejewski-Szmek2013-01-301-2/+90
|
* tests: compress unit name tests and add more assertsZbigniew Jędrzejewski-Szmek2013-01-301-145/+69
|
* test: extend unit-name test a bitLennart Poettering2012-09-121-0/+20
|
* unit-name: rework unit_name_replace_instance function()Lennart Poettering2012-09-121-0/+24
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=855863
* cryptsetup: fix escaping when generating cryptsetup unitsLennart Poettering2012-06-251-0/+51
|
* systemctl: automatically turn paths and unescaped unit names into proper ↵Lennart Poettering2012-06-221-0/+82
unit names This makes sure that systemctl status /home is implicitly translated to: systemctl status /home.mount Similar, /dev/foobar becomes dev-foobar.device. Also, all characters that cannot be part of a unit name are implicitly escaped.