Skip to content

Commit

Permalink
move HostID test utilities to host_id_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mwear committed Mar 8, 2023
1 parent a9bdee8 commit 8f6b557
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions sdk/resource/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ var (
SetOSDescriptionProvider = setOSDescriptionProvider
SetDefaultContainerProviders = setDefaultContainerProviders
SetContainerProviders = setContainerProviders
SetDefaultHostIDProvider = setDefaultHostIDProvider
SetHostIDProvider = setHostIDProvider
)

var (
Expand Down
8 changes: 0 additions & 8 deletions sdk/resource/host_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ var defaultHostIDProvider hostIDProvider = platformHostIDReader.read

var hostID = defaultHostIDProvider

func setDefaultHostIDProvider() {
setHostIDProvider(defaultHostIDProvider)
}

func setHostIDProvider(hostIDProvider hostIDProvider) {
hostID = hostIDProvider
}

type hostIDReader interface {
read() (string, error)
}
Expand Down
8 changes: 8 additions & 0 deletions sdk/resource/host_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ var (
}
)

func SetDefaultHostIDProvider() {
SetHostIDProvider(defaultHostIDProvider)
}

func SetHostIDProvider(hostIDProvider hostIDProvider) {
hostID = hostIDProvider
}

func TestHostIDReaderBSD(t *testing.T) {
tt := []struct {
name string
Expand Down

0 comments on commit 8f6b557

Please sign in to comment.