Commit graph

77 commits

Author SHA1 Message Date
Lennart Poettering d47c78be4a util: properly escape corner cases in bus_path_escape(), too
This follows the suggestions from:

http://lists.freedesktop.org/archives/systemd-devel/2013-March/009363.html
2013-03-05 20:05:46 +01:00
Daniel Buch 44f4c86c42 test-util.c: added hexchar, unhexchar, octchar, unoctchar, decchar, undecchar tests 2013-02-26 23:56:56 +01:00
Thomas Hindoe Paaboel Andersen 1ef04f0b14 tests: add a few more tests to test-util.c
Add asserts on the resutls in FOREACH_WORD_QUOTED
Added tests for:
  FOREACH_WORD
  strstrip
  delete_chars
  in_charset
2013-02-25 23:44:20 +01:00
Thomas Hindoe Paaboel Andersen 8d99e5f530 tests: more tests for util.c
tests for:
  test_parse_pid
  test_parse_uid
  test_safe_atolli
  test_safe_atod
2013-02-20 22:36:43 +01:00
Daniel Buch 9f31636648 test-strv.c: ported test_specifier_printf() to _cleanup_free_ + assert_se + cleanup 2013-02-18 23:57:56 +01:00
Daniel Buch 04045d8426 test-strv.c: added OOM check for current tests
New OOM check patch:

I do assert_se() before variable is used to do correct check.
2013-02-18 23:57:48 +01:00
Daniel Buch 2f213f7493 test-strv.c: added strv_split_nulstr() test 2013-02-18 23:57:43 +01:00
Thomas Hindoe Paaboel Andersen 0d585d8291 tests: add test of memdup_multiply 2013-02-18 23:57:36 +01:00
Harald Hoyer a5c32cff1f honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c

see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-02-14 16:19:38 +01:00
Daniel Buch 7b68d618a2 test-strv.c: Changed assert() to assert_se()
test-strv.c: Indent fix
2013-02-13 20:22:12 +01:00
Daniel Buch 40857008d8 test-strv.c: added strv_append test 2013-02-13 20:22:09 +01:00
Daniel Buch 343a896935 test-strv.c: added strv_merge_concat test 2013-02-13 20:22:05 +01:00
Daniel Buch a1022300b9 test-strv.c: added strv_merge test 2013-02-13 20:21:44 +01:00
Thomas Hindoe Paaboel Andersen 090be86534 use streq instead of strcmp 2013-02-13 18:14:20 +01:00
Aleksander Morgado 10efe2cdbe test-udev: include missing.h
We need MS_REC and MS_SHARED defined for a proper compilation, so get them from
'missing.h' if not defined already.
2013-02-13 08:45:13 -05:00
Zbigniew Jędrzejewski-Szmek a3aa7ee6ff tests: add test for continuation lines with comments 2013-02-13 01:05:28 -05:00
Thomas Hindoe Paaboel Andersen 8354c34e14 tests: more tests
tests for:
 parse_boolean
 env_name_is_valid

Also convert assert to assert_se to make sure they are run even with
optimization. (see commit 9b5d6bd909)
2013-02-11 22:22:40 +01:00
Lennart Poettering 9b5d6bd909 test-env-replace: better user assert_se() everywhere
For test tools it's better to use assert_se() rather than assert(),
since the former is not optimized away, even if -DNDEBUG is used. That
means the test program now retains its usefulness even if -DNDEBUG is
used.

This also adds in some OOM checks, to be extra anal...
2013-02-11 03:55:07 +01:00
Lennart Poettering 4d1a690438 env: considerably beef up environment cleaning logic
Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.

All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.

(This also splits out all environment related calls into env-util.[ch])
2013-02-11 03:54:50 +01:00
Thomas Hindoe Paaboel Andersen c62c294fd5 tests: add tests of strxcpyx
also fix a bad indentation in test-strbug.c
2013-02-10 23:06:16 +01:00
Thomas Hindoe Paaboel Andersen 97b5f60818 tests: add test of strbuf 2013-02-09 01:40:52 +01:00
Thomas Hindoe Paaboel Andersen 940bd4738b tests: add more tests
Adds tests of:
 strv_env_delete
 strv_env_unset
 strv_env_set
