Merge pull request #10794 from ahmetalpbalkan/win-cli/TestContainerApi-volume-path-fix

integration-cli: Generate unix-style volume paths for tests
This commit is contained in:
Jessie Frazelle
2015-02-19 11:28:55 -08:00
2 changed files with 11 additions and 22 deletions
+7
View File
@@ -11,6 +11,7 @@ import (
"net/http/httptest"
"os"
"os/exec"
"path"
"reflect"
"strings"
"syscall"
@@ -277,6 +278,12 @@ func makeRandomString(n int) string {
return string(b)
}
// randomUnixTmpDirPath provides a temporary unix path with rand string appended.
// does not create or checks if it exists.
func randomUnixTmpDirPath(s string) string {
return path.Join("/tmp", fmt.Sprintf("%s.%s", s, makeRandomString(10)))
}
// Reads chunkSize bytes from reader after every interval.
// Returns total read bytes.
func consumeWithSpeed(reader io.Reader, chunkSize int, interval time.Duration, stop chan bool) (n int, err error) {