Commit graph

49 commits

Author SHA1 Message Date
allencloud
0ead624473 add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 08:36:09 +08:00
Doug Davis
6986a3220f Say something useful during docker load
During a `docker load` there are times when nothing is printed
to the screen, leaving the user with no idea whether something happened.
When something *is* printed, often its just something like:
```
1834950e52ce: Loading layer 1.311 MB/1.311 MB
5f70bf18a086: Loading layer 1.024 kB/1.024 kB
```
which isn't necessarily the same as the image IDs.

This PR will either show:
- all of the tags for the image, or
- all of the image IDs if there are no tags

Sample output:
```
$ docker load -i busybox.tar
Loaded image: busybox:latest

$ docker load -i a.tar
Loaded image ID: sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb
```

IOW, show the human-friendly stuff first and then only if there are no tags
default back to the image IDs, so they have something to work with.

For me this this is needed because I have lots of images and after a
recent `docker load` I had no idea what image I just imported and had a
hard time figuring it out.  This should fix that by telling the user
which images they just imported.

I'll add tests once there's agreement that we want this change.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-06-08 17:17:05 +02:00
Tonis Tiigi
0c0198a5e6 Fix flaky TestSaveLoadParents
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-06 21:58:47 -07:00
Tonis Tiigi
faeff5118f Add parent references support to load/save
Restores the correct parent chain relationship
between images on docker load if multiple images
have been saved.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-21 19:31:10 -07:00
Kai Qiang Wu(Kennan)
ed231d4095 Refine error message when save non-exist image
Fixes: #20709
As discussed in the issue, we need refine the message to
help user more understood, what happened for non-exist image.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-03-08 01:45:19 +00: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
John Howard
25c383391a Windows CI: Deal with failing tests for TP4
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-01-08 13:49:43 -08:00
Doug Davis
7bb9fc415a Fix for zero-sized layers
Moved a defer up to a better spot.

Fixed TestUntarPathWithInvalidDest to actually fail for the right reason

Closes #18170

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-11-25 18:02:03 -08:00
Tonis Tiigi
4352da7803 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-24 09:40:25 -08:00
Srini Brahmaroutu
b1cc78b8f5 Build and test Docker on IBM Power and Z using gccgo. Enable CI on Power and Z.
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-11-14 03:16:45 +00:00
Hao Zhang
d5830d66e0 update test using c.Assert replace c.Fatal
Signed-off-by: Hao Zhang <21521210@zju.edu.cn>
2015-10-12 06:32:21 -04:00
Jess Frazelle
41c99cc621 Merge pull request #15693 from vdemeester/15659-image-label-filter
Fix #15659 : filter by label for docker images commited
2015-10-08 11:14:51 -07:00
Vincent Demeester
77da5d8feb Merge pull request #16076 from vbatts/export_image_times
graph: exported images times matching creation
2015-10-01 21:50:43 +01:00
Vincent Batts
e4478caddf save: integration test for timestamp matching
The `docker save`ed output ought to have matching timestamp to the layer
creation.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-10-01 14:38:55 -04: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
c71a99af11 Fix filter by label for docker images
Using Config.Labels to filter images on Labels.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-08-22 14:06:48 +02: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
Ben Firshman
6b3c928140 Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-22 14:03:50 +01:00
Hu Keping
012b67c3ea CI: use dockerCmd in integration-cli when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-22 17:55:41 +08:00
Antonio Murdaca
d3566fa0b1 Cleanup not needed calls to deleteImages
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-13 20:30:53 +02:00
Antonio Murdaca
a268e36719 Clean tests from not needed inspect call
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-16 18:12:54 +02:00
David Mackey
3941623fbc trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
2015-04-27 13:35:08 -07:00
Alexander Morozov
a9688cdca5 Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:37:21 -07:00
Vincent Demeester
c5ef2901d8 delete "defer deleteContainer" on tests
Since docker test suite is now using gocheck, ``defer
deleteContainer(…)`` is not needed anymore.

