github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/test/e2e/info_test.go (about)

     1  package integration
     2  
     3  import (
     4  	"os"
     5  
     6  	. "github.com/containers/libpod/test/utils"
     7  	. "github.com/onsi/ginkgo"
     8  	. "github.com/onsi/gomega"
     9  )
    10  
    11  var _ = Describe("Podman Info", func() {
    12  	var (
    13  		tempdir    string
    14  		err        error
    15  		podmanTest *PodmanTestIntegration
    16  	)
    17  
    18  	BeforeEach(func() {
    19  		tempdir, err = CreateTempDirInTempDir()
    20  		if err != nil {
    21  			os.Exit(1)
    22  		}
    23  		podmanTest = PodmanTestCreate(tempdir)
    24  		podmanTest.Setup()
    25  	})
    26  
    27  	AfterEach(func() {
    28  		podmanTest.Cleanup()
    29  		f := CurrentGinkgoTestDescription()
    30  		processTestResult(f)
    31  
    32  	})
    33  
    34  	It("podman info json output", func() {
    35  		session := podmanTest.Podman([]string{"info", "--format=json"})
    36  		session.WaitWithDefaultTimeout()
    37  		Expect(session.ExitCode()).To(Equal(0))
    38  
    39  	})
    40  	It("podman system info json output", func() {
    41  		session := podmanTest.Podman([]string{"system", "info", "--format=json"})
    42  		session.WaitWithDefaultTimeout()
    43  		Expect(session.ExitCode()).To(Equal(0))
    44  
    45  	})
    46  	It("podman info --format JSON GO template", func() {
    47  		session := podmanTest.Podman([]string{"info", "--format", "{{ json .}}"})
    48  		session.WaitWithDefaultTimeout()
    49  		Expect(session.ExitCode()).To(Equal(0))
    50  		Expect(session.IsJSONOutputValid()).To(BeTrue())
    51  	})
    52  
    53  	It("podman info --format GO template", func() {
    54  		session := podmanTest.Podman([]string{"info", "--format", "{{ .Store.GraphRoot }}"})
    55  		session.WaitWithDefaultTimeout()
    56  		Expect(session.ExitCode()).To(Equal(0))
    57  	})
    58  })