diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/restart_test.go | 29 | ||||
-rw-r--r-- | test/system/120-load.bats | 28 |
2 files changed, 31 insertions, 26 deletions
diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go index 114bd481a..584ccd22b 100644 --- a/test/e2e/restart_test.go +++ b/test/e2e/restart_test.go @@ -196,4 +196,33 @@ var _ = Describe("Podman restart", func() { Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0])) Expect(restartTime.OutputToStringArray()[1]).To(Not(Equal(startTime.OutputToStringArray()[1]))) }) + + It("Podman restart a container in a pod and hosts shouln't duplicated", func() { + // Fixes: https://github.com/containers/podman/issues/8921 + + _, ec, _ := podmanTest.CreatePod("foobar99") + Expect(ec).To(Equal(0)) + + session := podmanTest.RunTopContainerInPod("host-restart-test", "foobar99") + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + testCmd := []string{"exec", "host-restart-test", "sh", "-c", "wc -l < /etc/hosts"} + + // before restart + beforeRestart := podmanTest.Podman(testCmd) + beforeRestart.WaitWithDefaultTimeout() + Expect(beforeRestart.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"restart", "host-restart-test"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + afterRestart := podmanTest.Podman(testCmd) + afterRestart.WaitWithDefaultTimeout() + Expect(afterRestart.ExitCode()).To(Equal(0)) + + // line count should be equal + Expect(beforeRestart.OutputToString()).To(Equal(afterRestart.OutputToString())) + }) }) diff --git a/test/system/120-load.bats b/test/system/120-load.bats index 272e2ae93..902cd9f5e 100644 --- a/test/system/120-load.bats +++ b/test/system/120-load.bats @@ -59,15 +59,13 @@ verify_iid_and_name() { local new_tag=t1$(random_string 6 | tr A-Z a-z) run_podman rmi $fqin - new_fqin=localhost/$new_name:$new_tag - run_podman load -i $archive $new_fqin + run_podman load -i $archive run_podman images --format '{{.Repository}}:{{.Tag}}' --sort tag is "${lines[0]}" "$IMAGE" "image is preserved" is "${lines[1]}" "$fqin" "image is reloaded with old fqin" - is "${lines[2]}" "$new_fqin" "image is reloaded with new fqin too" # Clean up - run_podman rmi $fqin $new_fqin + run_podman rmi $fqin } @@ -118,28 +116,6 @@ verify_iid_and_name() { verify_iid_and_name $img_name } -@test "podman load - NAME and NAME:TAG arguments work" { - get_iid_and_name - run_podman save $iid -o $archive - run_podman rmi $iid - - # Load with just a name (note: names must be lower-case) - random_name=$(random_string 20 | tr A-Z a-z) - run_podman load -i $archive $random_name - verify_iid_and_name "localhost/$random_name:latest" - - # Load with NAME:TAG arg - run_podman rmi $iid - random_tag=$(random_string 10 | tr A-Z a-z) - run_podman load -i $archive $random_name:$random_tag - verify_iid_and_name "localhost/$random_name:$random_tag" - - # Cleanup: restore desired image name - run_podman tag $iid $img_name - run_podman rmi "$random_name:$random_tag" -} - - @test "podman load - will not read from tty" { if [ ! -t 0 ]; then skip "STDIN is not a tty" |