diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-05 14:16:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 14:16:47 -0500 |
commit | 1f59276998320e1961eb9ac63092415f78fe1aa0 (patch) | |
tree | 84385fa229912fbda314ec2435b0ef3b41b536c9 /pkg/systemd/generate/pods_test.go | |
parent | b84b7c89bb35883efebbc1ace0d1bce7e1847632 (diff) | |
parent | 219c69ef03dc86aa92b6134a03f22f416b954d86 (diff) | |
download | podman-1f59276998320e1961eb9ac63092415f78fe1aa0.tar.gz podman-1f59276998320e1961eb9ac63092415f78fe1aa0.tar.bz2 podman-1f59276998320e1961eb9ac63092415f78fe1aa0.zip |
Merge pull request #8889 from vrothberg/run-1138
generate systemd: do not set `KillMode`
Diffstat (limited to 'pkg/systemd/generate/pods_test.go')
-rw-r--r-- | pkg/systemd/generate/pods_test.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/pkg/systemd/generate/pods_test.go b/pkg/systemd/generate/pods_test.go index 7f1f63b7e..6d925ecd2 100644 --- a/pkg/systemd/generate/pods_test.go +++ b/pkg/systemd/generate/pods_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/stretchr/testify/assert" ) func TestValidateRestartPolicyPod(t *testing.T) { @@ -50,11 +51,11 @@ Before=container-1.service container-2.service [Service] Environment=PODMAN_SYSTEMD_UNIT=%n Restart=always +TimeoutStopSec=102 ExecStart=/usr/bin/podman start jadda-jadda-infra -ExecStop=/usr/bin/podman stop -t 10 jadda-jadda-infra -ExecStopPost=/usr/bin/podman stop -t 10 jadda-jadda-infra +ExecStop=/usr/bin/podman stop -t 42 jadda-jadda-infra +ExecStopPost=/usr/bin/podman stop -t 42 jadda-jadda-infra PIDFile=/var/run/containers/storage/overlay-containers/639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401/userdata/conmon.pid -KillMode=none Type=forking [Install] @@ -75,13 +76,13 @@ Before=container-1.service container-2.service [Service] Environment=PODMAN_SYSTEMD_UNIT=%n Restart=on-failure +TimeoutStopSec=70 ExecStartPre=/bin/rm -f %t/pod-123abc.pid %t/pod-123abc.pod-id ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-123abc.pid --pod-id-file %t/pod-123abc.pod-id --name foo "bar=arg with space" --replace ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-123abc.pod-id ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-123abc.pod-id -t 10 ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-123abc.pod-id PIDFile=%t/pod-123abc.pid -KillMode=none Type=forking [Install] @@ -102,7 +103,7 @@ WantedBy=multi-user.target default.target InfraNameOrID: "jadda-jadda-infra", RestartPolicy: "always", PIDFile: "/var/run/containers/storage/overlay-containers/639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401/userdata/conmon.pid", - StopTimeout: 10, + StopTimeout: 42, PodmanVersion: "CI", RequiredServices: []string{"container-1", "container-2"}, }, @@ -139,9 +140,7 @@ WantedBy=multi-user.target default.target t.Errorf("CreatePodSystemdUnit() error = \n%v, wantErr \n%v", err, test.wantErr) return } - if got != test.want { - t.Errorf("CreatePodSystemdUnit() = \n%v\n---------> want\n%v", got, test.want) - } + assert.Equal(t, test.want, got) }) } } |