Signed-off-by: Jessica Frazelle <princess@docker.com>
| ... | ... |
@@ -3057,71 +3057,64 @@ func (s *DockerSuite) TestRunPidHostWithChildIsKillable(c *check.C) {
|
| 3057 | 3057 |
} |
| 3058 | 3058 |
} |
| 3059 | 3059 |
|
| 3060 |
-func TestRunWithTooSmallMemoryLimit(t *testing.T) {
|
|
| 3060 |
+func (s *DockerSuite) TestRunWithTooSmallMemoryLimit(c *check.C) {
|
|
| 3061 | 3061 |
defer deleteAllContainers() |
| 3062 | 3062 |
// this memory limit is 1 byte less than the min, which is 4MB |
| 3063 | 3063 |
// https://github.com/docker/docker/blob/v1.5.0/daemon/create.go#L22 |
| 3064 | 3064 |
out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-m", "4194303", "busybox")) |
| 3065 | 3065 |
if err == nil || !strings.Contains(out, "Minimum memory limit allowed is 4MB") {
|
| 3066 |
- t.Fatalf("expected run to fail when using too low a memory limit: %q", out)
|
|
| 3066 |
+ c.Fatalf("expected run to fail when using too low a memory limit: %q", out)
|
|
| 3067 | 3067 |
} |
| 3068 |
- |
|
| 3069 |
- logDone("run - can't set too low memory limit")
|
|
| 3070 | 3068 |
} |
| 3071 | 3069 |
|
| 3072 |
-func TestRunWriteToProcAsound(t *testing.T) {
|
|
| 3070 |
+func (s *DockerSuite) TestRunWriteToProcAsound(c *check.C) {
|
|
| 3073 | 3071 |
defer deleteAllContainers() |
| 3074 | 3072 |
code, err := runCommand(exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "echo 111 >> /proc/asound/version")) |
| 3075 | 3073 |
if err == nil || code == 0 {
|
| 3076 |
- t.Fatal("standard container should not be able to write to /proc/asound")
|
|
| 3074 |
+ c.Fatal("standard container should not be able to write to /proc/asound")
|
|
| 3077 | 3075 |
} |
| 3078 |
- logDone("run - ro write to /proc/asound")
|
|
| 3079 | 3076 |
} |
| 3080 | 3077 |
|
| 3081 |
-func TestRunReadProcTimer(t *testing.T) {
|
|
| 3078 |
+func (s *DockerSuite) TestRunReadProcTimer(c *check.C) {
|
|
| 3082 | 3079 |
defer deleteAllContainers() |
| 3083 | 3080 |
out, code, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "busybox", "cat", "/proc/timer_stats")) |
| 3084 | 3081 |
if err != nil || code != 0 {
|
| 3085 |
- t.Fatal(err) |
|
| 3082 |
+ c.Fatal(err) |
|
| 3086 | 3083 |
} |
| 3087 | 3084 |
if strings.Trim(out, "\n ") != "" {
|
| 3088 |
- t.Fatalf("expected to receive no output from /proc/timer_stats but received %q", out)
|
|
| 3085 |
+ c.Fatalf("expected to receive no output from /proc/timer_stats but received %q", out)
|
|
| 3089 | 3086 |
} |
| 3090 |
- logDone("run - read /proc/timer_stats")
|
|
| 3091 | 3087 |
} |
| 3092 | 3088 |
|
| 3093 |
-func TestRunReadProcLatency(t *testing.T) {
|
|
| 3089 |
+func (s *DockerSuite) TestRunReadProcLatency(c *check.C) {
|
|
| 3094 | 3090 |
// some kernels don't have this configured so skip the test if this file is not found |
| 3095 | 3091 |
// on the host running the tests. |
| 3096 | 3092 |
if _, err := os.Stat("/proc/latency_stats"); err != nil {
|
| 3097 |
- t.Skip() |
|
| 3093 |
+ c.Skip("kernel doesnt have latency_stats configured")
|
|
| 3098 | 3094 |
return |
| 3099 | 3095 |
} |
| 3100 | 3096 |
defer deleteAllContainers() |
| 3101 | 3097 |
out, code, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "busybox", "cat", "/proc/latency_stats")) |
| 3102 | 3098 |
if err != nil || code != 0 {
|
| 3103 |
- t.Fatal(err) |
|
| 3099 |
+ c.Fatal(err) |
|
| 3104 | 3100 |
} |
| 3105 | 3101 |
if strings.Trim(out, "\n ") != "" {
|
| 3106 |
- t.Fatalf("expected to receive no output from /proc/latency_stats but received %q", out)
|
|
| 3102 |
+ c.Fatalf("expected to receive no output from /proc/latency_stats but received %q", out)
|
|
| 3107 | 3103 |
} |
| 3108 |
- logDone("run - read /proc/latency_stats")
|
|
| 3109 | 3104 |
} |
| 3110 | 3105 |
|
| 3111 |
-func TestMountIntoProc(t *testing.T) {
|
|
| 3106 |
+func (s *DockerSuite) TestMountIntoProc(c *check.C) {
|
|
| 3112 | 3107 |
defer deleteAllContainers() |
| 3113 | 3108 |
code, err := runCommand(exec.Command(dockerBinary, "run", "-v", "/proc//sys", "busybox", "true")) |
| 3114 | 3109 |
if err == nil || code == 0 {
|
| 3115 |
- t.Fatal("container should not be able to mount into /proc")
|
|
| 3110 |
+ c.Fatal("container should not be able to mount into /proc")
|
|
| 3116 | 3111 |
} |
| 3117 |
- logDone("run - mount into proc")
|
|
| 3118 | 3112 |
} |
| 3119 | 3113 |
|
| 3120 |
-func TestMountIntoSys(t *testing.T) {
|
|
| 3114 |
+func (s *DockerSuite) TestMountIntoSys(c *check.C) {
|
|
| 3121 | 3115 |
defer deleteAllContainers() |
| 3122 | 3116 |
code, err := runCommand(exec.Command(dockerBinary, "run", "-v", "/sys/", "busybox", "true")) |
| 3123 | 3117 |
if err == nil || code == 0 {
|
| 3124 |
- t.Fatal("container should not be able to mount into /sys")
|
|
| 3118 |
+ c.Fatal("container should not be able to mount into /sys")
|
|
| 3125 | 3119 |
} |
| 3126 |
- logDone("run - mount into sys")
|
|
| 3127 | 3120 |
} |