1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00
Commit Graph

12 Commits

Author SHA1 Message Date
Mike Yuan
48c21790ba
test: merge TEST-77-OPENFILE into TEST-23-UNIT-FILE
And add coverage for #32179
2024-04-10 21:49:28 +08:00
Mike Yuan
189a08e83d
core/service: allow RestartForceExitStatus= for oneshot services
I think this was just overlooked in #13754, which removed
the restriction of Restart= on Type=oneshot services.
There's no reason to prevent RestartForceExitStatus=
now that Restart= has been allowed.

Closes #31148
2024-02-10 21:19:36 +08:00
Zbigniew Jędrzejewski-Szmek
63403f07b0 tests: use relative paths in ExecStart= and friends
We want to retain *some* of the full paths in order to test more code paths.
But the default should be to use the command name only. This makes the tests
less visually cluttered.
2024-01-09 11:14:16 +01:00
Michael Biebl
6f9409eebb test: use kill-whom instead of kill-who (the latter is deprecated) 2023-10-12 13:06:12 +09:00
Zbigniew Jędrzejewski-Szmek
1c5d54b2df test: use 'until' instead of 'while !'
In general, it's better to avoid a negation. And "!" is special, because it is
used for history expansion, i.e. the same command would behave differently if
pasted on the command line.

Inspired by 4a899c5a23.
2023-09-06 19:54:29 +01:00
Yu Watanabe
83123a4498 core/unit: search shared namespace in transitive relation of JoinsNamespaceOf=
Previously, dependency chain of JoinsNamespaceOf= did not work, e.g.
- a.service has JoinsNamespaceOf=b.service
- b.service has JoinsNamespaceOf=c.service
if, first c.service, next a.service, finally b.service is started,
then a.service is not joined to the namespace of c.service. And, as
mentioned in the document, the namespace used by b.service is not
deterministic.

This makes when searching exsiting namespace to be joined, all units in
the transitive dependency of JoinsNamespaceOf= are checked.
2023-05-26 15:23:57 +09:00
Yu Watanabe
a60f96fcf5 core/unit: make JoinsNamespaceOf= implies the inverse dependency
Previously, even if a.service has JoinsNamespaceOf=b.service, the
inverse direction of reference was not introduced.
Hence, a.service is started earlier than b.service, the namespace will
not shared with b.service.
Also, even if a.service had the reference to b.service, b.service did not.
If b.service is freed earlier, then unit_clear_dependencies() does not clear
the reference from a to b, and will cause use-after-free on unit_free() for
a.service.

Let's make JoinsNamespaceOf=b.service in a.service implies the inverse
dependency, i.e. JoinsNamespaceOf=a.service for b.service. Then, we can safely
free b.service.
2023-05-26 11:50:08 +09:00
Yu Watanabe
8493a82d0b test: add tests for JoinsNamespaceOf=
To illustrate the current behavior of the dependency.
2023-05-26 11:50:05 +09:00
Frantisek Sumsal
518c3e2722 test: merge TEST-49-RUNTIME-BIND-PATHS into TEST-23-UNIT-FILE 2023-05-16 23:07:45 +02:00
Frantisek Sumsal
23cb7362f1 test: merge TEST-28-PERCENTJ-WANTEDBY into TEST-23-UNIT-FILE 2023-05-16 22:43:52 +02:00
Mike Yuan
b5b1351317
test: add tests for UpheldBy= in [Install] section 2023-05-15 15:04:38 +08:00
Frantisek Sumsal
8412cdf4fd test: move TEST-23's units into a dedicated subfolder
To remain consistent with other tests.
2023-05-10 21:26:26 +02:00