From 949e5464c4aa0de9609f923f98b6b02c7db0361c Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Tue, 19 Jan 2021 20:56:16 +0530 Subject: [PATCH] Fix linode tests Signed-off-by: Noel Georgi --- provision/go.mod | 1 + provision/go.sum | 3 +++ provision/linode_test.go | 9 +++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/provision/go.mod b/provision/go.mod index 4fc27ba..6d21175 100644 --- a/provision/go.mod +++ b/provision/go.mod @@ -18,6 +18,7 @@ require ( github.com/google/uuid v1.1.1 github.com/hashicorp/go-retryablehttp v0.6.6 github.com/hetznercloud/hcloud-go v1.18.2 + github.com/inlets/inletsctl v0.0.0-20210119121609-ba39a5f3caa6 github.com/linode/linodego v0.19.0 github.com/morikuni/aec v1.0.0 github.com/packethost/packngo v0.5.1 diff --git a/provision/go.sum b/provision/go.sum index c658e03..2cbc11e 100644 --- a/provision/go.sum +++ b/provision/go.sum @@ -152,6 +152,9 @@ github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inlets/cloud-provision/provision v0.0.0-20210119113012-d52e792ff883/go.mod h1:rPw1T222Ik54glKeMngP7fhALekMf6Qhh7Z+/W1h/pc= +github.com/inlets/inletsctl v0.0.0-20210119121609-ba39a5f3caa6 h1:PVgjbMW04bs0U88oyU/kR+50PJf7sxX+Z2mrm3ht95o= +github.com/inlets/inletsctl v0.0.0-20210119121609-ba39a5f3caa6/go.mod h1:+/ZvJypltbv5jbWVOdPGaqagmENWNWuzlTiaI+mf3sQ= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= diff --git a/provision/linode_test.go b/provision/linode_test.go index 1f0653a..0d13e6d 100644 --- a/provision/linode_test.go +++ b/provision/linode_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/golang/mock/gomock" + "github.com/inlets/inletsctl/mock" "github.com/linode/linodego" ) @@ -13,7 +14,7 @@ import ( func Test_Linode_Provision(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() - mockClient := newMockLinodeInterface(mockCtrl) + mockClient := mock.NewMockLinodeInterface(mockCtrl) provisioner := &LinodeProvisioner{ client: mockClient, } @@ -70,7 +71,7 @@ func Test_Linode_Provision(t *testing.T) { func Test_Linode_StatusBooting(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() - mockClient := newMockLinodeInterface(mockCtrl) + mockClient := mock.NewMockLinodeInterface(mockCtrl) provisioner := &LinodeProvisioner{ client: mockClient, } @@ -96,7 +97,7 @@ func Test_Linode_StatusBooting(t *testing.T) { func Test_Linode_StatusActive(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() - mockClient := newMockLinodeInterface(mockCtrl) + mockClient := mock.NewMockLinodeInterface(mockCtrl) provisioner := &LinodeProvisioner{ client: mockClient, stackscriptID: 10, @@ -126,7 +127,7 @@ func Test_Linode_StatusActive(t *testing.T) { func Test_Linode_Delete(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() - mockClient := newMockLinodeInterface(mockCtrl) + mockClient := mock.NewMockLinodeInterface(mockCtrl) provisioner := &LinodeProvisioner{ client: mockClient, }