Browse code

make the error message in TestRunSeccompDefaultProfile more precise

Signed-off-by: Shijiang Wei <mountkin@gmail.com>

Shijiang Wei authored on 2016/05/27 20:11:48
Showing 1 changed files
... ...
@@ -1041,7 +1041,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1041 1041
 	go func() {
1042 1042
 		out, _, err := dockerCmdWithError("run", "syscall-test", "acct-test")
1043 1043
 		if err == nil || !strings.Contains(out, "Operation not permitted") {
1044
-			errChan <- fmt.Errorf("expected Operation not permitted, got: %s", out)
1044
+			errChan <- fmt.Errorf("goroutine 0: expected Operation not permitted, got: %s", out)
1045 1045
 		}
1046 1046
 		group.Done()
1047 1047
 	}()
... ...
@@ -1049,7 +1049,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1049 1049
 	go func() {
1050 1050
 		out, _, err := dockerCmdWithError("run", "--cap-add", "sys_admin", "syscall-test", "acct-test")
1051 1051
 		if err == nil || !strings.Contains(out, "Operation not permitted") {
1052
-			errChan <- fmt.Errorf("expected Operation not permitted, got: %s", out)
1052
+			errChan <- fmt.Errorf("goroutine 1: expected Operation not permitted, got: %s", out)
1053 1053
 		}
1054 1054
 		group.Done()
1055 1055
 	}()
... ...
@@ -1057,7 +1057,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1057 1057
 	go func() {
1058 1058
 		out, _, err := dockerCmdWithError("run", "--cap-add", "sys_pacct", "syscall-test", "acct-test")
1059 1059
 		if err == nil || !strings.Contains(out, "No such file or directory") {
1060
-			errChan <- fmt.Errorf("expected No such file or directory, got: %s", out)
1060
+			errChan <- fmt.Errorf("goroutine 2: expected No such file or directory, got: %s", out)
1061 1061
 		}
1062 1062
 		group.Done()
1063 1063
 	}()
... ...
@@ -1065,7 +1065,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1065 1065
 	go func() {
1066 1066
 		out, _, err := dockerCmdWithError("run", "--cap-add", "ALL", "syscall-test", "acct-test")
1067 1067
 		if err == nil || !strings.Contains(out, "No such file or directory") {
1068
-			errChan <- fmt.Errorf("expected No such file or directory, got: %s", out)
1068
+			errChan <- fmt.Errorf("goroutine 3: expected No such file or directory, got: %s", out)
1069 1069
 		}
1070 1070
 		group.Done()
1071 1071
 	}()
... ...
@@ -1073,7 +1073,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1073 1073
 	go func() {
1074 1074
 		out, _, err := dockerCmdWithError("run", "--cap-drop", "ALL", "--cap-add", "sys_pacct", "syscall-test", "acct-test")
1075 1075
 		if err == nil || !strings.Contains(out, "No such file or directory") {
1076
-			errChan <- fmt.Errorf("expected No such file or directory, got: %s", out)
1076
+			errChan <- fmt.Errorf("goroutine 4: expected No such file or directory, got: %s", out)
1077 1077
 		}
1078 1078
 		group.Done()
1079 1079
 	}()
... ...
@@ -1096,7 +1096,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1096 1096
 	go func() {
1097 1097
 		out, _, err := dockerCmdWithError("run", "syscall-test", "ns-test", "echo", "hello0")
1098 1098
 		if err == nil || !strings.Contains(out, "Operation not permitted") {
1099
-			errChan <- fmt.Errorf("expected Operation not permitted, got: %s", out)
1099
+			errChan <- fmt.Errorf("goroutine 0: expected Operation not permitted, got: %s", out)
1100 1100
 		}
1101 1101
 		group.Done()
1102 1102
 	}()
... ...
@@ -1104,7 +1104,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1104 1104
 	go func() {
1105 1105
 		out, _, err := dockerCmdWithError("run", "--cap-add", "sys_admin", "syscall-test", "ns-test", "echo", "hello1")
1106 1106
 		if err != nil || !strings.Contains(out, "hello1") {
1107
-			errChan <- fmt.Errorf("expected hello1, got: %s, %v", out, err)
1107
+			errChan <- fmt.Errorf("goroutine 1: expected hello1, got: %s, %v", out, err)
1108 1108
 		}
1109 1109
 		group.Done()
1110 1110
 	}()
... ...
@@ -1112,7 +1112,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1112 1112
 	go func() {
1113 1113
 		out, _, err := dockerCmdWithError("run", "--cap-drop", "all", "--cap-add", "sys_admin", "syscall-test", "ns-test", "echo", "hello2")
1114 1114
 		if err != nil || !strings.Contains(out, "hello2") {
1115
-			errChan <- fmt.Errorf("expected hello2, got: %s, %v", out, err)
1115
+			errChan <- fmt.Errorf("goroutine 2: expected hello2, got: %s, %v", out, err)
1116 1116
 		}
1117 1117
 		group.Done()
1118 1118
 	}()
... ...
@@ -1120,7 +1120,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1120 1120
 	go func() {
1121 1121
 		out, _, err := dockerCmdWithError("run", "--cap-add", "ALL", "syscall-test", "ns-test", "echo", "hello3")
1122 1122
 		if err != nil || !strings.Contains(out, "hello3") {
1123
-			errChan <- fmt.Errorf("expected hello3, got: %s, %v", out, err)
1123
+			errChan <- fmt.Errorf("goroutine 3: expected hello3, got: %s, %v", out, err)
1124 1124
 		}
1125 1125
 		group.Done()
1126 1126
 	}()
... ...
@@ -1128,7 +1128,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1128 1128
 	go func() {
1129 1129
 		out, _, err := dockerCmdWithError("run", "--cap-add", "ALL", "--security-opt", "seccomp=unconfined", "syscall-test", "acct-test")
1130 1130
 		if err == nil || !strings.Contains(out, "No such file or directory") {
1131
-			errChan <- fmt.Errorf("expected No such file or directory, got: %s", out)
1131
+			errChan <- fmt.Errorf("goroutine 4: expected No such file or directory, got: %s", out)
1132 1132
 		}
1133 1133
 		group.Done()
1134 1134
 	}()
... ...
@@ -1136,7 +1136,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1136 1136
 	go func() {
1137 1137
 		out, _, err := dockerCmdWithError("run", "--cap-add", "ALL", "--security-opt", "seccomp=unconfined", "syscall-test", "ns-test", "echo", "hello4")
1138 1138
 		if err != nil || !strings.Contains(out, "hello4") {
1139
-			errChan <- fmt.Errorf("expected hello4, got: %s, %v", out, err)
1139
+			errChan <- fmt.Errorf("goroutine 5: expected hello4, got: %s, %v", out, err)
1140 1140
 		}
1141 1141
 		group.Done()
1142 1142
 	}()