[19.03 backport] Remove TestSearchCmdOptions test
| ... | ... |
@@ -44,54 +44,6 @@ func (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *check.C) {
|
| 44 | 44 |
assert.Assert(c, strings.Contains(out, "invalid syntax"), "couldn't find the invalid value warning") |
| 45 | 45 |
} |
| 46 | 46 |
|
| 47 |
-func (s *DockerSuite) TestSearchCmdOptions(c *check.C) {
|
|
| 48 |
- testRequires(c, Network, DaemonIsLinux) |
|
| 49 |
- |
|
| 50 |
- out, _ := dockerCmd(c, "search", "--help") |
|
| 51 |
- assert.Assert(c, strings.Contains(out, "Usage:\tdocker search [OPTIONS] TERM")) |
|
| 52 |
- |
|
| 53 |
- outSearchCmd, _ := dockerCmd(c, "search", "busybox") |
|
| 54 |
- outSearchCmdNotrunc, _ := dockerCmd(c, "search", "--no-trunc=true", "busybox") |
|
| 55 |
- |
|
| 56 |
- assert.Assert(c, len(outSearchCmd) <= len(outSearchCmdNotrunc), "The no-trunc option can't take effect.") |
|
| 57 |
- |
|
| 58 |
- outSearchCmdautomated, _ := dockerCmd(c, "search", "--filter", "is-automated=true", "busybox") //The busybox is a busybox base image, not an AUTOMATED image. |
|
| 59 |
- outSearchCmdautomatedSlice := strings.Split(outSearchCmdautomated, "\n") |
|
| 60 |
- for i := range outSearchCmdautomatedSlice {
|
|
| 61 |
- assert.Assert(c, !strings.HasPrefix(outSearchCmdautomatedSlice[i], "busybox "), "The busybox is not an AUTOMATED image: %s", outSearchCmdautomated) |
|
| 62 |
- } |
|
| 63 |
- |
|
| 64 |
- outSearchCmdNotOfficial, _ := dockerCmd(c, "search", "--filter", "is-official=false", "busybox") //The busybox is a busybox base image, official image. |
|
| 65 |
- outSearchCmdNotOfficialSlice := strings.Split(outSearchCmdNotOfficial, "\n") |
|
| 66 |
- for i := range outSearchCmdNotOfficialSlice {
|
|
| 67 |
- assert.Assert(c, !strings.HasPrefix(outSearchCmdNotOfficialSlice[i], "busybox "), "The busybox is not an OFFICIAL image: %s", outSearchCmdNotOfficial) |
|
| 68 |
- } |
|
| 69 |
- |
|
| 70 |
- outSearchCmdOfficial, _ := dockerCmd(c, "search", "--filter", "is-official=true", "busybox") //The busybox is a busybox base image, official image. |
|
| 71 |
- outSearchCmdOfficialSlice := strings.Split(outSearchCmdOfficial, "\n") |
|
| 72 |
- assert.Equal(c, len(outSearchCmdOfficialSlice), 3) // 1 header, 1 line, 1 carriage return |
|
| 73 |
- assert.Assert(c, strings.HasPrefix(outSearchCmdOfficialSlice[1], "busybox "), "The busybox is an OFFICIAL image: %s", outSearchCmdOfficial) |
|
| 74 |
- |
|
| 75 |
- outSearchCmdStars, _ := dockerCmd(c, "search", "--filter", "stars=2", "busybox") |
|
| 76 |
- assert.Assert(c, strings.Count(outSearchCmdStars, "[OK]") <= strings.Count(outSearchCmd, "[OK]"), "The quantity of images with stars should be less than that of all images: %s", outSearchCmdStars) |
|
| 77 |
- |
|
| 78 |
- dockerCmd(c, "search", "--filter", "is-automated=true", "--filter", "stars=2", "--no-trunc=true", "busybox") |
|
| 79 |
- |
|
| 80 |
- // --automated deprecated since Docker 1.13 |
|
| 81 |
- outSearchCmdautomated1, _ := dockerCmd(c, "search", "--automated=true", "busybox") //The busybox is a busybox base image, not an AUTOMATED image. |
|
| 82 |
- outSearchCmdautomatedSlice1 := strings.Split(outSearchCmdautomated1, "\n") |
|
| 83 |
- for i := range outSearchCmdautomatedSlice1 {
|
|
| 84 |
- assert.Assert(c, !strings.HasPrefix(outSearchCmdautomatedSlice1[i], "busybox "), "The busybox is not an AUTOMATED image: %s", outSearchCmdautomated) |
|
| 85 |
- } |
|
| 86 |
- |
|
| 87 |
- // -s --stars deprecated since Docker 1.13 |
|
| 88 |
- outSearchCmdStars1, _ := dockerCmd(c, "search", "--stars=2", "busybox") |
|
| 89 |
- assert.Assert(c, strings.Count(outSearchCmdStars1, "[OK]") <= strings.Count(outSearchCmd, "[OK]"), "The quantity of images with stars should be less than that of all images: %s", outSearchCmdStars1) |
|
| 90 |
- |
|
| 91 |
- // -s --stars deprecated since Docker 1.13 |
|
| 92 |
- dockerCmd(c, "search", "--stars=2", "--automated=true", "--no-trunc=true", "busybox") |
|
| 93 |
-} |
|
| 94 |
- |
|
| 95 | 47 |
// search for repos which start with "ubuntu-" on the central registry |
| 96 | 48 |
func (s *DockerSuite) TestSearchOnCentralRegistryWithDash(c *check.C) {
|
| 97 | 49 |
testRequires(c, Network, DaemonIsLinux) |