mirror of
https://github.com/containers/skopeo.git
synced 2026-07-08 12:04:59 +00:00
Use it based on the outcome from our community discussion[1]. [1] https://github.com/containers/podman/discussions/27291 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package main
|
|
|
|
const (
|
|
blockedRegistriesConf = "./fixtures/blocked-registries.conf"
|
|
blockedErrorRegex = `.*registry registry-blocked.com is blocked in .*`
|
|
)
|
|
|
|
func (s *skopeoSuite) TestCopyBlockedSource() {
|
|
t := s.T()
|
|
assertSkopeoFails(t, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "copy",
|
|
"docker://registry-blocked.com/image:test",
|
|
"docker://registry-unblocked.com/image:test")
|
|
}
|
|
|
|
func (s *skopeoSuite) TestCopyBlockedDestination() {
|
|
t := s.T()
|
|
assertSkopeoFails(t, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "copy",
|
|
"docker://registry-unblocked.com/image:test",
|
|
"docker://registry-blocked.com/image:test")
|
|
}
|
|
|
|
func (s *skopeoSuite) TestInspectBlocked() {
|
|
t := s.T()
|
|
assertSkopeoFails(t, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "inspect",
|
|
"docker://registry-blocked.com/image:test")
|
|
}
|
|
|
|
func (s *skopeoSuite) TestDeleteBlocked() {
|
|
t := s.T()
|
|
assertSkopeoFails(t, blockedErrorRegex,
|
|
"--registries-conf", blockedRegistriesConf, "delete",
|
|
"docker://registry-blocked.com/image:test")
|
|
}
|