mirror of
https://github.com/containers/podman.git
synced 2025-12-05 04:40:47 +08:00
Merge pull request #16309 from edsantiago/remove_usr_bin_podman_in_tests
Test runners: nuke podman from $PATH before tests
This commit is contained in:
@@ -253,6 +253,16 @@ var _ = Describe("podman system connection", func() {
|
||||
u, err := user.Current()
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
|
||||
// Ensure that the remote end uses our built podman
|
||||
if os.Getenv("PODMAN_BINARY") == "" {
|
||||
err = os.Setenv("PODMAN_BINARY", podmanTest.PodmanBinary)
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
|
||||
defer func() {
|
||||
os.Unsetenv("PODMAN_BINARY")
|
||||
}()
|
||||
}
|
||||
|
||||
cmd := exec.Command(podmanTest.RemotePodmanBinary,
|
||||
"system", "connection", "add",
|
||||
"--default",
|
||||
|
||||
@@ -27,16 +27,16 @@ var _ = Describe("Podman systemd", func() {
|
||||
}
|
||||
podmanTest = PodmanTestCreate(tempdir)
|
||||
podmanTest.Setup()
|
||||
systemdUnitFile = `[Unit]
|
||||
systemdUnitFile = fmt.Sprintf(`[Unit]
|
||||
Description=redis container
|
||||
[Service]
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/podman start -a redis
|
||||
ExecStop=/usr/bin/podman stop -t 10 redis
|
||||
ExecStart=%s start -a redis
|
||||
ExecStop=%s stop -t 10 redis
|
||||
KillMode=process
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
`
|
||||
`, podmanTest.PodmanBinary, podmanTest.PodmanBinary)
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
|
||||
Reference in New Issue
Block a user