Skip to content

Commit 13c62c6

Browse files
committed
More acceptance tests and a few minor bug fixes
1 parent 4529c62 commit 13c62c6

File tree

46 files changed

+582
-2370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+582
-2370
lines changed

client/bare_metal_client.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ type BareMetalClient interface {
120120
ListCompartments(opts *baremetal.ListOptions) (resources *baremetal.ListCompartments, e error)
121121
ListConsoleHistories(compartmentID string, opts *baremetal.ListConsoleHistoriesOptions) (icHistories *baremetal.ListConsoleHistories, e error)
122122
ListCpes(compartmentID string, opts *baremetal.ListOptions) (cpes *baremetal.ListCpes, e error)
123-
ListDBHomes(compartmentID, dbSystemID string, limit uint64, opts *baremetal.PageListOptions) (res *baremetal.ListDBHomes, e error)
124-
ListDBNodes(compartmentID, dbSystemID string, limit uint64, opts *baremetal.PageListOptions) (resources *baremetal.ListDBNodes, e error)
125-
ListDBSystemShapes(availabilityDomain, compartmentID string, limit uint64, opts *baremetal.PageListOptions) (resources *baremetal.ListDBSystemShapes, e error)
126-
ListDBSystems(compartmentID string, limit uint64, opts *baremetal.PageListOptions) (res *baremetal.ListDBSystems, e error)
127-
ListDBVersions(compartmentID string, limit uint64, opts *baremetal.PageListOptions) (resources *baremetal.ListDBVersions, e error)
123+
ListDBHomes(compartmentID, dbSystemID string, opts *baremetal.ListOptions) (res *baremetal.ListDBHomes, e error)
124+
ListDBNodes(compartmentID, dbSystemID string, opts *baremetal.ListOptions) (resources *baremetal.ListDBNodes, e error)
125+
ListDBSystemShapes(availabilityDomain, compartmentID string, opts *baremetal.ListOptions) (resources *baremetal.ListDBSystemShapes, e error)
126+
ListDBSystems(compartmentID string, opts *baremetal.ListOptions) (res *baremetal.ListDBSystems, e error)
127+
ListDBVersions(compartmentID string, opts *baremetal.ListOptions) (resources *baremetal.ListDBVersions, e error)
128128
ListDHCPOptions(compartmentID, vcnID string, opts *baremetal.ListOptions) (res *baremetal.ListDHCPOptions, e error)
129129
ListDatabases(compartmentID, dbHomeID string, limit uint64, opts *baremetal.PageListOptions) (resources *baremetal.ListDatabases, e error)
130130
ListDrgAttachments(compartmentID string, opts *baremetal.ListDrgAttachmentsOptions) (res *baremetal.ListDrgAttachments, e error)

client/mocks/bare_metal_client.go

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,114 +2215,114 @@ func (_m *BareMetalClient) ListCpes(compartmentID string, opts *baremetal.ListOp
22152215
return r0, r1
22162216
}
22172217

2218-
// ListDBHomes provides a mock function with given fields: compartmentID, dbSystemID, limit, opts
2219-
func (_m *BareMetalClient) ListDBHomes(compartmentID string, dbSystemID string, limit uint64, opts *baremetal.PageListOptions) (*baremetal.ListDBHomes, error) {
2220-
ret := _m.Called(compartmentID, dbSystemID, limit, opts)
2218+
// ListDBHomes provides a mock function with given fields: compartmentID, dbSystemID, opts
2219+
func (_m *BareMetalClient) ListDBHomes(compartmentID string, dbSystemID string, opts *baremetal.ListOptions) (*baremetal.ListDBHomes, error) {
2220+
ret := _m.Called(compartmentID, dbSystemID, opts)
22212221

22222222
var r0 *baremetal.ListDBHomes
2223-
if rf, ok := ret.Get(0).(func(string, string, uint64, *baremetal.PageListOptions) *baremetal.ListDBHomes); ok {
2224-
r0 = rf(compartmentID, dbSystemID, limit, opts)
2223+
if rf, ok := ret.Get(0).(func(string, string, *baremetal.ListOptions) *baremetal.ListDBHomes); ok {
2224+
r0 = rf(compartmentID, dbSystemID, opts)
22252225
} else {
22262226
if ret.Get(0) != nil {
22272227
r0 = ret.Get(0).(*baremetal.ListDBHomes)
22282228
}
22292229
}
22302230

22312231
var r1 error
2232-
if rf, ok := ret.Get(1).(func(string, string, uint64, *baremetal.PageListOptions) error); ok {
2233-
r1 = rf(compartmentID, dbSystemID, limit, opts)
2232+
if rf, ok := ret.Get(1).(func(string, string, *baremetal.ListOptions) error); ok {
2233+
r1 = rf(compartmentID, dbSystemID, opts)
22342234
} else {
22352235
r1 = ret.Error(1)
22362236
}
22372237

22382238
return r0, r1
22392239
}
22402240

2241-
// ListDBNodes provides a mock function with given fields: compartmentID, dbSystemID, limit, opts
2242-
func (_m *BareMetalClient) ListDBNodes(compartmentID string, dbSystemID string, limit uint64, opts *baremetal.PageListOptions) (*baremetal.ListDBNodes, error) {
2243-
ret := _m.Called(compartmentID, dbSystemID, limit, opts)
2241+
// ListDBNodes provides a mock function with given fields: compartmentID, dbSystemID, opts
2242+
func (_m *BareMetalClient) ListDBNodes(compartmentID string, dbSystemID string, opts *baremetal.ListOptions) (*baremetal.ListDBNodes, error) {
2243+
ret := _m.Called(compartmentID, dbSystemID, opts)
22442244

22452245
var r0 *baremetal.ListDBNodes
2246-
if rf, ok := ret.Get(0).(func(string, string, uint64, *baremetal.PageListOptions) *baremetal.ListDBNodes); ok {
2247-
r0 = rf(compartmentID, dbSystemID, limit, opts)
2246+
if rf, ok := ret.Get(0).(func(string, string, *baremetal.ListOptions) *baremetal.ListDBNodes); ok {
2247+
r0 = rf(compartmentID, dbSystemID, opts)
22482248
} else {
22492249
if ret.Get(0) != nil {
22502250
r0 = ret.Get(0).(*baremetal.ListDBNodes)
22512251
}
22522252
}
22532253

22542254
var r1 error
2255-
if rf, ok := ret.Get(1).(func(string, string, uint64, *baremetal.PageListOptions) error); ok {
2256-
r1 = rf(compartmentID, dbSystemID, limit, opts)
2255+
if rf, ok := ret.Get(1).(func(string, string, *baremetal.ListOptions) error); ok {
2256+
r1 = rf(compartmentID, dbSystemID, opts)
22572257
} else {
22582258
r1 = ret.Error(1)
22592259
}
22602260

22612261
return r0, r1
22622262
}
22632263

2264-
// ListDBSystemShapes provides a mock function with given fields: availabilityDomain, compartmentID, limit, opts
2265-
func (_m *BareMetalClient) ListDBSystemShapes(availabilityDomain string, compartmentID string, limit uint64, opts *baremetal.PageListOptions) (*baremetal.ListDBSystemShapes, error) {
2266-
ret := _m.Called(availabilityDomain, compartmentID, limit, opts)
2264+
// ListDBSystemShapes provides a mock function with given fields: availabilityDomain, compartmentID, opts
2265+
func (_m *BareMetalClient) ListDBSystemShapes(availabilityDomain string, compartmentID string, opts *baremetal.ListOptions) (*baremetal.ListDBSystemShapes, error) {
2266+
ret := _m.Called(availabilityDomain, compartmentID, opts)
22672267

22682268
var r0 *baremetal.ListDBSystemShapes
2269-
if rf, ok := ret.Get(0).(func(string, string, uint64, *baremetal.PageListOptions) *baremetal.ListDBSystemShapes); ok {
2270-
r0 = rf(availabilityDomain, compartmentID, limit, opts)
2269+
if rf, ok := ret.Get(0).(func(string, string, *baremetal.ListOptions) *baremetal.ListDBSystemShapes); ok {
2270+
r0 = rf(availabilityDomain, compartmentID, opts)
22712271
} else {
22722272
if ret.Get(0) != nil {
22732273
r0 = ret.Get(0).(*baremetal.ListDBSystemShapes)
22742274
}
22752275
}
22762276

22772277
var r1 error
2278-
if rf, ok := ret.Get(1).(func(string, string, uint64, *baremetal.PageListOptions) error); ok {
2279-
r1 = rf(availabilityDomain, compartmentID, limit, opts)
2278+
if rf, ok := ret.Get(1).(func(string, string, *baremetal.ListOptions) error); ok {
2279+
r1 = rf(availabilityDomain, compartmentID, opts)
22802280
} else {
22812281
r1 = ret.Error(1)
22822282
}
22832283

22842284
return r0, r1
22852285
}
22862286

2287-
// ListDBSystems provides a mock function with given fields: compartmentID, limit, opts
2288-
func (_m *BareMetalClient) ListDBSystems(compartmentID string, limit uint64, opts *baremetal.PageListOptions) (*baremetal.ListDBSystems, error) {
2289-
ret := _m.Called(compartmentID, limit, opts)
2287+
// ListDBSystems provides a mock function with given fields: compartmentID, opts
2288+
func (_m *BareMetalClient) ListDBSystems(compartmentID string, opts *baremetal.ListOptions) (*baremetal.ListDBSystems, error) {
2289+
ret := _m.Called(compartmentID, opts)
22902290

22912291
var r0 *baremetal.ListDBSystems
2292-
if rf, ok := ret.Get(0).(func(string, uint64, *baremetal.PageListOptions) *baremetal.ListDBSystems); ok {
2293-
r0 = rf(compartmentID, limit, opts)
2292+
if rf, ok := ret.Get(0).(func(string, *baremetal.ListOptions) *baremetal.ListDBSystems); ok {
2293+
r0 = rf(compartmentID, opts)
22942294
} else {
22952295
if ret.Get(0) != nil {
22962296
r0 = ret.Get(0).(*baremetal.ListDBSystems)
22972297
}
22982298
}
22992299

23002300
var r1 error
2301-
if rf, ok := ret.Get(1).(func(string, uint64, *baremetal.PageListOptions) error); ok {
2302-
r1 = rf(compartmentID, limit, opts)
2301+
if rf, ok := ret.Get(1).(func(string, *baremetal.ListOptions) error); ok {
2302+
r1 = rf(compartmentID, opts)
23032303
} else {
23042304
r1 = ret.Error(1)
23052305
}
23062306

23072307
return r0, r1
23082308
}
23092309

2310-
// ListDBVersions provides a mock function with given fields: compartmentID, limit, opts
2311-
func (_m *BareMetalClient) ListDBVersions(compartmentID string, limit uint64, opts *baremetal.PageListOptions) (*baremetal.ListDBVersions, error) {
2312-
ret := _m.Called(compartmentID, limit, opts)
2310+
// ListDBVersions provides a mock function with given fields: compartmentID, opts
2311+
func (_m *BareMetalClient) ListDBVersions(compartmentID string, opts *baremetal.ListOptions) (*baremetal.ListDBVersions, error) {
2312+
ret := _m.Called(compartmentID, opts)
23132313

23142314
var r0 *baremetal.ListDBVersions
2315-
if rf, ok := ret.Get(0).(func(string, uint64, *baremetal.PageListOptions) *baremetal.ListDBVersions); ok {
2316-
r0 = rf(compartmentID, limit, opts)
2315+
if rf, ok := ret.Get(0).(func(string, *baremetal.ListOptions) *baremetal.ListDBVersions); ok {
2316+
r0 = rf(compartmentID, opts)
23172317
} else {
23182318
if ret.Get(0) != nil {
23192319
r0 = ret.Get(0).(*baremetal.ListDBVersions)
23202320
}
23212321
}
23222322

23232323
var r1 error
2324-
if rf, ok := ret.Get(1).(func(string, uint64, *baremetal.PageListOptions) error); ok {
2325-
r1 = rf(compartmentID, limit, opts)
2324+
if rf, ok := ret.Get(1).(func(string, *baremetal.ListOptions) error); ok {
2325+
r1 = rf(compartmentID, opts)
23262326
} else {
23272327
r1 = ret.Error(1)
23282328
}

crud/helpers.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package crud
44

55
import (
66
"log"
7-
"os"
87
"reflect"
98
"strings"
109
"time"
@@ -95,6 +94,10 @@ func CreateResource(d *schema.ResourceData, sync ResourceCreator) (e error) {
9594
d.SetId(sync.ID())
9695
sync.SetData()
9796

97+
if ew, waitOK := sync.(ExtraWaitPostCreateDelete); waitOK {
98+
time.Sleep(ew.ExtraWaitPostCreateDelete())
99+
}
100+
98101
return
99102
}
100103

@@ -133,10 +136,8 @@ func DeleteResource(d *schema.ResourceData, sync ResourceDeleter) (e error) {
133136

134137
}
135138

136-
if ew, waitOK := sync.(ExtraWaitPostDelete); waitOK {
137-
if os.Getenv("TF_ORACLE_ENV") != "test" {
138-
time.Sleep(ew.ExtraWaitPostDelete())
139-
}
139+
if ew, waitOK := sync.(ExtraWaitPostCreateDelete); waitOK {
140+
time.Sleep(ew.ExtraWaitPostCreateDelete())
140141
}
141142

142143
if e == nil {

crud/interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ type ResourceDeleter interface {
6767
// of that fact. This facility allows us to add an artificial delay for
6868
// resources that need a little time to let the oracle API backend catch
6969
// up with reality.
70-
type ExtraWaitPostDelete interface {
71-
ExtraWaitPostDelete() time.Duration
70+
type ExtraWaitPostCreateDelete interface {
71+
ExtraWaitPostCreateDelete() time.Duration
7272
}
7373

7474
type StatefulResource interface {

0 commit comments

Comments
 (0)