浏览代码

Merge pull request #23802 from inercia/fix_docker_cli_run_test

Make sure we compare string with the same capitalization
Brian Goff 9 年之前
父节点
当前提交
f6326d3076
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. 10 4
      integration-cli/docker_cli_run_test.go

+ 10 - 4
integration-cli/docker_cli_run_test.go

@@ -757,7 +757,7 @@ func (s *DockerSuite) TestRunUserByIDBig(c *check.C) {
 	if err == nil {
 	if err == nil {
 		c.Fatal("No error, but must be.", out)
 		c.Fatal("No error, but must be.", out)
 	}
 	}
-	if !strings.Contains(out, libcontainerUser.ErrRange.Error()) {
+	if !strings.Contains(strings.ToUpper(out), strings.ToUpper(libcontainerUser.ErrRange.Error())) {
 		c.Fatalf("expected error about uids range, got %s", out)
 		c.Fatalf("expected error about uids range, got %s", out)
 	}
 	}
 }
 }
@@ -770,7 +770,7 @@ func (s *DockerSuite) TestRunUserByIDNegative(c *check.C) {
 	if err == nil {
 	if err == nil {
 		c.Fatal("No error, but must be.", out)
 		c.Fatal("No error, but must be.", out)
 	}
 	}
-	if !strings.Contains(out, libcontainerUser.ErrRange.Error()) {
+	if !strings.Contains(strings.ToUpper(out), strings.ToUpper(libcontainerUser.ErrRange.Error())) {
 		c.Fatalf("expected error about uids range, got %s", out)
 		c.Fatalf("expected error about uids range, got %s", out)
 	}
 	}
 }
 }
@@ -1454,10 +1454,16 @@ func (s *DockerSuite) TestRunResolvconfUpdate(c *check.C) {
 	// This test case is meant to test monitoring resolv.conf when it is
 	// This test case is meant to test monitoring resolv.conf when it is
 	// a regular file not a bind mounc. So we unmount resolv.conf and replace
 	// a regular file not a bind mounc. So we unmount resolv.conf and replace
 	// it with a file containing the original settings.
 	// it with a file containing the original settings.
-	cmd := exec.Command("umount", "/etc/resolv.conf")
-	if _, err = runCommand(cmd); err != nil {
+	mounted, err := mount.Mounted("/etc/resolv.conf")
+	if err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
+	if mounted {
+		cmd := exec.Command("umount", "/etc/resolv.conf")
+		if _, err = runCommand(cmd); err != nil {
+			c.Fatal(err)
+		}
+	}
 
 
 	//cleanup
 	//cleanup
 	defer func() {
 	defer func() {