1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00
The systemd System and Service Manager
Go to file
Filipe Brandenburger cdaf507048 test-execute: Fix systemd escaping and shell issues
In most cases, systemd requires escaping $ (for systemd variable
substitution) and % (for specifiers) by doubling them. This was somewhat
of an issue in tests like exec-environment*.service where systemd was
doing the substitutions and we were not really checking that those were
available in the actual environment of the command. Fix that.

Expressions such as `exit $(test ...)` are incorrect. They only work
because $(test ...) will produce no output, so the command will become a
bare "exit" which will exit with the status of the latest executed
command which turns out to be the test... The direct approach is simply
calling "test" as the last command, for which the shell will propagate
the exit status.

One situation where this was breaking tests was on `exit $(test ...) &&
$(test ...) && $(test ...)` where the second and third tests were not
really executing, since the first command is actually `exit` so && was
doing nothing there. Fixed it by just using `test ... && test ... &&
test ...` as it was initially intended.

Pass -x to all shell executions for them to produce useful debugging
output to stderr. Consequently, removed most of the explicit `echo`s
that are no longer needed.

Mark all units as Type=oneshot explicitly.

Also made sure all shell variables are properly quoted.

v2: Added an explicit LC_ALL=C to ionice invocations since some locales
(such as French) will add a space before the colon in the output.

Tested by running `sudo ./test-execute` and confirming all tests enabled
on my system (essentially all of them except for the s390 one) passed.
Tweaked the variables or options or expected values and confirmed the
tests do indeed fail when the values are not exactly the expected ones.

v2: Also tested with `LANG=fr_FR.UTF-8 sudo ./test-execute` to confirm
it still works in a different locale.
2015-11-10 07:58:29 -08:00
catalog Merge pull request #1821 from darkcircle/ko-catalog-translation 2015-11-09 23:19:37 +01:00
coccinelle coccinelle: additional errno.cocci hunk 2015-11-09 20:01:06 +01:00
docs docs: add .gitignore 2015-07-06 17:47:38 +02:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb hwdb: Update database of Bluetooth company identifiers 2015-10-30 04:22:54 +01:00
m4 build-sys: Check behavior of -Werror=shadow before deciding to use it 2015-09-22 09:54:33 -07:00
man Merge pull request #1825 from ssahani/ipv61-1 2015-11-10 15:03:37 +01:00
network networkd: emit DNS/NTP/Timezone info via DHCP server by default 2015-08-27 16:47:26 +02:00
po po: update Korean translation 2015-11-03 13:22:25 +01:00
rules rfkill: rework and make it listen on /dev/rfkill 2015-10-01 16:21:09 +02:00
shell-completion Merge pull request #1775 from fbuihuu/set-property-completion 2015-11-04 17:52:50 +01:00
src Merge pull request #1825 from ssahani/ipv61-1 2015-11-10 15:03:37 +01:00
sysctl.d core: bump net.unix.max_dgram_qlen really early during boot 2015-11-02 23:44:05 +01:00
system-preset preset: enable machines.target by default 2014-12-29 17:36:57 +01:00
systemd-master/catalog catalog: added systemd.da.catalog 2015-10-10 18:35:44 +02:00
sysusers.d turn kdbus support into a runtime option 2015-06-17 18:01:49 +02:00
test test-execute: Fix systemd escaping and shell issues 2015-11-10 07:58:29 -08:00
tmpfiles.d tmpfiles.d: change all subvolumes to use quota 2015-10-22 01:59:25 +02:00
tools terminal: drop unfinished code 2015-07-27 20:15:34 +02:00
units journal: restore watchdog support 2015-11-03 17:45:12 +01:00
xorg login: support user-bus on dbus1 2015-08-31 18:12:37 +02:00
.dir-locals.el Keep emacs configuration in one configuration file. 2011-03-08 01:53:46 +01:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore sd-pppoe: drop 2015-11-03 16:14:12 +01:00
.mailmap prepare NEWS 2014-02-18 02:51:47 +01:00
.travis.yml remove gudev and gtk-doc 2015-06-03 00:22:53 +02:00
.vimrc vimrc: disable -fdiagnostics-color output 2013-10-20 04:29:39 +02:00
.ycm_extra_conf.py ycm: update flag blacklist 2014-06-04 15:41:10 -04:00
autogen.sh terminal: drop unfinished code 2015-07-27 20:15:34 +02:00
CODING_STYLE update CODING_STYLE 2015-10-19 22:31:58 +02:00
configure.ac build-sys: temporarily lower libmount version check 2015-11-03 07:25:34 -06:00
DISTRO_PORTING build-sys: warn if people don't change the default NTP servers when building systemd 2015-07-11 14:24:29 -03:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile-man.am Merge pull request #1542 from keszybz/journal-audit-optional 2015-10-13 17:23:33 +02:00
Makefile.am sd-pppoe: drop 2015-11-03 16:14:12 +01:00
NEWS doc: correct orthography, word forms and missing/extraneous words 2015-11-06 13:45:21 +01:00
README core: drop check for /etc/mtab 2015-11-02 10:05:20 -06:00
README.md README.md: add Coverity scan status badge 2015-06-08 13:26:54 +02:00
TODO Merge pull request #1831 from keszybz/todo-trimming 2015-11-10 14:43:42 +01:00

systemd - System and Service Manager

Build Status
Coverity Scan Status

Details

  • General information about systemd can be found in the systemd Wiki
  • Information about build requirements are provided in the README file