Browse code

Differentiate integration test error messages

Makes it easier to debug in the future given three different docker run
executions were all outputting the same error string.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)

Phil Estes authored on 2015/12/02 23:35:54
Showing 1 changed files
... ...
@@ -2858,18 +2858,18 @@ func (s *DockerSuite) TestRunUnshareProc(c *check.C) {
2858 2858
 
2859 2859
 	name := "acidburn"
2860 2860
 	if out, _, err := dockerCmdWithError("run", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "--mount-proc=/proc", "mount"); err == nil || !strings.Contains(out, "Permission denied") {
2861
-		c.Fatalf("unshare should have failed with permission denied, got: %s, %v", out, err)
2861
+		c.Fatalf("unshare with --mount-proc should have failed with permission denied, got: %s, %v", out, err)
2862 2862
 	}
2863 2863
 
2864 2864
 	name = "cereal"
2865 2865
 	if out, _, err := dockerCmdWithError("run", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc"); err == nil || !strings.Contains(out, "Permission denied") {
2866
-		c.Fatalf("unshare should have failed with permission denied, got: %s, %v", out, err)
2866
+		c.Fatalf("unshare and mount of /proc should have failed with permission denied, got: %s, %v", out, err)
2867 2867
 	}
2868 2868
 
2869 2869
 	/* Ensure still fails if running privileged with the default policy */
2870 2870
 	name = "crashoverride"
2871 2871
 	if out, _, err := dockerCmdWithError("run", "--privileged", "--security-opt", "apparmor:docker-default", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc"); err == nil || !(strings.Contains(strings.ToLower(out), "permission denied") || strings.Contains(strings.ToLower(out), "operation not permitted")) {
2872
-		c.Fatalf("unshare should have failed with permission denied, got: %s, %v", out, err)
2872
+		c.Fatalf("privileged unshare with apparmor should have failed with permission denied, got: %s, %v", out, err)
2873 2873
 	}
2874 2874
 }
2875 2875