瀏覽代碼

Windows: Fix TestRunLookupGoogleDNS for nanoserver

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 9 年之前
父節點
當前提交
80a63e8a21
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      integration-cli/docker_cli_run_test.go

+ 6 - 4
integration-cli/docker_cli_run_test.go

@@ -63,12 +63,14 @@ func (s *DockerSuite) TestRunLeakyFileDescriptors(c *check.C) {
 // this will fail when Internet access is unavailable
 func (s *DockerSuite) TestRunLookupGoogleDNS(c *check.C) {
 	testRequires(c, Network, NotArm)
-	image := DefaultImage
 	if daemonPlatform == "windows" {
-		// nslookup isn't present in Windows busybox. Is built-in.
-		image = WindowsBaseImage
+		// nslookup isn't present in Windows busybox. Is built-in. Further,
+		// nslookup isn't present in nanoserver. Hence just use PowerShell...
+		dockerCmd(c, "run", WindowsBaseImage, "powershell", "Resolve-DNSName", "google.com")
+	} else {
+		dockerCmd(c, "run", DefaultImage, "nslookup", "google.com")
 	}
-	dockerCmd(c, "run", image, "nslookup", "google.com")
+
 }
 
 // the exit code should be 0