diff options
author | Maanya Goenka <t-magoenka@microsoft.com> | 2021-06-30 09:57:54 -0700 |
---|---|---|
committer | Maanya Goenka <t-magoenka@microsoft.com> | 2021-08-10 02:41:12 -0700 |
commit | 2a7cf953e1f5372ccbabed02208de989d396ae51 (patch) | |
tree | 80f00397435e88701af61bc99dcd8dd95e23f6e0 /src/test/test-execute.c | |
parent | 782671bc8f580835a917ac712fe6dc0d17205bd5 (diff) | |
download | systemd-2a7cf953e1f5372ccbabed02208de989d396ae51.tar.gz |
systemd-analyze: add --root option for 'verify' verb and allow path parsing
-------------------------------------------------------------------------------
Example Run:
foobar.service created below is a service unit file that has a non-existing key-value
pairing (foo = bar) and is thus, syntactically invalid.
maanya-goenka@debian:~/systemd (img-support)$ cat <<EOF>img/usr/lib/systemd/system/foobar.service
> [Unit]
> foo = bar
>
> [Service]
> ExecStart = /opt/script0.sh
> EOF
The failure to create foobar.service because of the recursive dependency searching and verification has been addressed
in a different PR: systemd-analyze: add option to return an error value when unit verification fails #20233
maanya-goenka@debian:~/systemd (img-support)$ sudo build/systemd-analyze verify --root=img/ foobar.service
/home/maanya-goenka/systemd/img/usr/lib/systemd/system/foobar.service:2: Unknown key name 'foo' in section 'Unit', ignoring.
foobar.service: Failed to create foobar.service/start: Unit sysinit.target not found.
Diffstat (limited to 'src/test/test-execute.c')
-rw-r--r-- | src/test/test-execute.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c index 125e0bbf4f..a0481f1194 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -844,7 +844,7 @@ static int run_tests(UnitFileScope scope, const test_entry tests[], char **patte if (manager_errno_skip_test(r)) return log_tests_skipped_errno(r, "manager_new"); assert_se(r >= 0); - assert_se(manager_startup(m, NULL, NULL) >= 0); + assert_se(manager_startup(m, NULL, NULL, NULL) >= 0); for (const test_entry *test = tests; test->f; test++) if (strv_fnmatch_or_empty(patterns, test->name, FNM_NOESCAPE)) |