Commit Graph

82 Commits

Author SHA1 Message Date
9210b1bdbd Introduce a cli package for test-integration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 50c4475df6304e0cf12ea95217eb00ab5d572e34
Component: engine
2017-03-23 18:35:22 +01:00
bdb483e4e4 Clean more build utils in integration cli
- Remove deprecated buildImage* functions
- Rename buildImageNew to buildImage
- Use *check.C in fakeContext* setup and in getIdByName

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c10f6ef43f884306eb3ef60b2d19fdc931cf34cc
Component: engine
2017-01-17 15:42:38 +01:00
78d1ff88be Update trustedCmd to be compatible with testutil/cmd
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 303b1d200af65ebb165602d0137f8b24b7c54d66
Component: engine
2017-01-09 11:07:05 +01:00
424f0925a7 Clean some runCommandWithOutput accross integration-cli code
There is still ways to go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 87e3fcfe1e059780c4ee57abb097296fd29e09af
Component: engine
2017-01-05 17:44:31 +01:00
2758f0996d Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 33968e6c7df164fff0a882c50ae7f4f7e6190e4b
Component: engine
2016-12-30 18:26:34 +01:00
2f9b83d720 Clean integration-cli/utils.go from most of its content
Most of the code is now on pkg/integration.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: def13fa23c812d367e3c61d9c39bdcee66929c17
Component: engine
2016-12-28 19:05:48 +01:00
72d129024d Move package cliconfig to cli/config
I felt it made more sence 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ce964a607ad7395af7b74a0ba1efc5ab3cb15790
Component: engine
2016-12-25 20:31:52 +01:00
d8e519121e Update token server error test to not fail on retries
Instead of having the misconfigured token server test
fail after maxing out retries, only retry a few times
then return an error which will not retry.

Referenced by #19425

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3f5392fddaa3a25b97f083487b85bf0a158fdd15
Component: engine
2016-09-01 15:18:15 -07:00
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
cf21f8491a integration-cli: ensure digest is the same after cross-repo push
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: a0c8970df1f013a51684f82dd86815dcf773a250
Component: engine
2016-07-06 13:12:42 +02:00
fc151282e4 Always store the image digest when pulling and pushing an image.
Always attempt to add digest even when tag already exists.
Ensure digest does not currently exist.
When image id is mismatched, output an error log.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 33984f256b1a281b1130ac7e8edb7bc311750ccf
Component: engine
2016-06-27 10:09:57 -07:00
f06234ccc6 integration-cli: use distribution/reference.DigestRegexp
from a docker push output digest.DigestRegexp.FindString(output) does
not retrive the sha256: prefixed digest but just a string - in many
cases it's the registry host. The checks in the code are completely
wrong then. Fix this by using the DigestRegexp from the
distribution/reference package which correctly retrieves the digest
from the output.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 0bc88d5b0a14e6c7291bb5fbf99283a05511d07c
Component: engine
2016-06-09 11:11:08 +02:00
9f25ee3061 trusted push test: Use a nonexistant hostname
Before, the TCP handshake had to time out (approx 30s) before
this test completed. If you use a hostname that doesn't resolve,
then it fails faster.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 431e7b65733f2eb627bf69502355a66a35121e04
Component: engine
2016-06-03 08:41:58 -05:00
86911550d2 Remove deprecated Docker Content Trust ENV passphrase variables
Since 1.9, Docker Content Trust Offline key has been renamed to
Root key and the Tagging key has been renamed to Repository key.
The corresponding environment variables
`DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE`
`DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE`
have also been deprecated and renamed to
`DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE`
`DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE`

This fix removed the deprecated ENV passphrase variables for
1.12 and updated the docs.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1f0d5aba50803ff401197f96f6a830384d0c04c5
Component: engine
2016-05-07 14:25:28 -07:00
6ee58ec22e Improved message when pushing a non-existant image
The prior error message caused confusion.  If a user attempts to push an
image up to a registry, but they misspelled (or forgot to properly tag
their image) they would see the message 'Repository does not exist', which
is not very clear and causes some to think that there might be a problem
with the registry or connectivity to it, when the problem was simply just
that an image with that tag specified does not exist locally.

Signed-off-by: Dave MacDonald <mindlapse@gmail.com>
Upstream-commit: e57900a2695165bda111758e931e7c3c38449a9f
Component: engine
2016-04-03 16:25:07 -04:00
dabb7c86ca test: Do not check error message from hub, it is not needed
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: bbdd34c370949a2db9f139720b4498bc0952e700
Component: engine
2016-03-23 14:11:44 -04:00
7429b9c336 Update TestPushToCentralRegistryUnauthorized to match updated hub
The error message was changed from "unauthorized: access to the
requested resource is not authorized" to "unauthorized: authentication
required".

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 37e2103e640861b02a1ea0253df749a527a87e1b
Component: engine
2016-03-22 16:15:29 -07:00
ffcbf49a63 Pull, Pull-A, and Build will only pull tags from the targets role or the targets/releases role.
It will ignore tags in all other delegation roles.

