Commit graph

22 commits

Author SHA1 Message Date
Doug Davis
94d0571304 Fix flaky TestApiStatsNetworkStats test
It appears that on some systems apparmor gets in the way of libc.so.6
shared library being loaded - which means the ping fails.

To get around this if we run ping under `/lib64/ld-linux-x86-64.so.2`
then it works.  So we only do this for linux and only if the first attempt
fails. If this 2nd attempt fails then we'll show the original error to
the user for debugging.

Also s/Output/CombinedOutput/ to help debugging in the future. It didn't
show the real error msg.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-23 19:00:19 -07:00
Michael Holzheu
8ba8189ee6 TestApiStatsContainerGetMemoryLimit: Add cgroup memory test
Currently on kernels booted without the "cgroup_enable=memory" kernel
parameter the testcase TestApiStatsContainerGetMemoryLimit fails with:

FAIL: docker_api_stats_test.go:231: TestApiStatsContainerGetMemoryLimit.pN52_github_com_docker_docker_integration_cli.DockerSuite

docker_api_stats_test.go:256:
    c.Assert(fmt.Sprintf("%d", v.MemoryStats.Limit), checker.Equals, fmt.Sprintf("%d", info.MemTotal))
... obtained string = "0"
... expected string = "33759145984"

Fix this and skip the testcase if the kernel does not support cgroup memory
limit. In that case the output would be:

SKIP: docker_api_stats_test.go:231:
TestApiStatsContainerGetMemoryLimit.pN52_github_com_docker_docker_integration_cli.DockerSuite
(Test requires an environment that supports cgroup memory limit.)

ChangeLog:
----------
v4: Move TestApiStatsContainerGetMemoryLimit to docker_api_stats_unix_test.go
v3: Use existing "memoryLimitSupport" from requirements_unix.go
v2: Move check to requirements.go

Fixes #22477

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-05-04 20:46:41 +02:00
Vincent Demeester
7534f17261
Update code for latest engine-api
- Update CopyToContainer uses
- Use engine-api/types/versions instead of pkg/version

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-04-19 16:56:54 +02:00
Yong Tang
faf2b6f7aa Docker stats is not working when a container is using another container's network.
This fix tries to fix the issue in #21848 where `docker stats` will not correctly
display the container stats in case the container reuse another container's
network stack.

The issue is that when `stats` is performed, the daemon will check for container
network setting's `SandboxID`. Unfortunately, for containers that reuse another
container's network stack (`NetworkMode.IsConnected()`), SandboxID is not assigned.
Therefore, the daemon thinks the id is invalid and remote API will never return.

This fix tries to resolve the SandboxID by iterating through connected containers
and identify the appropriate SandboxID.

A test case for `stats` remote API has been added to check if `stats` will return
within the timeout.

This fix fixes #21848.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-09 20:15:51 +00:00
Lei Jitang
a0a6d031d7 Fix docker stats missing memory limit
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-07 22:09:07 -04:00
Wen Cheng Ma
695b7e8d11 Optimize TestApiStatsNetworkStats and TestApiStatsNetworkStatsVersioning
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-02-01 10:26:27 +08:00
yangshukui
d474f7fb86 remove the check of ContentLength in TestApiStatsNoStreamGetCpu
Signed-off-by: yangshukui <yangshukui@huawei.com>
2016-01-19 12:06:01 +08:00
David Calavera
907407d0b2 Modify import paths to point to the new engine-api package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-06 19:48:59 -05:00
Donald Huang
8ceded6d03 add tests for docker stats versioning
testing for #17549

Signed-off-by: Donald Huang <don.hcd@gmail.com>
2015-10-31 00:23:08 +00:00
Lei Jitang
1b9a08e719 Fix docker inspect container only reports last assigned information
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-27 16:26:06 -04:00
Hu Keping
710817a71b Use checker on integration test when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-10-22 15:53:17 +08:00
Antonio Murdaca
66be81b148 integration-cli: add cli/api stats tests when container not found
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-17 18:20:25 +02:00
Hu Keping
d3379946ec Refactor the statistics of network in docker stats
For now docker stats will sum the rxbytes, txbytes, etc. of all
the interfaces.

It is OK for the output of CLI `docker stats` but not good for
the API response, especially when the container is in sereval
subnets.

It's better to leave these origianl data to user.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-15 15:40:34 +08:00
John Howard
f9a3558a9d Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-04 12:32:40 -07:00
Vincent Demeester
799d9605d6 Remove/Comment time.Sleep in integration tests
Remove what seems unnecessary time.Sleep (1 second even) and comment the
ones that seemed necessary.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-08-18 20:36:08 +02:00
Zhang Wei
3d6617ffe7 fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-07 09:43:43 +08:00
Antonio Murdaca
18faf6f94e Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-23 14:34:38 +02:00
John Howard
c1b524486c Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 10:09:45 -07:00
Alessandro Boch
8b40e44c39 Stats API to retrieve nw stats from libnetwork
- Container networking statistics are no longer
  retrievable from libcontainer after the introduction
  of libnetwork. This change adds the missing code
  for docker daemon to retireve the nw stats from
  Endpoint.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-07-01 11:15:16 -07:00
Shijiang Wei
1cbf5a54da fix the goroutine leak in the stats API if the container is not running
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-06-23 19:38:15 +08:00
Brian Goff
855a056af7 Fixes content-type/length for stats stream=false
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-12 13:06:06 -04:00
Alexander Morozov
ff9877ccc4 Rename test file to have _test postfix
Without this go test was unable to find line number of error in that
file.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-05 13:49:58 -07:00
Renamed from integration-cli/docker_api_stats.go (Browse further)