mirror of
https://github.com/containers/podman.git
synced 2025-09-10 15:46:07 +08:00
Merge pull request #5992 from sujil02/v2-pod-inspect
Enable pod inspect integration test
This commit is contained in:
@ -76,27 +76,6 @@ type podState struct {
|
|||||||
InfraContainerID string
|
InfraContainerID string
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodInspect represents the data we want to display for
|
|
||||||
// podman pod inspect
|
|
||||||
type PodInspect struct {
|
|
||||||
Config *PodConfig
|
|
||||||
State *PodInspectState
|
|
||||||
Containers []PodContainerInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
// PodInspectState contains inspect data on the pod's state
|
|
||||||
type PodInspectState struct {
|
|
||||||
CgroupPath string `json:"cgroupPath"`
|
|
||||||
InfraContainerID string `json:"infraContainerID"`
|
|
||||||
Status string `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// PodContainerInfo keeps information on a container in a pod
|
|
||||||
type PodContainerInfo struct {
|
|
||||||
ID string `json:"id"`
|
|
||||||
State string `json:"state"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// InfraContainerConfig is the configuration for the pod's infra container
|
// InfraContainerConfig is the configuration for the pod's infra container
|
||||||
type InfraContainerConfig struct {
|
type InfraContainerConfig struct {
|
||||||
HasInfraContainer bool `json:"makeInfraContainer"`
|
HasInfraContainer bool `json:"makeInfraContainer"`
|
||||||
|
@ -143,7 +143,7 @@ type swagListPodsResponse struct {
|
|||||||
type swagInspectPodResponse struct {
|
type swagInspectPodResponse struct {
|
||||||
// in:body
|
// in:body
|
||||||
Body struct {
|
Body struct {
|
||||||
libpod.PodInspect
|
define.InspectPodData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containers/libpod/libpod"
|
|
||||||
"github.com/containers/libpod/libpod/define"
|
"github.com/containers/libpod/libpod/define"
|
||||||
"github.com/containers/libpod/pkg/inspect"
|
"github.com/containers/libpod/pkg/inspect"
|
||||||
"github.com/containers/libpod/pkg/rootless"
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
@ -501,8 +500,8 @@ func (s *PodmanSessionIntegration) InspectContainerToJSON() []define.InspectCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
// InspectPodToJSON takes the sessions output from a pod inspect and returns json
|
// InspectPodToJSON takes the sessions output from a pod inspect and returns json
|
||||||
func (s *PodmanSessionIntegration) InspectPodToJSON() libpod.PodInspect {
|
func (s *PodmanSessionIntegration) InspectPodToJSON() define.InspectPodData {
|
||||||
var i libpod.PodInspect
|
var i define.InspectPodData
|
||||||
err := json.Unmarshal(s.Out.Contents(), &i)
|
err := json.Unmarshal(s.Out.Contents(), &i)
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
return i
|
return i
|
||||||
|
@ -54,8 +54,7 @@ var _ = Describe("Podman pod inspect", func() {
|
|||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect.ExitCode()).To(Equal(0))
|
Expect(inspect.ExitCode()).To(Equal(0))
|
||||||
Expect(inspect.IsJSONOutputValid()).To(BeTrue())
|
Expect(inspect.IsJSONOutputValid()).To(BeTrue())
|
||||||
// FIXME sujil, disabled for now
|
podData := inspect.InspectPodToJSON()
|
||||||
//podData := inspect.InspectPodToJSON()
|
Expect(podData.ID).To(Equal(podid))
|
||||||
//Expect(podData.Config.ID).To(Equal(podid))
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user