Fixes #12705

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-23 22:27: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
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
Michael Crosby
8be8e41429 Reinit slice for each dir in search
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-02-25 15:53:07 -08:00
Michael Crosby
481e75203d Merge pull request #10510 from ashahab-altiscale/9875-lxc-image-layer
Added /dev paths to layer comparison
2015-02-25 14:52:31 -08:00
Ahmet Alp Balkan
c3e28351a1 integ-cli: remove bash dependency from TestSaveDirectoryPermissions
Use the new `runCommandPipelineWithOutput` helper to
remove bash dependency required for piping in
`TestSaveDirectoryPermissions`.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-24 15:52:06 -08:00
Ahmet Alp Balkan
b81105eaca integration-cli: use pipes for save/load tests
This removes `bash` dependency from save/load integration tests.
It used to call `/bin/bash -c 'c:\...\docker.exe'` which is not valid.
Also removed usage of tempdirs and temp files for saving/loading
repos. All are now done using in-memory pipes and buffers.

Created `runCommandPipelineWithOutput` helper to replace the
`/bin/bash -c 'a | b | c'` using pipes and returning output from
last command in the pipeline. This makes the code even shorter
and readable.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-17 17:09:09 -08:00
Abin Shahab
ea0fd0e8e5 Added /dev paths to layer comparison
Lxc images have /dev (devices). This creates a list with the /dev paths in the test.
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-02-05 20:36:30 +00:00
Arnaud Porterie
f3ed42286e Enable test-integration-cli for Windows platform
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-20 16:40:40 -08:00
Josh Hawn
8936789919 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-12-18 14:03:38 -08:00
Cristian Staretu
e4ba82d50e Add build tests covering extraction in chroot
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-12-11 16:26:52 -05:00
Vincent Batts
a5277764ae Merge pull request #9009 from a-ba/fix-export-repo
fix missing layers when exporting a full repository
2014-11-21 15:44:27 -05:00
Tonis Tiigi
da3d3b97eb Make sure integration-cli test clean up
Common patterns:
- Multiple images were built with same name but only one cleanup.
- Containers were deleted after images.
- Images not removed after retagging.

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-11-19 23:41:46 +02:00
Anthony Baire
b37fdc5dd1 fix missing layers when exporting a full repository
Therer is a bug in the 'skip' decision when exporting a repository
(`docker save repo`)

Only the layers of the first image are included in the archive (the
layers of the next images are missing)

Signed-off-by: Anthony Baire <Anthony.Baire@irisa.fr>
2014-11-14 14:41:35 +01:00
Doug Davis
0cef21cfba Cleanup some integration-cli output
I noticed a few things that were bugging me in the output
of the integration-cli tests.
- one of the tests used println to stdout so we had garage sent to the screen
- some of the test, in their final log message, didn't include the name of
  the group/file e.g.  daemon - run,iptables   was just   run,iptables

And yes, I noticed this because I'm anal :-)  but also because we should keep
the output of the tests as clean as possible so its easy to spot it when
things go bad.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-11 08:44:32 -08:00
Tibor Vass
350e1b783d Merge pull request #8321 from erikh/ui_save_output
docker save: Do not save to a terminal.
2014-10-24 19:37:14 -04:00
Jessica Frazelle
0c87424007 Cleanup errorOut resp in save tests
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-16 15:06:20 -07:00
Erik Hollensbe
115436e038 docker save: Do not save to a terminal.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-10-06 09:50:40 -07:00
unclejack
1a0347ff1d integcli: fix permission detection for aufs
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-19 21:08:57 +03:00
unclejack
cc5fb986b0 integ-cli: test correct directory permissions
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-08 20:02:40 +03:00
Vincent Batts
79501dcd4f save many: adding an integration-cli test
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-08-28 21:33:13 -04:00
Vincent Batts
600f65b247 docker save: more integration tests
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-07-07 14:58:27 -04:00
Victor Vieux
6228761f67 add a test using the flags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 01:05:13 +00:00
Victor Vieux
614c57c521 improve test
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 00:59:51 +00:00
unclejack
e09274476f cli integration: sync container & image deletion
This makes container and image removal in the tests run synchronously.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-04-04 03:22:32 +03:00
unclejack
6db32fdefd initial version of cli integration tests
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-03-29 23:09:40 +02:00