Commit Graph

24 Commits

Author SHA1 Message Date
6cbe7c9c86 Change number of pings to 1
This cuts the test time down from 6s to 2s

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: cfde8e785582502b830238245ad69eae5394b4f0
Component: engine
2016-08-03 13:30:34 -07:00
c5d4a2d2e9 Make network stats version test concurrent
This change makes the test run go down from 10s to 2s

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 2f3b7f08a09d70bc17a75b00a81e56357a9cae3f
Component: engine
2016-08-03 13:24:55 -07:00
c78b55f0c1 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>
Upstream-commit: 94d057130461b3b56957b2755da9dae00a937e81
Component: engine
2016-05-23 19:00:19 -07:00
11be2b26e1 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>
Upstream-commit: 8ba8189ee66fa36f7adb1f2bab6cc4c35ebfd8cd
Component: engine
2016-05-04 20:46:41 +02:00
03d17b8c5f 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>
Upstream-commit: 7534f17261d0bb74557ca2f7cd893d5b7b531d49
Component: engine
2016-04-19 16:56:54 +02:00
7511f16a58 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>
Upstream-commit: faf2b6f7aaca7f9ef400e227921b8125590fc9e5
Component: engine
2016-04-09 20:15:51 +00:00
4b530927b7 Fix docker stats missing memory limit
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: a0a6d031d76c1bf9d5581a8310b8a2d1df4b7b82
Component: engine
2016-04-07 22:09:07 -04:00
4087be7d21 Optimize TestApiStatsNetworkStats and TestApiStatsNetworkStatsVersioning
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
Upstream-commit: 695b7e8d11036d4a71263b31d15b75d81c35831e
Component: engine
2016-02-01 10:26:27 +08:00
c91af62049 remove the check of ContentLength in TestApiStatsNoStreamGetCpu
Signed-off-by: yangshukui <yangshukui@huawei.com>
Upstream-commit: d474f7fb86779aa15ea302f269bfc8d00ad379ec
Component: engine
2016-01-19 12:06:01 +08:00
4ec2693c9e Modify import paths to point to the new engine-api package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 907407d0b2e5863f0e1b40b93a356bbf03c7b9fb
Component: engine
2016-01-06 19:48:59 -05:00
0b23ea825a add tests for docker stats versioning
testing for #17549

Signed-off-by: Donald Huang <don.hcd@gmail.com>
Upstream-commit: 8ceded6d0384bef32dfddf800057fa08d910e95e
Component: engine
2015-10-31 00:23:08 +00:00
c2f87fdd0e Fix docker inspect container only reports last assigned information
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 1b9a08e719776e53b7aea1a89c2c29fbf27b1ae4
Component: engine
2015-10-27 16:26:06 -04:00
04eb439359 Use checker on integration test when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 710817a71b40287acc546fe2e08367b2a02dae54
Component: engine
2015-10-22 15:53:17 +08:00
e0ab2a79d7 integration-cli: add cli/api stats tests when container not found
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 66be81b148a1c6693c44cf52d8172d512eedc233
Component: engine
2015-09-17 18:20:25 +02:00
c71aa53e3d 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>
Upstream-commit: d3379946ec96fb6163cb8c4517d7d5a067045801
Component: engine
2015-09-15 15:40:34 +08:00
c03ccb6893 Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9a3558a9d75ed6a2f9f1b2d80800226afaa74a5
Component: engine
2015-09-04 12:32:40 -07:00
22da8315f6 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>
Upstream-commit: 799d9605d6d37a0f5c559b0325d924ad183ff4ee
Component: engine
2015-08-18 20:36:08 +02:00
502a6d4faf fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 3d6617ffe7d9242107ac09eab4f2d8ce87acb95c
Component: engine
2015-08-07 09:43:43 +08:00
6fd5a9b231 Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 18faf6f94e0995ac3fab703d22ca82baf4a65676
Component: engine
2015-07-23 14:34:38 +02:00
448d2ef599 Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c1b524486c80932f0c97b935f1ff9e41d30eab4e
Component: engine
2015-07-09 10:09:45 -07:00
908ab87a15 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>
Upstream-commit: 8b40e44c395fb307cceb6f179ffe02030b316535
Component: engine
2015-07-01 11:15:16 -07:00
eb72177bf2 fix the goroutine leak in the stats API if the container is not running
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 1cbf5a54dae86e34d8e65508c5640b17cda0eed8
Component: engine
2015-06-23 19:38:15 +08:00
73dfc7d473 Fixes content-type/length for stats stream=false
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 855a056af7829504ccc310587445c61d62427b51
Component: engine
2015-06-12 13:06:06 -04:00
ffc2b1eb23 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>
Upstream-commit: ff9877ccc4db4d0891583ebac6558a235b028942
Component: engine
2015-06-05 13:49:58 -07:00