Commit Graph

15 Commits

Author SHA1 Message Date
Ying Li befd30e9a4 Add tests for updating if server has metadata corruption such that the checksum was valid.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-29 11:01:31 -08:00
Ying Li f8a0e46b6c Add test for when any downloaded metadata has an invalid checksum compared to snapshot or timestamp.
Signed-off-by: Ying Li <ying.li@docker.com>

Conflicts:
	client/client_update_test.go
2016-01-29 11:01:31 -08:00
Riyaz Faizullabhoy 41643d4a9c make -1 read up to 100MB of data, use for non-timestamps. Reduce
timestamp to 1MB max

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-28 10:17:17 -08:00
Riyaz Faizullabhoy a6159a45d1 ensure filestore GetMeta only returns up to size bytes. Standardize constant for max size
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-28 10:16:19 -08:00
Ying Li 499d5a7c0c Add an extra targets/b delegation chain to the tests.
Also, shorten some of the options (do not specify false, since that's default).

Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-21 16:34:53 -08:00
Ying Li e79839b216 Add better error reporting for update tests.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-21 13:23:30 -08:00
Ying Li dde9531b4a Fix an error where we get a JSON syntax error on server 404 or 50X.
We were testing to see if the cached metadata was nil, but we actually
set it to an empty data.Signed object, but didn't always set it to nil
if we failed to get local metadata.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-21 13:23:30 -08:00
Ying Li 36684a3290 Use cached timestamp if we get a 404 when updating timestamp.
We use the cached timestamp for all other errors, so this makes the
error consistent.  The only special metadata is the root.json, where a 404
signifies that the repository doesn't exist.  Also update the message
when a cached timestamp is used.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-21 13:23:16 -08:00
Ying Li 803205d8bf Update and add tests for what happens if the remote repo 404's or 500's on root.json.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-20 14:41:54 -08:00
Ying Li df53f51b0b Refactor swizzler to not produce a repo itself, but to just take some initial metadata.
Updated the testutils/repo.go utility to be able to produce a repository with delegations
and to export metadata from said repo instead.

Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-20 10:02:14 -08:00
Ying Li 1404aa9dad Remove client update tests for which it seems like the user is actively sabotaging themselves.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-19 16:32:34 -08:00
Ying Li edc30ffdb9 Skip the longer client update tests if testing in short mode.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-19 16:28:52 -08:00
Ying Li ea0a64eeab Add a few tests for updating when the local repo is corrupt.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-19 16:28:52 -08:00
Ying Li 4f8d28ad7f Add tests for updating replacing corrupted local cache
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-19 14:07:46 -08:00
Ying Li d4820c5756 Translate ErrMetaNotFound when updating, so long as it's on root, to ErrRepositoryNotExist.
Signed-off-by: Ying Li <ying.li@docker.com>
2016-01-14 15:27:11 -08:00