1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg
Kir Kolyshkin 05cbe23db9 pkg/tarsum: fix unit test for Go 1.11+
Since go-1.11beta1 archive/tar, tar headers with Typeflag == TypeRegA
(numeric 0) (which is the default unless explicitly initialized) are
modified to have Typeflag set to either tar.TypeReg (character value
'0', not numeric 0) or tar.TypeDir (character value '5') [1].
This results in different Typeflag value in the resulting header,
leading to a different Checksum, and causing the following test
case errors:

> 12:09:14 --- FAIL: TestTarSums (0.05s)
> 12:09:14 tarsum_test.go:393: expecting
> [tarsum+sha256:8bf12d7e67c51ee2e8306cba569398b1b9f419969521a12ffb9d8875e8836738],
> but got
> [tarsum+sha256:75258b2c5dcd9adfe24ce71eeca5fc5019c7e669912f15703ede92b1a60cb11f]
> ... (etc.)

All the other code explicitly sets the Typeflag field, but this test
case is not, causing the incompatibility with Go 1.11. Therefore,
the fix is to set TypeReg explicitly, and change the expected checksums
in test cases).

Alternatively, we can vendor archive/tar again (for the 100th time),
but given that the issue is limited to the particular test case it
does not make sense.

This fixes the test for all Go versions.

[1] https://go-review.googlesource.com/c/go/+/85656

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-07-19 10:38:45 +03:00
..
aaparser Add canonical import comment 2018-02-05 16:51:57 -05:00
archive LCOW: lazycontext: Use correct lstat, fix archive check 2018-06-27 13:29:21 -07:00
authorization Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
broadcaster Various code-cleanup 2018-05-23 17:50:54 +02:00
chrootarchive Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
containerfs Set format in archiver 2018-04-12 13:34:33 -07:00
devicemapper Various code-cleanup 2018-05-23 17:50:54 +02:00
directory Extract volume interaction to a volumes service 2018-05-25 14:21:07 -04:00
discovery Add canonical import comment 2018-02-05 16:51:57 -05:00
dmesg Add canonical import comment 2018-02-05 16:51:57 -05:00
filenotify Add canonical import comment 2018-02-05 16:51:57 -05:00
fileutils Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
fsutils Add canonical import comment 2018-02-05 16:51:57 -05:00
homedir Add canonical import comment 2018-02-05 16:51:57 -05:00
idtools Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
ioutils Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
jsonmessage Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
locker Add canonical import comment 2018-02-05 16:51:57 -05:00
longpath Add canonical import comment 2018-02-05 16:51:57 -05:00
loopback Add canonical import comment 2018-02-05 16:51:57 -05:00
mount Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
namesgenerator Adds a few more names to the name generator. 2018-07-03 02:12:46 +01:00
parsers Windows: Move kernel_windows to use golang registry functions 2018-03-16 09:47:45 -07:00
pidfile Add canonical import comment 2018-02-05 16:51:57 -05:00
platform Add canonical import comment 2018-02-05 16:51:57 -05:00
plugingetter Move plugin client to separate interface 2018-05-30 15:22:10 -04:00
plugins Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
pools Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
progress Add canonical import comment 2018-02-05 16:51:57 -05:00
pubsub Various code-cleanup 2018-05-23 17:50:54 +02:00
reexec fix build on OpenBSD by defining Self() 2018-06-16 19:09:04 +02:00
signal Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
stdcopy Merge pull request #37088 from ohbarye/fix-typos-duplicated-the 2018-05-19 20:57:47 +02:00
streamformatter builder: return image ID in API when using buildkit 2018-07-03 19:11:02 +00:00
stringid Add canonical import comment 2018-02-05 16:51:57 -05:00
symlink Add canonical import comment 2018-02-05 16:51:57 -05:00
sysinfo Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
system system: add back lcow validation function 2018-06-27 15:24:26 -07:00
tailfile Fix typos in pkg 2018-02-10 19:43:13 +08:00
tarsum pkg/tarsum: fix unit test for Go 1.11+ 2018-07-19 10:38:45 +03:00
term Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
truncindex Various code-cleanup 2018-05-23 17:50:54 +02:00
urlutil Be explicit about github.com prefix being a legacy feature 2018-05-30 11:09:14 +02:00
useragent Add canonical import comment 2018-02-05 16:51:57 -05:00
README.md Rename a few docker to moby 2017-10-25 13:56:12 +02:00

pkg/ is a collection of utility packages used by the Moby project without being specific to its internals.

Utility packages are kept separate from the moby core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Moby organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!