Ziheng Liu
c322af8019
test: add buffer to prevent goroutine leak
...
Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
2020-02-27 21:37:26 -05:00
Sebastiaan van Stijn
9f0b3f5609
bump gotest.tools v3.0.1 for compatibility with Go 1.14
...
full diff: https://github.com/gotestyourself/gotest.tools/compare/v2.3.0...v3.0.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-11 00:06:42 +01:00
Tibor Vass
59e55dcdd0
rm-gocheck: run goimports to compile successfully
...
goimports -w \
-- "./integration-cli/daemon" "./pkg/discovery" "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli" \
&& \
gofmt -w -s \
-- "./integration-cli/daemon" "./pkg/discovery" "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli"
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:06:12 +00:00
Tibor Vass
1d92789b4f
rm-gocheck: check.C -> testing.T
...
sed -E -i 's#\bcheck\.C\b#testing.T#g' \
-- "integration-cli/check_test.go" "integration-cli/daemon/daemon.go" "integration-cli/daemon/daemon_swarm.go" "integration-cli/daemon_swarm_hack_test.go" "integration-cli/docker_api_attach_test.go" "integration-cli/docker_api_build_test.go" "integration-cli/docker_api_build_windows_test.go" "integration-cli/docker_api_containers_test.go" "integration-cli/docker_api_containers_windows_test.go" "integration-cli/docker_api_exec_resize_test.go" "integration-cli/docker_api_exec_test.go" "integration-cli/docker_api_images_test.go" "integration-cli/docker_api_inspect_test.go" "integration-cli/docker_api_logs_test.go" "integration-cli/docker_api_network_test.go" "integration-cli/docker_api_stats_test.go" "integration-cli/docker_api_swarm_node_test.go" "integration-cli/docker_api_swarm_service_test.go" "integration-cli/docker_api_swarm_test.go" "integration-cli/docker_api_test.go" "integration-cli/docker_cli_attach_test.go" "integration-cli/docker_cli_attach_unix_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_commit_test.go" "integration-cli/docker_cli_cp_from_container_test.go" "integration-cli/docker_cli_cp_test.go" "integration-cli/docker_cli_cp_to_container_test.go" "integration-cli/docker_cli_cp_to_container_unix_test.go" "integration-cli/docker_cli_cp_utils_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_plugins_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_events_test.go" "integration-cli/docker_cli_events_unix_test.go" "integration-cli/docker_cli_exec_test.go" "integration-cli/docker_cli_exec_unix_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_health_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_info_test.go" "integration-cli/docker_cli_info_unix_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_login_test.go" "integration-cli/docker_cli_logout_test.go" "integration-cli/docker_cli_logs_test.go" "integration-cli/docker_cli_netmode_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_logdriver_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_proxy_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_pull_test.go" "integration-cli/docker_cli_push_test.go" "integration-cli/docker_cli_registry_user_agent_test.go" "integration-cli/docker_cli_restart_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_save_load_unix_test.go" "integration-cli/docker_cli_search_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_service_health_test.go" "integration-cli/docker_cli_service_logs_test.go" "integration-cli/docker_cli_service_scale_test.go" "integration-cli/docker_cli_sni_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_stats_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_swarm_unix_test.go" "integration-cli/docker_cli_top_test.go" "integration-cli/docker_cli_update_unix_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_v2_only_test.go" "integration-cli/docker_cli_volume_test.go" "integration-cli/docker_deprecated_api_v124_test.go" "integration-cli/docker_deprecated_api_v124_unix_test.go" "integration-cli/docker_hub_pull_suite_test.go" "integration-cli/docker_utils_test.go" "integration-cli/events_utils_test.go" "integration-cli/fixtures_linux_daemon_test.go" "integration-cli/utils_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/generator_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:05:55 +00:00
Sebastiaan van Stijn
6345208b9b
Replace some checkers and assertions with gotest.tools
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-05 16:45:37 +02:00
Kenfe-Mickael Laventure
617f89b9a3
Fix tests creating zombie processes
...
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-20 07:11:38 -07:00
Corbin
8c10098ea5
Use the first 12 characters of the ID to match the output of docker stats command
...
Signed-off-by: Corbin <corbin.coleman@docker.com>
2017-10-04 13:43:00 -07:00
Vincent Demeester
a899aa6796
[integration] make runSleepingContainer use cli package
...
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-16 23:39:30 +02:00
Vincent Demeester
db35c2a5a8
Introduce cli.Wait*
fuctions
...
These replace `wait*` functions from `docker_utils_test.go` and work
more or less like other `cli` functions.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-14 19:27:33 +02:00
Zhang Wei
eb3a7c2329
Send "Name" and "ID" when stating stopped containers
...
When `docker stats` stopped containers, client will get empty stats data,
this commit will gurantee client always get "Name" and "ID" field, so
that it can format with `ID` and `Name` fields successfully.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-02-09 09:46:59 +08:00
Vincent Demeester
33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
...
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +01:00
Brian Goff
ff08036cc0
Do not remove containers from stats list on err
...
Before this patch, containers are silently removed from the stats list
on error. This patch instead will display `--` for all fields for the
container that had the error, allowing it to recover from errors.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-13 16:36:34 -04:00
Zhang Wei
ea86c30a4a
Bug fix: stats --no-stream always print zero values
...
`docker stats --no-stream` always print zero values.
```
$ docker stats --no-stream
CONTAINER CPU % MEM USAGE / LIMIT MEM %
NET I/O BLOCK I/O
7f4ef234ca8c 0.00% 0 B / 0 B 0.00%
0 B / 0 B 0 B / 0 B
f05bd18819aa 0.00% 0 B / 0 B 0.00%
0 B / 0 B 0 B / 0 B
```
This commit will let docker client wait until it gets correct stat
data before print it on screen.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-03-05 13:22:26 +08:00
Tibor Vass
e80f86bce8
Skip TestStatsAllNewContainersAdded on remote daemons
...
This test is often failing on remote daemons. We tried many approaches
to fix it but none worked. In order to make the CI more reliable, this
will skip the test when running against a remote daemon (e.g. win2lin).
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-03-01 11:49:09 -05:00
Brian Goff
efd281d6eb
Fix flakey TestStatsAllNewContainersAdded
...
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-02-26 16:52:36 -05:00
Tibor Vass
f4a1e3db99
Support TLS remote test daemon
...
This will allow us to have a windows-to-linux CI, where the linux host
can be anywhere, connecting with TLS.
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-02-25 14:12:17 -05:00
John Howard
55268f4e91
Windows: Turn off stats
...
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-02 17:59:11 -08:00
Lei Jitang
71d6e71cff
Fix flaky test TestStatsAllNewContainersAdded
...
Wait the new created container for running and then check if it
is in the docker stats to avoid flaky test.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-01-08 17:02:08 +08:00
Wen Cheng Ma
c424c8c32c
Correct the message of ErrorCodeNoSuchContainer to "No such container"
...
Fixes issue #18424
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2015-12-04 15:00:08 +08:00
Antonio Murdaca
ae818a820f
Allow docker stats without arguments
...
This patch adds the ability to run `docker stats` w/o arguments and get
statistics for all running containers by default. Also add a new
`--all` flag to list statistics for all containers (like `docker ps`).
New running containers are added to the list as they show up also.
Add integration tests for this new behavior.
Docs updated accordingly. Fix missing stuff in man/commandline
reference for `docker stats`.
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-07 17:03:33 +01:00
Xiaoxu Chen
90a81f6af2
update integration-cli/docker_cli_stats_test.go use Assert statement
...
part of #16756
Signed-off-by: Xiaoxu Chen <chenxiaoxu14@otcaix.iscas.ac.cn>
2015-10-09 18:24:32 +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
Morgan Bauer
2d5d606fd3
refactor stats to not use internal data structures
...
- refactor to make it easier to split the api in the future
- addition to check the existing test case and make sure it contains
some expected output
Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-09-16 17:28:52 -07: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
Lei
eef6eda7d2
Recfactor: Use dockerCmd when possible in integration-cli tests
...
Part of #14603
integration-cli/docker_cli_links_test.go (coolljt0725)
integration-cli/docker_cli_links_unix_test.go (coolljt0725)
integration-cli/docker_cli_logs_test.go (coolljt0725)
integration-cli/docker_cli_nat_test.go (coolljt0725)
integration-cli/docker_cli_network_test.go (coolljt0725)
integration-cli/docker_cli_stats_test.go (coolljt0725)
integration-cli/docker_cli_tag_test.go (coolljt0725)
integration-cli/docker_cli_top_test.go (coolljt0725)
integration-cli/docker_cli_version_test.go (coolljt0725)
integration-cli/docker_cli_wait_test.go (coolljt0725
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-20 14:44:22 +08:00
Lei Jitang
96123a1fd5
Add docker stats --no-stream show cpu usage
...
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-31 01:25:51 +08:00
Brian Goff
f3023a93d1
Allow pulling stats once and disconnecting.
...
Adds a `stream` query param to the stats API which allows API users to
only collect one stats entry and disconnect instead of keeping the
connection alive to stream more stats.
Also adds a `--no-stream` flag to `docker stats` which does the same
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-04 10:49:13 -04:00