Merge pull request #13165 from ahmetalpbalkan/durations

Allow duration strings as --since/--until
This commit is contained in:
Antonio Murdaca
2015-06-03 22:14:42 +02:00
8 changed files with 65 additions and 12 deletions
+2 -1
View File
@@ -29,9 +29,10 @@ func (s *DockerSuite) TestEventsTimestampFormats(c *check.C) {
// List of available time formats to --since
unixTs := func(t time.Time) string { return fmt.Sprintf("%v", t.Unix()) }
rfc3339 := func(t time.Time) string { return t.Format(time.RFC3339) }
duration := func(t time.Time) string { return time.Now().Sub(t).String() }
// --since=$start must contain only the 'untag' event
for _, f := range []func(time.Time) string{unixTs, rfc3339} {
for _, f := range []func(time.Time) string{unixTs, rfc3339, duration} {
since, until := f(start), f(end)
cmd := exec.Command(dockerBinary, "events", "--since="+since, "--until="+until)
out, _, err := runCommandWithOutput(cmd)