Signed-off-by: cyli <cyli@twistedmatrix.com>
Upstream-commit: 623ccc2f319ec28929c75a09bba76916c84f0d2b
Component: engine
2016-03-21 10:56:49 -07:00
39ea52c5c0 Add test for targets/releases preference when pulling
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: ca57f4e6a8ac7861009d03957e1b508036eac98f
Component: engine
2016-03-21 10:56:42 -07:00
18495acb39 Trusted push now adds the tag to every first level delegation role for which we have keys
and for which the tag conforms to path restrictions.

Signed-off-by: cyli <cyli@twistedmatrix.com>
Upstream-commit: 497a58e6e48277bbee214d701e3d671eb8975797
Component: engine
2016-03-21 10:56:09 -07:00
6ab75fcf92 distribution: errors: do not retry if no token in response
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 264b5b60832bf1f1342618d059c0ece3358de7e1
Component: engine
2016-03-19 12:20:14 +01:00
2aaa69712c vendor docker/distribution d06d6d3b093302c02a93153ac7b06ebc0ffd1793
- fix and add integration tests

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: c48439af7f33fccc17013ae7f9e64d4c107502f1
Component: engine
2016-03-19 12:19:48 +01:00
f9e5200e21 distribution: errors: do not access the errors slice if it's empty
- cherry-pick from 1.10.3 branch: 0186f4d4223a094a050d06f456355da3ae431468
- add token service test suite
- add integration test (missing in 1.10.3 branch)

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 1b5c2e1d722757a55364fb45cf3fcec7f2c75fb4
Component: engine
2016-03-16 09:00:39 +01:00
2f7e1dc6a8 Merge pull request #21159 from runcom/fix-retry-push-bug
distribution: errors: do not retry if no credentials provided
Upstream-commit: 0b962f72a97c5e1cde020cc948704e61ab8dfc0a
Component: engine
2016-03-14 09:47:13 -07:00
cad593b9ac integration-cli: add tests for case a) and d) in #21054
- add test for pull from private registry with no credentials
- add test for push to docker hub with no credentials

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Signed-off-by: Antonio Murdaca <amurdaca@localhost.localdomain>
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 6d23c3c57a733436d902b7883f2f0b00846df9e2
Component: engine
2016-03-14 12:43:10 +01:00
2909d7c372 distribution: errors: do not retry if no credentials provided
Fix and add test for case c) in #21054

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 497d545093bce4f01455bf8d2e1658435dbb040b
Component: engine
2016-03-12 20:41:47 +01:00
5bcbfd7abb Add notary binary requirement for tests
This PR adds the "notary" binary requirement for tests.

Previously, NotaryHosting was checking for the "notary-server"
binary under the name notaryBinary. This renames that reference to
notaryServerBinary, so that notaryBinary can rightly refer
to the actual "notary" binary.

Currently only one test actually uses the notary binary, so it's been
updated accordingly.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: db700a678d1da4275553ff7201e2597c7a8016ee
Component: engine
2016-03-11 17:36:12 -05:00
3a79a75181 Rotate snapshot key to server when initializing new notary repos
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: f75622e52acad0213b74c6210c73243d82c8f1be
Component: engine
2016-03-02 16:51:32 -08:00
357a20e2b5 Fix concurrent uploads that share layers
Concurrent uploads which share layers worked correctly as of #18353,
but unfortunately #18785 caused a regression. This PR removed the logic
that shares digests between different push sessions. This overlooked the
case where one session was waiting for another session to upload a
layer.

This commit adds back the ability to propagate this digest information,
using the distribution.Descriptor type because this is what is received
from stats and uploads, and also what is ultimately needed for building
the manifest.

Surprisingly, there was no test covering this case. This commit adds
one. It fails without the fix.

See recent comments on #9132.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 5c99eebe81958a227dfaed1145840374ce50bbbb
Component: engine
2016-03-01 11:14:44 -08:00
acc7d09962 Improve fallback behavior for cross-repository push
Attempt layer mounts from up to 3 source repositories, possibly
falling back to a standard blob upload for cross repository pushes.
Addresses compatiblity issues with token servers which do not grant
multiple repository scopes, resulting in an authentication failure for
layer mounts, which would otherwise cause the push to terminate with an
error.

Signed-off-by: Brian Bland <brian.bland@docker.com>
Upstream-commit: 1d3480f9ba3525309030497d5c8a3dd5725ed15a
Component: engine
2016-02-24 19:13:35 -08:00
142063ee1c Update integration tests with new error messages, and to use different repos per test.
This way we won't encounter any problems with one test using cached data from a different
test.

