e2e: quadlet uses PODMAN env for podman binary path

Adapts to pass the test even if
podman binary path is not `/usr/local/bin/podman`.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
This commit is contained in:
Toshiki Sonoda
2023-04-18 13:37:31 +09:00
parent e7b9ae4f3b
commit da83364eb0
2 changed files with 18 additions and 3 deletions

View File

@ -459,6 +459,12 @@ var _ = Describe("quadlet system generator", func() {
fileName := "basic.kube"
testcase := loadQuadletTestcase(filepath.Join("quadlet", fileName))
// quadlet uses PODMAN env to get a stable podman path
podmanPath, found := os.LookupEnv("PODMAN")
if !found {
podmanPath = podmanTest.PodmanBinary
}
// Write the tested file to the quadlet dir
err = os.WriteFile(filepath.Join(quadletDir, fileName), testcase.data, 0644)
Expect(err).ToNot(HaveOccurred())
@ -495,8 +501,8 @@ var _ = Describe("quadlet system generator", func() {
"Type=notify",
"NotifyAccess=all",
"SyslogIdentifier=%N",
fmt.Sprintf("ExecStart=/usr/local/bin/podman kube play --replace --service-container=true %s/deployment.yml", quadletDir),
fmt.Sprintf("ExecStop=/usr/local/bin/podman kube down %s/deployment.yml", quadletDir),
fmt.Sprintf("ExecStart=%s kube play --replace --service-container=true %s/deployment.yml", podmanPath, quadletDir),
fmt.Sprintf("ExecStop=%s kube down %s/deployment.yml", podmanPath, quadletDir),
}
Expect(expected).To(Equal(current))