Fix Tag Test for longer tags

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: de32f48e6668e9f071272d588cf6acdd7090b9ca
Component: engine
This commit is contained in:
Jessica Frazelle
2014-10-07 19:07:51 -07:00
parent 4ed325655c
commit b7f1d56490
3 changed files with 15 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"math/rand"
"net/http"
"net/http/httptest"
"os"
@ -255,3 +256,13 @@ func copyWithCP(source, target string) error {
}
return nil
}
func makeRandomString(n int) string {
// make a really long string
letters := []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
b := make([]byte, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}