Merge pull request #11522 from duglin/FixCGroupTests

Ignore blank lines in getCgroupPaths
Upstream-commit: 0dca963f403d7b0fd700da2076420ea72e05866f
Component: engine
This commit is contained in:
Jessie Frazelle
2015-03-20 10:44:57 -07:00

View File

@ -112,6 +112,10 @@ func TestRunWithUlimits(t *testing.T) {
func getCgroupPaths(test string) map[string]string {
cgroupPaths := map[string]string{}
for _, line := range strings.Split(test, "\n") {
line = strings.TrimSpace(line)
if line == "" {
continue
}
parts := strings.Split(line, ":")
if len(parts) != 3 {
fmt.Printf("unexpected file format for /proc/self/cgroup - %q\n", line)