Commit Graph

24 Commits

Author SHA1 Message Date
Yong Tang 62014aaf9a Add filter for events emitted by docker daemon
This fix tries to cover the issue raised in #22463 by adding
filter for events emitted by docker daemon so that user could
utilize filter to receive events of interest.

Documentations have been updated for this fix.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
Yong Tang 382c152a73 Emit events for docker daemon
This fix tries to cover the issue raised in #22463 by emitting
events for docker daemon so that user could be notified by
scenarios like config reload, etc.

This fix adds the `daemon reload`, and events for docker daemon.

Additional tests have been added to cover the changes in this fix.

This fix fixes #22463.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-23 19:00:47 -07:00
David Calavera 55053d3537
Get events until a time in the past.
This change allow to filter events that happened in the past
without waiting for future events. Example:

docker events --since -1h --until -30m

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-04-14 16:22:16 -07:00
Christopher Jones 3abf2a7741 Fix flaky OOM tests
If cgroup swap memory limit isn't enabled, then
the -m flag doesn't work and the container that is created for
both of these tests is very large. Because we are trying to run the
containers out of memory, this takes a very long time and causes the
tests to fail most of the time.

Follow-up to #17913

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-02-23 15:26:26 -05:00
Brian Goff abbf2aa6dd Fix events test flakiness.
Since channel is getting a send instead of a close now, this can cause
random issues ranging through the list of channels if the channel is
unbuffered since the send may be blocked.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-02-18 16:10:29 -05:00
Zhang Wei 62a856e912 Assert error in body of function `inspectField*`
1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-29 23:39:07 +08:00
Zhang Wei 6bf5b3db9a Optimize slow integration test
Optimize `TestEventsOOMDisableTrue` performance

It's part of #19425 issue.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-26 00:07:20 +08:00
David Calavera 27b060492c Fix channel closing race in event tests.
Divide event matching into two functions, a matcher and
a processor. That way, the error handling doesn't call
the channel closing logic at all.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-22 13:31:46 -05:00
Stefan Scherer 4f339570cb Skip failing tests on ARM to get red/green feedback from Jenkins
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2016-01-18 17:00:15 +01:00
David Calavera 851fe00c64 Add filter by event type and documentation.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-04 14:58:04 -05:00
David Calavera f15af1eff7 Add network events.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-30 17:39:33 -05:00
David Calavera 9d12d09300 Add volume events.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-30 17:39:33 -05:00
David Calavera 72f1881df1 Add event types.
- Stop serializing JSONMessage in favor of events.Message.
- Keep backwards compatibility with JSONMessage for container events.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-30 17:39:33 -05:00
Lei Jitang 687ef00562 Add tests for docker events -f container.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 531ecf59f5bd92b12d4548617ca7bf179c8179a3)
2015-12-30 17:39:32 -05:00
Christy Perez e86b79fccc Add the memoryLimitSupport requirement to OOM tests
The docker run commands in these tests uses the -m flag,
so the tests should require that it's supported to run.

Fixes 17215 (maybe)

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-11-10 18:06:13 -06:00
David Calavera 157b66ad39 Remove exec-driver global daemon option.
Each platform has only a driver now.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-05 17:09:58 -05:00
Brian Goff 75128c46c7 Merge pull request #17189 from maaquib/16756-integration-cli-unix-events-test
Using checkers assert for integration-cli/docker_cli_events_unix_test.go
2015-10-25 20:39:32 -04:00
Srini Brahmaroutu dc813c7d13 Skipping two tests when running with GCCGO (CI)
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-10-21 17:53:59 +00:00
Mohammed Aaqib Ansari bc478b453f Using checkers assert for integration-cli/docker_cli_events_unix_test.go
Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
2015-10-20 07:04:55 -04:00
Antonio Murdaca cfcddefacd daemon: execdriver: lxc: fix cgroup paths
When running LXC dind (outer docker is started with native driver)
cgroup paths point to `/docker/CID` inside `/proc/self/mountinfo` but
these paths aren't mounted (root is wrong). This fix just discard the
cgroup dir from mountinfo and set it to root `/`.
This patch fixes/skip OOM LXC tests that were failing.
Fix #16520

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
2015-10-13 14:46:59 -07:00
Hu Keping f05bacbe50 Events for OOM needs to be shift to an earlier time
It's worth to warn user as soon as possilbe when OOM happend.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-21 10:18:08 +08:00
Alexander Morozov dc944ea7e4 Use suite for integration-cli
It prints test name and duration for each test.
Also performs deleteAllContainers after each test.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 10:28:52 -07:00
Ahmet Alp Balkan e424c54d9c integ-cli: fix clock skew against remote test daemon
This fixes the `docker events`-related tests as they have been
failing due to clock skew between CI machine and test daemon on
some other machine (even 1-2 seconds of diff causes races as
we pass local time to --since/--until).

If we're running in same host, we keep using time.Now(), otherwise
we read the system time of the daemon from `/info` endpoint.

Fixes pretty much all events-related tests on windows CI.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-11 10:28:56 -07:00
Tonis Tiigi f9876dade2 Fix filenames for unix only integration-cli tests
Test suffix comes after the platform/arch.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-01-14 00:31:25 +02:00