mirror of
https://github.com/containers/skopeo.git
synced 2025-04-28 11:14:08 +00:00
Vendor in the latest c/image to enforce blocking of registries when creating a c/image/docker.dockerClient. Add integration tests to avoid regressions. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"github.com/go-check/check"
|
|
)
|
|
|
|
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")
|
|
}
|