-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_cli_create_unix_test.go
More file actions
43 lines (39 loc) · 949 Bytes
/
docker_cli_create_unix_test.go
File metadata and controls
43 lines (39 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// +build !windows
package main
import (
"strings"
"github.com/go-check/check"
)
// Test case for #30166 (target was not validated)
func (s *DockerSuite) TestCreateTmpfsMountsTarget(c *check.C) {
testRequires(c, DaemonIsLinux)
type testCase struct {
target string
expectedError string
}
cases := []testCase{
{
target: ".",
expectedError: "mount path must be absolute",
},
{
target: "foo",
expectedError: "mount path must be absolute",
},
{
target: "/",
expectedError: "destination can't be '/'",
},
{
target: "//",
expectedError: "destination can't be '/'",
},
}
for _, x := range cases {
out, _, _ := dockerCmdWithError("create", "--tmpfs", x.target, "busybox", "sh")
if x.expectedError != "" && !strings.Contains(out, x.expectedError) {
c.Fatalf("mounting tmpfs over %q should fail with %q, but got %q",
x.target, x.expectedError, out)
}
}
}