From 6e8aa4e588d11735c70059a478fc0c7857cb382c Mon Sep 17 00:00:00 2001 From: Yuan Sun Date: Tue, 5 May 2015 08:51:13 +0800 Subject: [PATCH] Verify the no-trunc option for the search operation. Signed-off-by: Yuan Sun --- integration-cli/docker_cli_search_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration-cli/docker_cli_search_test.go b/integration-cli/docker_cli_search_test.go index c5ecdd03b9..da298a1e0c 100644 --- a/integration-cli/docker_cli_search_test.go +++ b/integration-cli/docker_cli_search_test.go @@ -63,6 +63,16 @@ func (s *DockerSuite) TestSearchCmdOptions(c *check.C) { c.Fatalf("failed to search on the central registry: %s, %v", outSearchCmd, err) } + searchCmdNotrunc := exec.Command(dockerBinary, "search", "--no-trunc=true", "busybox") + outSearchCmdNotrunc, _, err := runCommandWithOutput(searchCmdNotrunc) + if err != nil { + c.Fatalf("failed to search on the central registry: %s, %v", outSearchCmdNotrunc, err) + } + + if len(outSearchCmd) > len(outSearchCmdNotrunc) { + c.Fatalf("The no-trunc option can't take effect.") + } + searchCmdautomated := exec.Command(dockerBinary, "search", "--automated=true", "busybox") outSearchCmdautomated, exitCode, err := runCommandWithOutput(searchCmdautomated) //The busybox is a busybox base image, not an AUTOMATED image. if err != nil || exitCode != 0 {