From 80c84020dd81eca80a1404108ea02b948ce6ae83 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Fri, 22 Mar 2024 15:48:44 +0100 Subject: [PATCH] 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 --- test/data/stages/systemd.unit.create/b.json | 9 +++++++++ .../stages/systemd.unit.create/b.mpp.yaml | 5 +++++ .../data/stages/systemd.unit.create/diff.json | 20 ++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/test/data/stages/systemd.unit.create/b.json b/test/data/stages/systemd.unit.create/b.json index c8536607..4aa8506f 100644 --- a/test/data/stages/systemd.unit.create/b.json +++ b/test/data/stages/systemd.unit.create/b.json @@ -635,6 +635,15 @@ "ExecStart": [ "mkdir -p /etc/mydir", "touch /etc/myfile" + ], + "Environment": [ + { + "key": "DEBUG", + "value": "1" + } + ], + "EnvironmentFile": [ + "/etc/example.env" ] }, "Install": { diff --git a/test/data/stages/systemd.unit.create/b.mpp.yaml b/test/data/stages/systemd.unit.create/b.mpp.yaml index a9003b22..6ff459d3 100644 --- a/test/data/stages/systemd.unit.create/b.mpp.yaml +++ b/test/data/stages/systemd.unit.create/b.mpp.yaml @@ -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 diff --git a/test/data/stages/systemd.unit.create/diff.json b/test/data/stages/systemd.unit.create/diff.json index d161ac7b..425aeb34 100644 --- a/test/data/stages/systemd.unit.create/diff.json +++ b/test/data/stages/systemd.unit.create/diff.json @@ -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 ] } }