Signed-off-by: cyli <cyli@twistedmatrix.com>
Upstream-commit: 0617521ba2ce160899852bb707c15bae7309f18a
Component: engine
2016-01-26 18:02:00 -08:00
eb437391da Update registry version in Dockerfile.armhf
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
Upstream-commit: 11a51649cf1fe677fd54e277c2530020fcfbe84b
Component: engine
2016-01-23 18:46:46 +01:00
24a40e97d1 Fixes layer MediaTypes in manifests created from a cross-repository push
Signed-off-by: Brian Bland <brian.bland@docker.com>
Upstream-commit: 06e9a056caa4a5fa8608dc94fecd62bafe528265
Component: engine
2016-01-20 12:23:16 -08:00
d22cc489e9 Skip failing tests on ARM to get red/green feedback from Jenkins
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
Upstream-commit: 4f339570cbd3cc57f5410c4ca08c7d7e03e6e56f
Component: engine
2016-01-18 17:00:15 +01:00
bcd131a7aa Changes cross-repository blob mounting to a blob Create option
Also renames BlobSumService to V2MetadataService, BlobSum to
V2Metadata

Signed-off-by: Brian Bland <brian.bland@docker.com>
Upstream-commit: 63099477189ea14f3122f6aa37fa7c60d33562c7
Component: engine
2016-01-14 14:26:03 -08:00
7afe53c8eb Adds cross-repository blob pushing behavior
Tracks source repository information for each blob in the blobsum
service, which is then used to attempt to mount blobs from another
repository when pushing instead of having to re-push blobs to the same
registry.

Signed-off-by: Brian Bland <brian.bland@docker.com>
Upstream-commit: 7289c7218e2101eb94fb90f2cb22e1412d016984
Component: engine
2016-01-13 14:26:30 -08:00
4d0b394b25 Build a pre-schema2 registry to test schema1 push/pull
Add DockerSchema1RegistrySuite which uses this registry, and make
applicable integration tests run as part of this suite.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1fa2e3115105f6b2334f452bd08415e8f00633d7
Component: engine
2016-01-08 17:27:31 -08:00
f4511c75b9 Add an integration test for docker being able to push to a repo with delegations.
Signed-off-by: cyli <cyli@twistedmatrix.com>
Upstream-commit: 1db0c7bb01863f859a193246a0474f9d1b4d6027
Component: engine
2016-01-07 19:35:45 -08:00
b741751f8d Notary delegation integration into docker
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 1c125f50cfce422b19a15e84c5a3940890fb2e23
Component: engine
2016-01-07 19:35:45 -08:00
8c68850665 integration-cli: fix test name typo
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 09c4643ce1e9c0ae29e0489daefe0053aeed260f
Component: engine
2015-12-05 11:42:46 +01:00
e105a29374 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>
Upstream-commit: 4352da7803d182a6013a5238ce20a7c749db979a
Component: engine
2015-11-24 09:40:25 -08:00
7d18cf6c65 Correct parent chain in v2 push when v1Compatibility files on the disk are inconsistent
This fixes an issue where two images with the same filesystem contents
and configuration but different remote IDs could share a v1Compatibility
file, resulting in corrupted manifests.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 0ab6b1d9221f7a2a65c6565fed8f3d6f29fcec2d
Component: engine
2015-11-17 16:05:09 -08:00
1c03807ac5 fixing tests for updated CLI output
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
Upstream-commit: 52021ac2a4f2b32a6ad7444b182b569c616e500e
Component: engine
2015-11-13 13:20:55 -08:00
04eb439359 Use checker on integration test when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 710817a71b40287acc546fe2e08367b2a02dae54
Component: engine
2015-10-22 15:53:17 +08:00
1dd074a72b Adding tests for backwards compatibility
Signed-off-by: Diogo Monica <diogo@docker.com>
Upstream-commit: 63f8db83aab9f79236df67c0be2c901f7e1b7c23
Component: engine
2015-10-09 12:20:19 -07:00
5d84a009ca Changing trustServer allowed URL behavior
Signed-off-by: Diogo Monica <diogo@docker.com>
Upstream-commit: a2f9fb7777ab4ff90747a1fe67dda9046686acad
Component: engine
2015-10-08 17:47:25 -07:00
0dc44a70e4 Ignore ping errors in notary repository setup
Notary is capable of acting in offline mode, making use of cache TUF data.
When ping is not successful, notary should still be attempted without error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 5e11cd43aa21a9d0eb1f5f205f05dc7b14ee4d43
Component: engine
2015-09-14 11:08:25 -07:00
9980495b3c Remove TestPushInterrupt
This test relies on a race condition, and has been failing often in CI.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 6cc38775bbff9b9304e551b26593af9c867c61bb
Component: engine
2015-09-02 15:30:55 -07:00
78b5767538 Avoid buffering to tempfile when pushing with V2
The practice of buffering to a tempfile during a pushing contributes massively
to slow V2 push performance perception. The protocol was actually designed to
avoid precalculation, supporting cut-through data push. This means we can
assemble the layer, calculate its digest and push to the remote endpoint, all
at the same time.

This should increase performance massively on systems with slow disks or IO
bottlenecks.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 349aef06d51a9425f70a877585fe45283366c2c4
Component: engine
2015-08-24 18:08:05 -07:00
f6cb9362d1 Update regression test
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 697cdb8e2f288190034b9f72bbd747d02d9643da
Component: engine
2015-08-12 18:46:55 -07:00