mirror of
https://github.com/containers/skopeo.git
synced 2025-04-28 03:10:18 +00:00
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>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"gopkg.in/check.v1"
|
|
)
|
|
|
|
const blockedRegistriesConf = "./fixtures/blocked-registries.conf"
|
|
const blockedErrorRegex = `.*registry registry-blocked.com is blocked in .*`
|
|
|
|
func (s *SkopeoSuite) TestCopyBlockedSource(c *check.C) {
|
|
assertSkopeoFails(c, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "copy",
|
|
"docker://registry-blocked.com/image:test",
|
|
"docker://registry-unblocked.com/image:test")
|
|
}
|
|
|
|
func (s *SkopeoSuite) TestCopyBlockedDestination(c *check.C) {
|
|
assertSkopeoFails(c, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "copy",
|
|
"docker://registry-unblocked.com/image:test",
|
|
"docker://registry-blocked.com/image:test")
|
|
}
|
|
|
|
func (s *SkopeoSuite) TestInspectBlocked(c *check.C) {
|
|
assertSkopeoFails(c, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "inspect",
|
|
"docker://registry-blocked.com/image:test")
|
|
}
|
|
|
|
func (s *SkopeoSuite) TestDeleteBlocked(c *check.C) {
|
|
assertSkopeoFails(c, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "delete",
|
|
"docker://registry-blocked.com/image:test")
|
|
}
|