github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/test/e2e/tree_test.go (about) 1 package integration 2 3 import ( 4 "fmt" 5 "os" 6 7 . "github.com/containers/podman/v2/test/utils" 8 . "github.com/onsi/ginkgo" 9 . "github.com/onsi/gomega" 10 ) 11 12 var _ = Describe("Podman image tree", func() { 13 var ( 14 tempdir string 15 err error 16 podmanTest *PodmanTestIntegration 17 ) 18 19 BeforeEach(func() { 20 tempdir, err = CreateTempDirInTempDir() 21 if err != nil { 22 os.Exit(1) 23 } 24 podmanTest = PodmanTestCreate(tempdir) 25 podmanTest.Setup() 26 podmanTest.AddImageToRWStore(BB) 27 }) 28 29 AfterEach(func() { 30 podmanTest.Cleanup() 31 f := CurrentGinkgoTestDescription() 32 timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds()) 33 GinkgoWriter.Write([]byte(timedResult)) 34 }) 35 36 It("podman image tree", func() { 37 SkipIfRemote("Does not work on remote client") 38 Skip("dont understand why this fails") 39 podmanTest.AddImageToRWStore(cirros) 40 dockerfile := `FROM quay.io/libpod/cirros:latest 41 RUN mkdir hello 42 RUN touch test.txt 43 ENV foo=bar 44 ` 45 podmanTest.BuildImage(dockerfile, "test:latest", "true") 46 47 session := podmanTest.Podman([]string{"image", "tree", "test:latest"}) 48 session.WaitWithDefaultTimeout() 49 Expect(session.ExitCode()).To(Equal(0)) 50 session = podmanTest.Podman([]string{"image", "tree", "--whatrequires", "quay.io/libpod/cirros:latest"}) 51 session.WaitWithDefaultTimeout() 52 Expect(session.ExitCode()).To(Equal(0)) 53 54 session = podmanTest.Podman([]string{"rmi", "test:latest"}) 55 session.WaitWithDefaultTimeout() 56 Expect(session.ExitCode()).To(Equal(0)) 57 session = podmanTest.Podman([]string{"rmi", "quay.io/libpod/cirros:latest"}) 58 session.WaitWithDefaultTimeout() 59 Expect(session.ExitCode()).To(Equal(0)) 60 }) 61 })