Make SessionSetup faster and support for command execution

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-09-11 18:09:27 -03:00
parent 86044788b9
commit fe299fed90
9 changed files with 162 additions and 124 deletions

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/stretchr/testify/mock"
)
@@ -13,6 +14,11 @@ type Mock struct {
mock.Mock
}
func (m *Mock) GetClient() *client.Client {
args := m.Called()
return args.Get(0).(*client.Client)
}
func (m *Mock) CreateNetwork(id string, opts types.NetworkCreate) error {
args := m.Called(id, opts)
return args.Error(0)
@@ -96,8 +102,8 @@ func (m *Mock) Exec(instanceName string, command []string) (int, error) {
args := m.Called(instanceName, command)
return args.Int(0), args.Error(1)
}
func (m *Mock) SwarmInit() (*SwarmTokens, error) {
args := m.Called()
func (m *Mock) SwarmInit(advertiseAddr string) (*SwarmTokens, error) {
args := m.Called(advertiseAddr)
return args.Get(0).(*SwarmTokens), args.Error(1)
}
func (m *Mock) SwarmJoin(addr, token string) error {