|
@@ -289,24 +289,24 @@ func TestValidatePath(t *testing.T) {
|
|
"/rw:rw",
|
|
"/rw:rw",
|
|
}
|
|
}
|
|
invalid := map[string]string{
|
|
invalid := map[string]string{
|
|
- "": "bad format for volumes: ",
|
|
|
|
|
|
+ "": "bad format for path: ",
|
|
"./": "./ is not an absolute path",
|
|
"./": "./ is not an absolute path",
|
|
"../": "../ is not an absolute path",
|
|
"../": "../ is not an absolute path",
|
|
"/:../": "../ is not an absolute path",
|
|
"/:../": "../ is not an absolute path",
|
|
"/:path": "path is not an absolute path",
|
|
"/:path": "path is not an absolute path",
|
|
- ":": "bad format for volumes: :",
|
|
|
|
|
|
+ ":": "bad format for path: :",
|
|
"/tmp:": " is not an absolute path",
|
|
"/tmp:": " is not an absolute path",
|
|
- ":test": "bad format for volumes: :test",
|
|
|
|
- ":/test": "bad format for volumes: :/test",
|
|
|
|
|
|
+ ":test": "bad format for path: :test",
|
|
|
|
+ ":/test": "bad format for path: :/test",
|
|
"tmp:": " is not an absolute path",
|
|
"tmp:": " is not an absolute path",
|
|
- ":test:": "bad format for volumes: :test:",
|
|
|
|
- "::": "bad format for volumes: ::",
|
|
|
|
- ":::": "bad format for volumes: :::",
|
|
|
|
- "/tmp:::": "bad format for volumes: /tmp:::",
|
|
|
|
- ":/tmp::": "bad format for volumes: :/tmp::",
|
|
|
|
|
|
+ ":test:": "bad format for path: :test:",
|
|
|
|
+ "::": "bad format for path: ::",
|
|
|
|
+ ":::": "bad format for path: :::",
|
|
|
|
+ "/tmp:::": "bad format for path: /tmp:::",
|
|
|
|
+ ":/tmp::": "bad format for path: :/tmp::",
|
|
"path:ro": "path is not an absolute path",
|
|
"path:ro": "path is not an absolute path",
|
|
- "/path:/path:sw": "bad mount mode specified : sw",
|
|
|
|
- "/path:/path:rwz": "bad mount mode specified : rwz",
|
|
|
|
|
|
+ "/path:/path:sw": "bad mode specified: sw",
|
|
|
|
+ "/path:/path:rwz": "bad mode specified: rwz",
|
|
}
|
|
}
|
|
|
|
|
|
for _, path := range valid {
|
|
for _, path := range valid {
|
|
@@ -333,27 +333,30 @@ func TestValidateDevice(t *testing.T) {
|
|
"/with space",
|
|
"/with space",
|
|
"/home:/with space",
|
|
"/home:/with space",
|
|
"relative:/absolute-path",
|
|
"relative:/absolute-path",
|
|
- "hostPath:/containerPath:ro",
|
|
|
|
|
|
+ "hostPath:/containerPath:r",
|
|
"/hostPath:/containerPath:rw",
|
|
"/hostPath:/containerPath:rw",
|
|
"/hostPath:/containerPath:mrw",
|
|
"/hostPath:/containerPath:mrw",
|
|
}
|
|
}
|
|
invalid := map[string]string{
|
|
invalid := map[string]string{
|
|
- "": "bad format for volumes: ",
|
|
|
|
|
|
+ "": "bad format for path: ",
|
|
"./": "./ is not an absolute path",
|
|
"./": "./ is not an absolute path",
|
|
"../": "../ is not an absolute path",
|
|
"../": "../ is not an absolute path",
|
|
"/:../": "../ is not an absolute path",
|
|
"/:../": "../ is not an absolute path",
|
|
"/:path": "path is not an absolute path",
|
|
"/:path": "path is not an absolute path",
|
|
- ":": "bad format for volumes: :",
|
|
|
|
|
|
+ ":": "bad format for path: :",
|
|
"/tmp:": " is not an absolute path",
|
|
"/tmp:": " is not an absolute path",
|
|
- ":test": "bad format for volumes: :test",
|
|
|
|
- ":/test": "bad format for volumes: :/test",
|
|
|
|
|
|
+ ":test": "bad format for path: :test",
|
|
|
|
+ ":/test": "bad format for path: :/test",
|
|
"tmp:": " is not an absolute path",
|
|
"tmp:": " is not an absolute path",
|
|
- ":test:": "bad format for volumes: :test:",
|
|
|
|
- "::": "bad format for volumes: ::",
|
|
|
|
- ":::": "bad format for volumes: :::",
|
|
|
|
- "/tmp:::": "bad format for volumes: /tmp:::",
|
|
|
|
- ":/tmp::": "bad format for volumes: :/tmp::",
|
|
|
|
|
|
+ ":test:": "bad format for path: :test:",
|
|
|
|
+ "::": "bad format for path: ::",
|
|
|
|
+ ":::": "bad format for path: :::",
|
|
|
|
+ "/tmp:::": "bad format for path: /tmp:::",
|
|
|
|
+ ":/tmp::": "bad format for path: :/tmp::",
|
|
"path:ro": "ro is not an absolute path",
|
|
"path:ro": "ro is not an absolute path",
|
|
|
|
+ "path:rr": "rr is not an absolute path",
|
|
|
|
+ "a:/b:ro": "bad mode specified: ro",
|
|
|
|
+ "a:/b:rr": "bad mode specified: rr",
|
|
}
|
|
}
|
|
|
|
|
|
for _, path := range valid {
|
|
for _, path := range valid {
|