refact(plugin): Move host loopback plugin into internal/plugin/loopback

This commit is contained in:
Louis Ruch authored and Timothy Messier committed 2023-05-31 12:18:12 +00:00
1 parent 4c801cca18
commit 351444f1bd
28 files changed
+3435 -177

No files matched your search

+5 -4
View File
@@ -12,6 +12,7 @@ import (
"github.com/hashicorp/boundary/internal/iam"
"github.com/hashicorp/boundary/internal/kms"
"github.com/hashicorp/boundary/internal/plugin/host"
"github.com/hashicorp/boundary/internal/plugin/loopback"
"github.com/hashicorp/boundary/internal/scheduler"
plgpb "github.com/hashicorp/boundary/sdk/pbs/plugin"
"github.com/stretchr/testify/assert"
@@ -52,7 +53,7 @@ func Test_TestSet(t *testing.T) {
assert.NotEmpty(plg.GetPublicId())
c := TestCatalog(t, conn, prj.GetPublicId(), plg.GetPublicId())
set := TestSet(t, conn, kmsCache, sched, c, map[string]plgpb.HostPluginServiceClient{plg.GetPublicId(): NewWrappingPluginClient(&TestPluginServer{})}, WithName("foo"), WithDescription("bar"))
set := TestSet(t, conn, kmsCache, sched, c, map[string]plgpb.HostPluginServiceClient{plg.GetPublicId(): loopback.NewWrappingPluginClient(&loopback.TestPluginServer{})}, WithName("foo"), WithDescription("bar"))
assert.NotEmpty(set.GetPublicId())
db.AssertPublicId(t, globals.PluginHostSetPrefix, set.GetPublicId())
assert.Equal("foo", set.GetName())
@@ -93,7 +94,7 @@ func Test_TestSetMembers(t *testing.T) {
assert.NotEmpty(plg.GetPublicId())
c := TestCatalog(t, conn, prj.GetPublicId(), plg.GetPublicId())
s := TestSet(t, conn, kmsCache, sched, c, map[string]plgpb.HostPluginServiceClient{plg.GetPublicId(): NewWrappingPluginClient(&TestPluginServer{})})
s := TestSet(t, conn, kmsCache, sched, c, map[string]plgpb.HostPluginServiceClient{plg.GetPublicId(): loopback.NewWrappingPluginClient(&loopback.TestPluginServer{})})
h := TestHost(t, conn, c.GetPublicId(), plg.GetPublicId())
members := TestSetMembers(t, conn, s.PublicId, []*Host{h})
@@ -115,8 +116,8 @@ func Test_TestRunSetSync(t *testing.T) {
plg := host.TestPlugin(t, conn, "test")
require.NotNil(plg)
assert.NotEmpty(plg.GetPublicId())
pluginServer := &TestPluginServer{}
plgm := map[string]plgpb.HostPluginServiceClient{plg.GetPublicId(): NewWrappingPluginClient(pluginServer)}
pluginServer := &loopback.TestPluginServer{}
plgm := map[string]plgpb.HostPluginServiceClient{plg.GetPublicId(): loopback.NewWrappingPluginClient(pluginServer)}
c := TestCatalog(t, conn, prj.GetPublicId(), plg.GetPublicId())
s1 := TestSet(t, conn, kmsCache, sched, c, plgm)