"docker network" missing from docker --help
Fixed issues related to network subcommand tests - "network" in exempted list of short help check - Condition for exact test modified to meet experimental commands - Sorting of commands done in flags_experimental Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
This commit is contained in:
parent
2434bd8e63
commit
44da5c3de2
3 changed files with 22 additions and 8 deletions
|
@ -3,8 +3,6 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
nwclient "github.com/docker/libnetwork/client"
|
||||
)
|
||||
|
||||
|
@ -12,5 +10,5 @@ import (
|
|||
func (cli *DockerCli) CmdNetwork(args ...string) error {
|
||||
nCli := nwclient.NewNetworkCli(cli.out, cli.err, nwclient.CallFunc(cli.callWrapper))
|
||||
args = append([]string{"network"}, args...)
|
||||
return nCli.Cmd(os.Args[0], args...)
|
||||
return nCli.Cmd("docker", args...)
|
||||
}
|
||||
|
|
12
docker/flags_experimental.go
Normal file
12
docker/flags_experimental.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
// +build experimental
|
||||
|
||||
package main
|
||||
|
||||
import "sort"
|
||||
|
||||
func init() {
|
||||
dockerCommands = append(dockerCommands, command{"network", "Network management"})
|
||||
|
||||
//Sorting logic required here to pass Command Sort Test.
|
||||
sort.Sort(byName(dockerCommands))
|
||||
}
|
|
@ -183,9 +183,10 @@ func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
|
|||
|
||||
// These commands will never print a short-usage so don't test
|
||||
noShortUsage := map[string]string{
|
||||
"images": "",
|
||||
"login": "",
|
||||
"logout": "",
|
||||
"images": "",
|
||||
"login": "",
|
||||
"logout": "",
|
||||
"network": "",
|
||||
}
|
||||
|
||||
if _, ok := noShortUsage[cmd]; !ok {
|
||||
|
@ -238,11 +239,14 @@ func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
|
|||
|
||||
}
|
||||
|
||||
expected := 40
|
||||
// Number of commands for standard release and experimental release
|
||||
standard := 40
|
||||
experimental := 1
|
||||
expected := standard + experimental
|
||||
if isLocalDaemon {
|
||||
expected++ // for the daemon command
|
||||
}
|
||||
if len(cmds) != expected {
|
||||
if len(cmds) > expected {
|
||||
c.Fatalf("Wrong # of cmds(%d), it should be: %d\nThe list:\n%q",
|
||||
len(cmds), expected, cmds)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue