Fix daemon command proxy.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin
2016-08-26 12:19:02 -04:00
parent 9af25060cd
commit ad96b991e9
3 changed files with 41 additions and 12 deletions

30
daemon_unit_test.go Normal file
View File

@ -0,0 +1,30 @@
// +build daemon
package main
import (
"testing"
"github.com/docker/docker/pkg/testutil/assert"
"github.com/spf13/cobra"
)
func stubRun(cmd *cobra.Command, args []string) error {
return nil
}
func TestDaemonCommandHelp(t *testing.T) {
cmd := newDaemonCommand()
cmd.RunE = stubRun
cmd.SetArgs([]string{"--help"})
err := cmd.Execute()
assert.NilError(t, err)
}
func TestDaemonCommand(t *testing.T) {
cmd := newDaemonCommand()
cmd.RunE = stubRun
cmd.SetArgs([]string{"--containerd", "/foo"})
err := cmd.Execute()
assert.NilError(t, err)
}