Browse code

Verify the no-trunc option for the search operation.

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>

Yuan Sun authored on 2015/05/05 09:51:13
Showing 1 changed files
... ...
@@ -63,6 +63,16 @@ func (s *DockerSuite) TestSearchCmdOptions(c *check.C) {
63 63
 		c.Fatalf("failed to search on the central registry: %s, %v", outSearchCmd, err)
64 64
 	}
65 65
 
66
+	searchCmdNotrunc := exec.Command(dockerBinary, "search", "--no-trunc=true", "busybox")
67
+	outSearchCmdNotrunc, _, err := runCommandWithOutput(searchCmdNotrunc)
68
+	if err != nil {
69
+		c.Fatalf("failed to search on the central registry: %s, %v", outSearchCmdNotrunc, err)
70
+	}
71
+
72
+	if len(outSearchCmd) > len(outSearchCmdNotrunc) {
73
+		c.Fatalf("The no-trunc option can't take effect.")
74
+	}
75
+
66 76
 	searchCmdautomated := exec.Command(dockerBinary, "search", "--automated=true", "busybox")
67 77
 	outSearchCmdautomated, exitCode, err := runCommandWithOutput(searchCmdautomated) //The busybox is a busybox base image, not an AUTOMATED image.
68 78
 	if err != nil || exitCode != 0 {