Fix docker input unit tests
This commit is contained in:
parent
791d154ec1
commit
f405bca034
|
@ -543,6 +543,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
// tags
|
// tags
|
||||||
Status string
|
Status string
|
||||||
// fields
|
// fields
|
||||||
|
ContainerID string
|
||||||
OOMKilled bool
|
OOMKilled bool
|
||||||
Pid int
|
Pid int
|
||||||
ExitCode int
|
ExitCode int
|
||||||
|
@ -564,6 +565,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
},
|
},
|
||||||
inspect: containerInspect(),
|
inspect: containerInspect(),
|
||||||
expect: expectation{
|
expect: expectation{
|
||||||
|
ContainerID: "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
Status: "running",
|
Status: "running",
|
||||||
OOMKilled: false,
|
OOMKilled: false,
|
||||||
Pid: 1234,
|
Pid: 1234,
|
||||||
|
@ -580,6 +582,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
return i
|
return i
|
||||||
}(),
|
}(),
|
||||||
expect: expectation{
|
expect: expectation{
|
||||||
|
ContainerID: "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
Status: "running",
|
Status: "running",
|
||||||
OOMKilled: false,
|
OOMKilled: false,
|
||||||
Pid: 1234,
|
Pid: 1234,
|
||||||
|
@ -598,6 +601,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
return i
|
return i
|
||||||
}(),
|
}(),
|
||||||
expect: expectation{
|
expect: expectation{
|
||||||
|
ContainerID: "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
Status: "running",
|
Status: "running",
|
||||||
OOMKilled: false,
|
OOMKilled: false,
|
||||||
Pid: 1234,
|
Pid: 1234,
|
||||||
|
@ -639,6 +643,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
"oomkilled": tt.expect.OOMKilled,
|
"oomkilled": tt.expect.OOMKilled,
|
||||||
"pid": tt.expect.Pid,
|
"pid": tt.expect.Pid,
|
||||||
"exitcode": tt.expect.ExitCode,
|
"exitcode": tt.expect.ExitCode,
|
||||||
|
"container_id": tt.expect.ContainerID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if started := tt.expect.StartedAt; !started.IsZero() {
|
if started := tt.expect.StartedAt; !started.IsZero() {
|
||||||
|
@ -756,32 +761,6 @@ func TestDockerGatherInfo(t *testing.T) {
|
||||||
"container_status": "running",
|
"container_status": "running",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
acc.AssertContainsTaggedFields(t,
|
|
||||||
"docker_container_status",
|
|
||||||
map[string]interface{}{
|
|
||||||
"container_id": "b7dfbb9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296e2173",
|
|
||||||
"exitcode": int(0),
|
|
||||||
"oomkilled": false,
|
|
||||||
"pid": int(1234),
|
|
||||||
"started_at": int64(1528955333266176036),
|
|
||||||
//"finished_at": float64(0),
|
|
||||||
},
|
|
||||||
map[string]string{
|
|
||||||
"engine_host": "absol",
|
|
||||||
"container_name": "etcd2",
|
|
||||||
"container_image": "quay.io:4443/coreos/etcd",
|
|
||||||
"container_version": "v2.2.2",
|
|
||||||
"ENVVAR1": "loremipsum",
|
|
||||||
"ENVVAR2": "dolorsitamet",
|
|
||||||
"ENVVAR3": "=ubuntu:10.04",
|
|
||||||
"ENVVAR7": "ENVVAR8=ENVVAR9",
|
|
||||||
"label1": "test_value_1",
|
|
||||||
"label2": "test_value_2",
|
|
||||||
"server_version": "17.09.0-ce",
|
|
||||||
"container_status": "running",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDockerGatherSwarmInfo(t *testing.T) {
|
func TestDockerGatherSwarmInfo(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue