mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-08 06:51:40 +00:00
Revert client signature
Supports multiple tag push with daemon signature Fixes #10444 Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
@@ -45,7 +45,7 @@ func TestPushUntagged(t *testing.T) {
|
||||
|
||||
repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
|
||||
|
||||
expected := "does not exist"
|
||||
expected := "No tags to push"
|
||||
pushCmd := exec.Command(dockerBinary, "push", repoName)
|
||||
if out, _, err := runCommandWithOutput(pushCmd); err == nil {
|
||||
t.Fatalf("pushing the image to the private registry should have failed: outuput %q", out)
|
||||
@@ -55,6 +55,46 @@ func TestPushUntagged(t *testing.T) {
|
||||
logDone("push - untagged image")
|
||||
}
|
||||
|
||||
func TestPushBadTag(t *testing.T) {
|
||||
defer setupRegistry(t)()
|
||||
|
||||
repoName := fmt.Sprintf("%v/dockercli/busybox:latest", privateRegistryURL)
|
||||
|
||||
expected := "does not exist"
|
||||
pushCmd := exec.Command(dockerBinary, "push", repoName)
|
||||
if out, _, err := runCommandWithOutput(pushCmd); err == nil {
|
||||
t.Fatalf("pushing the image to the private registry should have failed: outuput %q", out)
|
||||
} else if !strings.Contains(out, expected) {
|
||||
t.Fatalf("pushing the image failed with an unexpected message: expected %q, got %q", expected, out)
|
||||
}
|
||||
logDone("push - image with bad tag")
|
||||
}
|
||||
|
||||
func TestPushMultipleTags(t *testing.T) {
|
||||
defer setupRegistry(t)()
|
||||
|
||||
repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
|
||||
repoTag1 := fmt.Sprintf("%v/dockercli/busybox:t1", privateRegistryURL)
|
||||
repoTag2 := fmt.Sprintf("%v/dockercli/busybox:t2", privateRegistryURL)
|
||||
// tag the image to upload it tot he private registry
|
||||
tagCmd1 := exec.Command(dockerBinary, "tag", "busybox", repoTag1)
|
||||
if out, _, err := runCommandWithOutput(tagCmd1); err != nil {
|
||||
t.Fatalf("image tagging failed: %s, %v", out, err)
|
||||
}
|
||||
defer deleteImages(repoTag1)
|
||||
tagCmd2 := exec.Command(dockerBinary, "tag", "busybox", repoTag2)
|
||||
if out, _, err := runCommandWithOutput(tagCmd2); err != nil {
|
||||
t.Fatalf("image tagging failed: %s, %v", out, err)
|
||||
}
|
||||
defer deleteImages(repoTag2)
|
||||
|
||||
pushCmd := exec.Command(dockerBinary, "push", repoName)
|
||||
if out, _, err := runCommandWithOutput(pushCmd); err != nil {
|
||||
t.Fatalf("pushing the image to the private registry has failed: %s, %v", out, err)
|
||||
}
|
||||
logDone("push - multiple tags to private registry")
|
||||
}
|
||||
|
||||
func TestPushInterrupt(t *testing.T) {
|
||||
defer setupRegistry(t)()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user