test/systemd_unit_create: Wants, Requires, After
Add test values for Wants, Requires, and After. Adding multiple values to test that arrays work and made sure they're all different. The units need to be valid, real unit names otherwise the 'systemd-analyze verify' check will fail.
This commit is contained in:
parent
d40948ce61
commit
86baf802d5
1 changed files with 20 additions and 1 deletions
|
|
@ -66,7 +66,20 @@ def test_systemd_unit_create(tmp_path, stage_module, unit_type, unit_path, expec
|
|||
],
|
||||
"ConditionPathIsDirectory": [
|
||||
"|!/etc/mydir"
|
||||
]
|
||||
],
|
||||
# need to use real units otherwise the validation will fail
|
||||
"Wants": [
|
||||
"basic.target",
|
||||
"sysinit.target",
|
||||
],
|
||||
"Requires": [
|
||||
"paths.target",
|
||||
"sockets.target",
|
||||
],
|
||||
"After": [
|
||||
"sysinit.target",
|
||||
"default.target",
|
||||
],
|
||||
},
|
||||
"Service": {
|
||||
"Type": "oneshot",
|
||||
|
|
@ -112,6 +125,12 @@ def test_systemd_unit_create(tmp_path, stage_module, unit_type, unit_path, expec
|
|||
DefaultDependencies=False
|
||||
ConditionPathExists=|!/etc/myfile
|
||||
ConditionPathIsDirectory=|!/etc/mydir
|
||||
Wants=basic.target
|
||||
Wants=sysinit.target
|
||||
Requires=paths.target
|
||||
Requires=sockets.target
|
||||
After=sysinit.target
|
||||
After=default.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue