Commit Graph

18 Commits

Author SHA1 Message Date
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
Arnaud Porterie 777ee34b07 Factorize sleeping containers
Add `runSleepingContainer` and `runSleepingContainerInImage` helper
functions to factor out the way to run system-specific idle containers.

Define a sleeping container as command `top` in image `busybox` for
Unix and as command `sleep 60` in image `busybox` for Windows. Provide a
single point of code to update those.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2016-01-27 08:48:08 -08:00
John Howard f21fb2162e Windows CI: Fix TestRename*
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-01-23 09:25:10 -08:00
Madhu Venugopal 3b16a8c91c integration-cli test for active container rename and reuse
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-10-23 16:26:24 -07:00
Hao Zhang 22d0be5797 use gocheck asserts instead of fatal
Signed-off-by: Hao Zhang <21521210@zju.edu.cn>
2015-10-09 08:34:02 -04:00
Doug Davis 848792c42e Fix 'rename' error msg and error checking
`docker rename foo ''` would result in:
```
usage: docker rename OLD_NAME NEW_NAME
```
which is the old engine's way of return errors - yes that's in the
daemon code.  So I fixed that error msg to just be normal.

While doing that I noticed that using an empty string for the
source container name failed but didn't print any error message at all.
This is because we would generate a URL like: ../containers//rename/..
which would cause a 301 redirect to ../containers/rename/..
however the CLI code doesn't actually deal with 301's - it just ignores
them and returns back to the CLI code/caller.

Rather than changing the CLI to deal with 3xx error codes, which would
probably be a good thing to do in a follow-on PR, for this immediate
issue I just added a cli-side check for empty strings for both old and
new names. This way we catch it even before we hit the daemon.

API callers will get a 404, assuming they follow the 301, for the
case of the src being empty, and the new error msg when the destination
is empty - so we should be good now.

Add tests for both cases too.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-18 11:12:22 -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
Alexander Morozov 6bca8ec3c9 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-28 22:31:01 -07:00
Brian Goff 693ba98cb9 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-27 14:33:32 -04:00
Hu Keping 71868228c7 Refactor : Use dockerCmd in integration-cli tests
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-17 04:07:12 +08:00
Antonio Murdaca cd6cc45d52 Fix TestRenameStoppedContainer race
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 16:11:46 +02: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
Yuan Sun cc30282e94 duplicate logDone in TestRenameRunningContainer and TestRenameCheckNames
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-08 13:33:05 +08:00
Brian Goff 475c65319b Remove `stripTrailingCharacters` from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-06 09:21:18 -04:00
Srini Brahmaroutu caaae78247 Prefix / to the container name is ignored when container is renamed
Closes #10996

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-27 22:40:04 +00:00
Ahmet Alp Balkan 70407ce40c Better test cleanup with defer
This fixes a few misuses of `deleteAllContainers()` cleanup
method in integration-cli suite by moving call to the
beginning of the method and guaranteeing their execution
(including panics) with `defer`s.

Also added some forgotten cleanup calls while I'm at it.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-20 14:04:36 -08:00
Jessica Frazelle a92281637f Renaming a container with an invalid name should fail
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-14 12:54:23 -08:00
Srini Brahmaroutu 21a809d9ae rename a existing container
Closes #3036

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-01-13 03:27:17 +00:00