Commit graph

1499 commits

Author SHA1 Message Date
Antonio Murdaca
44f47903a8 Merge pull request #16444 from fgimenez/11584-pkg-stdcopy-test-coverage
Added tests for Write
2015-09-22 14:28:14 +02:00
Federico Gimenez
3efe5ff22e Added tests for StdWriter.Write.
The tests added cover the case when the Writer field returns and error
and, related to that, when the number of written bytes is less than 0.

Signed-off-by: Federico Gimenez <fgimenez@coit.es>
2015-09-22 09:05:22 +02:00
Antonio Murdaca
c219311fd8 pkg: integration: utils_test: fix int format
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-20 02:42:08 +02:00
Jess Frazelle
bf892efe36 Merge pull request #16405 from michaelhuettermann/master
Adding another scientist to the hall of fame.
2015-09-18 16:09:01 -07:00
John Howard
8d56108ffb Windows: Fix warning on info
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-18 13:39:12 -07:00
michaelhuettermann
3e212eec5e Adding another scientist to the hall of fame.
Signed-off-by: Michael Hüttermann <michael@huettermann.net>
2015-09-18 21:31:12 +02:00
Vincent Batts
4026512a2c events/jsonmessage: add and prefer TimeNano for events
This way provide both Time and TimeNano in the event. For the display of
the JSONMessage, use either, but prefer TimeNano Proving only TimeNano
would break Subscribers that are using the `Time` field, so both are set
for backwards compatibility.

The events logging uses nano formatting, but only provides a Unix()
time, therefor ordering may get lost in the output. Example:
```
2015-09-15T14:18:51.000000000-04:00 ee46febd64ac629f7de9cd8bf58582e6f263d97ff46896adc5b508db804682da: (from busybox) resize
2015-09-15T14:18:51.000000000-04:00 a78c9149b1c0474502a117efaa814541926c2ae6ec3c76607e1c931b84c3a44b: (from busybox) resize
```

By having a field just for Nano time, when set, the marshalling back to
`time.Unix(sec int64, nsec int64)` has zeros exactly where it needs to.
This does not break any existing use of jsonmessage.JSONMessage, but now
allows for use of `UnixNano()` and get event formatting that has
distinguishable order. Example:
```
2015-09-15T15:37:23.810295632-04:00 6adcf8ed9f5f5ec059a915466cd1cde86a18b4a085fc3af405e9cc9fecbbbbaf: (from busybox) resize
2015-09-15T15:37:23.810412202-04:00 6b7c5bfdc3f902096f5a91e628f21bd4b56e32590c5b4b97044aafc005ddcb0d: (from busybox) resize
```

Including tests for TimeNano and updated event API reference doc.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-09-18 13:15:26 -04:00
David Calavera
cfd3080a80 Merge pull request #15898 from Microsoft/15775-buildcontextfix
Windows: Fix long path handling for docker build
2015-09-17 09:19:23 -07:00
Antonio Murdaca
f172847205 Skip racey TestDockerCmdInDirWithTimeout
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-17 15:30:07 +02:00
Brian Goff
5cf3a6e010 Skip racey TestDockerCmdWithTimeout
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-16 18:36:35 -04:00
Brian Goff
677a6eaf8f Merge pull request #16261 from vdemeester/integration-dockercmd
Move dockerCmd to pkg/integration and add tests to it
2015-09-16 17:40:33 -04:00
Christian Rotzoll
9c9b748ad8 Remove unused variable, fix #16310
Signed-off-by: Christian Rotzoll <ch.rotzoll@gmail.com>
2015-09-15 22:20:10 +02:00
Stefan J. Wernli
9b648dfac6 Windows: Fix long path handling for docker build
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-09-15 10:58:11 -07:00
Vincent Demeester
7efa0f37b2 Move dockerCmd… to pkg/integration…
… and add some tests on them.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-13 13:09:04 +02:00
Aaron Lehmann
4a5d40fdb7 Make Broadcaster Wait function wait for all writers to finish before returning
Also, use the channel to determine if the broadcaster is closed,
removing the redundant isClosed variable.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-11 10:54:40 -07:00
Aaron Lehmann
23e68679f0 Fix race condition when waiting for a concurrent layer pull
Before, this only waited for the download to complete. There was no
guarantee that the layer had been registered in the graph and was ready
use. This is especially problematic with v2 pulls, which wait for all
downloads before extracting layers.

Change Broadcaster to allow an error value to be propagated from Close
to the waiters.

Make the wait stop when the extraction is finished, rather than just the
download.