2013-02-08 00:25:37 +01:00
Thomas Hindoe Paaboel Andersen 1f28b2deb4 test-env-replace: assert results instead of printing them
Also code cleanup and split into functions in preparation for more tests
to come.
2013-02-07 21:14:36 +01:00
Zbigniew Jędrzejewski-Szmek c5e33bf834 tests: skip tests if manager cannot be created
When running without a user session, tests fail.
2013-02-06 19:29:33 -05:00
Thomas Hindoe Paaboel Andersen 10ddd913f0 tests: move strv_parse_nulstr to test-strv, and actually test it
The test was originally added with this commit message:
"ask-password: supported plymouth cached passwords"
2013-02-07 00:38:16 +01:00
Thomas Hindoe Paaboel Andersen 7c2d80944a strv: add strv_print
Clearer, and spares the temp variable.
2013-02-07 00:38:09 +01:00
Zbigniew Jędrzejewski-Szmek fa3cd7394c tests: run manager in session mode
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.
2013-02-06 17:06:26 -05:00
Thomas Hindoe Paaboel Andersen 539ad707db test: add a few tests and tidy up
adds test of:
strv_find
strv_find_prefix
strv_overlap
strv_sort
streq_ptr
first_word

Splits tests of util.c into own file to avoid clutter as we add more.

Removed a few prints and uses _cleanup_free_ to make the tests more focused.
2013-02-06 21:15:23 +01:00
Daniel Buch 682cfdff69 test-strv.c: test strv_join added 2013-01-30 23:37:39 -05:00
Daniel Buch 3a7719d303 test-strv.c: Split tests into seperate functions
test-strv.c: Leaves main clean for additional tests
2013-01-30 23:37:39 -05:00
Zbigniew Jędrzejewski-Szmek 1682ff6011 tests: add test for unit name printing 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek 3251c0d239 tests: compress unit name tests and add more asserts 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek 7742f7e999 tests: add test for install_full_printf() 2013-01-29 19:01:41 -05:00
Lennart Poettering 2e3d069236 core: if the bootloader supports it, determine firmware and boot loader delay
This allows us to print simple performance data of all parts of the boot now:

- firmware
- boot loader
- kernel
- initrd
- userspace

This only works for bootloaders which support passing TSC data via EFI
variables. As of now that's only gummiboot.
2013-01-19 04:22:09 +01:00
Zbigniew Jędrzejewski-Szmek 96cde13ace core/cgroup-util: simplify functions and add tests 2013-01-18 11:14:00 -05:00
Zbigniew Jędrzejewski-Szmek b989350563 util: modernization and test for load_env_file 2013-01-18 11:06:53 -05:00
Lennart Poettering 246aa6dd9d core: add bus API and systemctl commands for altering cgroup parameters during runtime 2013-01-14 21:24:57 +01:00
Kay Sievers d5a89d7dc1 udev: move string copy functions to shared/ 2013-01-09 19:06:46 +01:00
Lennart Poettering e8bc0ea2b1 journalctl: strip TABs and ANSI color sequences from log messages when displaying them 2012-12-23 11:28:14 +01:00
Lennart Poettering 92134489ab time-util: teach parse_timestamp to parse weekdays 2012-11-23 22:52:46 +01:00
Lennart Poettering decad9103e util: teach parse_timestamp() to parse results of format_timestamp_relative() 2012-11-23 22:20:15 +01:00
Lennart Poettering aaa870928f test: extend calendarspec test a bit 2012-11-23 21:50:51 +01:00
Lennart Poettering 36697dc019 timer: implement calendar time events 2012-11-23 21:37:58 +01:00
Holger Hans Peter Freyther bb11271068 sched: Only setting CPUSchedulingPriority=rr doesn't work
A service that only sets the scheduling policy to round-robin
fails to be started. This is because the cpu_sched_priority is
initialized to 0 and is not adjusted when the policy is changed.

Clamp the cpu_sched_priority when the scheduler policy is set. Use
the current policy to validate the new priority.

Change the manual page to state that the given range only applies
to the real-time scheduling policies.

Add a testcase that verifies this change:

$ make test-sched-prio; ./test-sched-prio
[test/sched_idle_bad.service:6] CPU scheduling priority is out of range, ignoring: 1
[test/sched_rr_bad.service:7] CPU scheduling priority is out of range, ignoring: 0
[test/sched_rr_bad.service:8] CPU scheduling priority is out of range, ignoring: 100
2012-11-15 16:16:45 +01:00
Zbigniew Jędrzejewski-Szmek 0f67f1efae core: lift restriction on order of - and @ in ExecStart 2012-11-15 16:01:22 +01:00
Oleksii Shevchuk 7e1a84f552 core: interpret \; token in ExecStart as escaped ;
Some commands (like 'find') take a semicolon as separate arg. With
current parser implementation there is no way to pass one.

Patch adds token \;
2012-11-15 16:01:10 +01:00
Zbigniew Jędrzejewski-Szmek 2c5417ade0 tests: add tests for config_parse_exec 2012-11-15 16:00:45 +01:00
Lennart Poettering 6e6fb527f9 shared: add API for replacing @FOO@ style variables in strings 2012-11-14 22:21:16 +01:00
Kay Sievers 1298001ec5 use the same email address everywhere 2012-11-12 19:47:43 +01:00
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00