Commit Graph

30 Commits

Author SHA1 Message Date
Miloslav Trmač
70c06b4ac0 Fix, or remove, comments using lint syntax
golangci-lint linter: gocritic

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-02-03 17:48:16 +01:00
Miloslav Trmač
955a59c864 Update tests for changed error texts
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-12 22:56:46 +02:00
Miloslav Trmač
1983173b60 Remove single-use "wanted" variables
They were useful before assertSkopeoSucceeds/assertSkopeoFails,
when they were used multiple times. Now, they don't
make the code any shorter.

Should not change (test) behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-12 22:09:48 +02:00
Miloslav Trmač
693de29e37 Add various missing error handling
... as found by (golangci-lint run).

Note: this does not add (golangci-lint run) to the Makefile
to ensure the coding standard.

(BTW golangci-lint currently fails on structcheck, which doesn't
handle embedded structs, and that's a years-long known unfixed
limitation.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-03-15 21:48:51 +01:00
Miloslav Trmač
c399909f04 Update non-module dependencies
Dependabot was apparently not picking these up (and
several haven't had a release for a long time anyway).

Also move from github.com/go-check/check to its newly
declared (and go.mod-enforced) name gopkg.in/check.v1.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-08-23 15:52:48 +02:00
Chris Evich
285a5cb6a0
Fix using images from rate-limited docker hub
The necessary images have been manually copied over to quay.  Code was
updated with centralized constants for the utilized images.  Tests then
all reference the constants (in case the image locations need to change
again).

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-07-22 16:28:20 -04:00
Josh Soref
4987a67293 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-21 16:10:45 -05:00
Qi Wang
0ec2610f04 Add skopeo login&logout
Implements skopeo login&logout commands.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-11 16:35:46 -04:00
Qi Wang
46fbbbd282 Use cobra in skopeo
Use cobra in skopeo can help share code with podman/buildah(code for skopeo login/logout CLI).
(libpod issue  #839)

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-04 14:50:15 -04:00
Tristan Cacqueray
8fb4ab3d92 Add integration test for invalid reference
This change adds a couple of tests to prevent further regression
introduced by https://github.com/containers/skopeo/pull/653

Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2019-05-19 03:02:19 +00:00
Flavio Castelli
2684e51aa5
Complete transition from the projectactomic project to the containers one
Replace the occurrences of `github.com/projectatomic` with
`github.com/containers` to ensure clean clones of the project are
building, travis badges on the README work as expected and other minor
things.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2018-08-14 10:10:06 +02:00
Miloslav Trmač
cd300805d1 Remove registry instances which we don’t use at all 2017-05-10 14:46:12 +02:00
Miloslav Trmač
9985f12cd4 Move skopeoBinary check from *Suite.SetUpTest to SetUpSuite
The results are not going to vary across individual tests, so let’s only
check once.
2017-05-10 14:44:20 +02:00
Erez Freiberger
1491651ea9 adding tests 2017-03-20 12:53:34 +02:00
Antonio Murdaca
342ba18561
use user/pass flags
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-11-30 17:10:42 +01:00
Antonio Murdaca
a48f7597e3
vendor containers/image for better registry errors
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-12 14:53:46 +02:00
Miloslav Trmač
2a8ffee621 Flip --tls-verify default to true
Document better what --tls-verify does

... and sprinkle --tls-verify=false over integration tests.
2016-09-13 19:26:21 +02:00
Miloslav Trmač
0cb6cc6222 Fix integration tests on CentOS
This fixes --version integration test on CentOS, as noticed by
https://github.com/projectatomic/skopeo/pull/91 .  The underlying cause
is:
- Makefile builds with -ldflags "-X var=value", while go 1.4.2 only
  supports "-X var value".  This causes CentOS builds to be built
  without the specific commit information
- The --version integration test assumes that commit information will
  always follow the version number.

Changing either one of these would fix the build, changing the
integration test has the advantage that we don't have to use the
obsolete -X syntax and suffer warnings on newer Go versions.
2016-07-01 23:31:07 +02:00
Antonio Murdaca
064d37134b cmd: skopeo: fix version
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-30 17:46:45 +02:00
Miloslav Trmač
39b06cb31c Add more helpers for running skopeo, use them in existing tests
- consumeAndLogOutputs
- assertSkopeoSucceeds
- assertSkopeoFails
- runCommandWithInput
All of these allow running commands as one-liners with no call-site
error handling, making tests much more readable.

Also modifies TestNoNeedAuthToPrivateRegistryV2ImageNotFound to use
check.Matches instead of manual strings.Contains conditions, which is
shorter and more consistent with the assertSkopeo... calls.
2016-06-22 16:19:59 +02:00
Antonio Murdaca
3a09e2bf8e clean vendors and bootstrap tls verify
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-23 10:27:59 +01:00
Antonio Murdaca
c02155340e include needed deps
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-22 16:29:16 +01:00
Antonio Murdaca
fed651449e remove vendors ftw
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-22 16:02:55 +01:00
Antonio Murdaca
50a2ed1124 fix CI and remove docker/ dir
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-22 15:50:41 +01:00
Antonio Murdaca
0109708048 fix missing comma in tests
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-16 10:26:54 +01:00
Antonio Murdaca
adbf487541 fix readme, tests and vendors
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-16 10:21:36 +01:00
Antonio Murdaca
370f1bc685 reg v1 setup wip
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-04 13:02:52 +01:00
Antonio Murdaca
3de433ea4a re-enable and fix failing tests
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-02 13:51:10 +01:00
Antonio Murdaca
6cfd14f0c0 lots of todo and fixes
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-02 11:44:49 +01:00
Antonio Murdaca
e17927ca1d add basic test infrastructure
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-01-23 18:31:03 +01:00