This also fixes v2 layer downloads to prefix the pool key with "layer:"
instead of "img:". "img:" is the wrong prefix, because this is what v1
uses for entire images. A v1 pull waiting for one of these operations to
finish would only wait for that particular layer, not all its
dependencies.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-11 10:52:34 -07:00
Jess Frazelle
335689118b Merge pull request #16026 from vdemeester/integration-cli-utils-tests
Add unit tests for integration cli utils.go functions
2015-09-11 10:21:09 -07:00
David Calavera
db54c79d7c Merge pull request #15307 from calavera/stop_signal
Signal to stop a container.
2015-09-11 09:25:18 -07:00
Brian Goff
7064fe283f Merge pull request #16226 from aaronlehmann/broadcaster-catch-up
Broadcaster writer goroutines must only finish when they are caught up
2015-09-10 22:55:44 -04:00
David Calavera
0e50d946a2 Signal to stop a container.
Allow to set the signal to stop a container in `docker run`:
- Use `--stop-signal` with docker-run to set the default signal the container will use to exit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-10 19:56:05 -04:00
Aaron Lehmann
947519bfb3 Broadcaster writer goroutines must only finish when they are caught up
Without this change, there was a narrow race condition that would allow
writers to finish when there was still data left to write. This is
likely to be what was causing some integration tests to fail with
truncated pull output.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-10 14:58:06 -07:00
Brian Goff
c8dc729af4 Merge pull request #16086 from cezarsa/full_stack_dump
Ensure goroutines dump is not truncated
2015-09-10 11:16:28 -04:00
Brian Goff
08a2e475bc Merge pull request #16104 from vdemeester/httputils-withmock
Update httputils tests
2015-09-10 11:00:17 -04:00
Antonio Murdaca
d4a123b20b pkg: devicemapper: fix typo in function declaration
6990b76a69 introduced a typo in function
declaration, this patch fixes that.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-09 15:57:52 +02:00
Vincent Demeester
5109071706 Add unit tests for integration cli utils function
- utils_test.go and docker_utils_test.go
- Moved docker related function to docker_utils.go
- add a test for integration-cli/checker

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-09 15:36:44 +02:00
Vincent Demeester
5c80c3fb3c Update httputils tests
- Make sure we use httptest instead of depending on network
- Update resumablerequestreader tests

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-09 14:59:25 +02:00
Vincent Demeester
0c70eb8381 Update validate-lint to find go files by itself
… and fixes the last bits that were missing :3.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-08 22:07:42 +02:00
Vincent Demeester
6990b76a69 Lint package pkg/devicemapper
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-05 23:15:13 +02:00
Vincent Demeester
915d6ec76d Lint package pkg/plugins/pluginrpc-gen
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-05 23:15:13 +02:00
Cezar Sa Espinola
e787296c75 Ensure goroutines dump is not truncated
Calling runtime.Stack requires the buffer to be big enough to fit the
goroutines dump. If it's not big enough the dump will be truncated and
the value returned will be the same size as the buffer.

The code was changed to handle this situation and try again with a
bigger buffer. Each time the dump doesn't fit in the buffer its size is
doubled.

Signed-off-by: Cezar Sa Espinola <cezarsa@gmail.com>
2015-09-04 14:50:37 -03:00
Jessie Frazelle
38ecc7fc32 Merge pull request #16054 from jfrazelle/update-sqlite3-dep
code.google.com is shutting down so update the dep
2015-09-03 19:20:57 -07:00
Jessica Frazelle
4a864a7552 code.google.com is shutting down so update the dep
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-09-03 17:39:29 -07:00
Tibor Vass
07d2eae6d5 Merge pull request #16060 from vdemeester/14756-lint-pkg-term-windows
Lint pkg/term/windows package
2015-09-03 19:54:20 -04:00
Tibor Vass
f0a5d03400 Merge pull request #16022 from nalind/cgo-windows
Fix a daemon build error when cgo isn't available
2015-09-03 18:42:58 -04:00
Vincent Demeester
3409de971c Lint pkg/term/windows package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-03 22:25:52 +02:00
Nalin Dahyabhai
00ab6d9d47 Fix a daemon build error when cgo isn't available
Avoid duplicate definitions of NewSqliteConn when cgo isn't enabled, so
that we can at least build the daemon.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
2015-09-02 11:41:42 -04:00
Antonio Murdaca
db4f20404d Remove PortMapping from container NetworkSettings
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-02 14:32:53 +02:00
David Calavera
1ed3cb2b6c Merge pull request #15921 from srust/volume_driver_register_retry
Retry registering a volume driver
2015-09-02 11:24:52 +02:00
Todd Crane
ed14fe2afa
Normalized, ungrouped, and sorted names
Signed-off-by: Todd Crane <todd@toddcrane.com>
2015-09-01 21:57:01 -07:00
Stephen Rust
45fdce8a0d Retry registering a volume driver
Signed-off-by: Stephen Rust <srust@blockbridge.com>
2015-09-01 14:56:29 -04:00
Antonio Murdaca
cac8f4f0d0 pkg: stringutils: Add more tests to strslice
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-01 20:27:45 +02:00
John Howard
49c1b51ae2 Windows: Fix absolute checks
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-01 08:41:37 -07:00
Antonio Murdaca
4bb2449188 Merge pull request #15913 from mountkin/abstract
abstract the string slice struct to stringutils package
2015-09-01 17:06:13 +02:00
Doug Davis
5eb4a6b933 Merge pull request #15927 from SvenDowideit/clean-up-parsehost
Change ParseTCPAddr to use tcp://127.0.0.0:2375 format as default consistently
2015-09-01 08:25:59 -04:00
David Calavera
3bd8016259 Merge pull request #15922 from unclejack/lower_reset_timeout_bufreader
pkg/ioutils: lower bufReader reset timeout
2015-08-31 18:43:45 +02:00
Arnaud Porterie
84614fdae0 Merge pull request #15489 from aaronlehmann/pull-updates
Show pull progress in terminal for inflight pull requests
2015-08-31 09:37:33 -07:00
Sven Dowideit
3d510f15da Change ParseTCPAddr to use tcp://127.0.0.0:2375 format as default consistently
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-08-29 11:23:51 +00:00
unclejack
f9df813a99 pkg/ioutils: lower bufReader reset timeout
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-08-28 23:13:02 +03:00
Doug Davis
5e540bdc13 More httputil tests for the docker header
follow-on to #15911

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-08-28 12:16:37 -07:00
Aaron Lehmann
317a5462e4 Make the broadcaster write messages to the observers in the same units they were written to the broadcaster
This means the writing to a WriteFlusher will flush in the same places
as it would if the broadcaster wasn't sitting in front of it.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-28 10:09:00 -07:00