test/systemd.unit.create: add new options to test

Add the new options to the b.json test and update the diff.

The new file has the following contents:

[Unit]
Description=Create directory
DefaultDependencies=False
ConditionPathExists=|!/etc/myfile
ConditionPathIsDirectory=|!/etc/mydir

[Service]
Type=oneshot
RemainAfterExit=True
ExecStart=mkdir -p /etc/mydir
ExecStart=touch /etc/myfile
Environment="DEBUG=1"
EnvironmentFile=/etc/example.env

[Install]
WantedBy=local-fs.target
RequiredBy=multi-user.target
This commit is contained in:
Achilleas Koutsou 2024-03-22 15:48:44 +01:00 committed by Michael Vogt
parent c72f1bc54e
commit 80c84020dd
3 changed files with 33 additions and 1 deletions

View file

@ -635,6 +635,15 @@
"ExecStart": [
"mkdir -p /etc/mydir",
"touch /etc/myfile"
],
"Environment": [
{
"key": "DEBUG",
"value": "1"
}
],
"EnvironmentFile": [
"/etc/example.env"
]
},
"Install": {

View file

@ -49,6 +49,11 @@ pipelines:
ExecStart:
- mkdir -p /etc/mydir
- touch /etc/myfile
Environment:
- key: "DEBUG"
value: "1"
EnvironmentFile:
- "/etc/example.env"
Install:
WantedBy:
- local-fs.target

View file

@ -2,10 +2,28 @@
"added_files": [],
"deleted_files": [],
"differences": {
"/etc/pki/ca-trust/extracted/java/cacerts": {
"content": [
null,
null
]
},
"/etc/systemd/user/create-directory.service": {
"content": [
"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"sha256:b6ea3cdc2ca7cd0a3c623869003cc4c68c17ccaa8eacacb17af34c3df05f89d4"
"sha256:69aa663d58cc063ea2d7659ac06354335c26e69e8fdb0036f952b082a70b5642"
]
},
"/usr/lib/sysimage/rpm/rpmdb.sqlite": {
"content": [
null,
null
]
},
"/var/cache/ldconfig/aux-cache": {
"content": [
null,
null
]
}
}