Skip to content
Snippets Groups Projects

Change the current gosdn plugin implementation from Go's internal plugin system to hashicorp's go-plugins

Merged Ghost User requested to merge mb/plugin-registry-hashicorp-go-plugin into develop
1 file
+ 15
11
Compare changes
  • Side-by-side
  • Inline
@@ -11,10 +11,11 @@ import (
@@ -11,10 +11,11 @@ import (
func TestAddPnd(t *testing.T) {
func TestAddPnd(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
 
pndStore := NewPndStore(pluginServiceMock)
pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pnd, _ := NewPND("testpnd", "test", pndID, nil, nil)
pnd, _ := NewPND("testpnd", "test", pndID, nil, nil, pluginServiceMock, nil)
err := pndStore.Add(pnd)
err := pndStore.Add(pnd)
@@ -26,11 +27,12 @@ func TestAddPnd(t *testing.T) {
@@ -26,11 +27,12 @@ func TestAddPnd(t *testing.T) {
func TestGetAllPnds(t *testing.T) {
func TestGetAllPnds(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
 
pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil)
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil, pluginServiceMock, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil, pluginServiceMock, nil)
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
@@ -62,11 +64,12 @@ func TestGetAllPnds(t *testing.T) {
@@ -62,11 +64,12 @@ func TestGetAllPnds(t *testing.T) {
func TestGetPnd(t *testing.T) {
func TestGetPnd(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
 
pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil)
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil, pluginServiceMock, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil, pluginServiceMock, nil)
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
@@ -96,11 +99,12 @@ func TestGetPnd(t *testing.T) {
@@ -96,11 +99,12 @@ func TestGetPnd(t *testing.T) {
func TestDeletePnd(t *testing.T) {
func TestDeletePnd(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
 
pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil)
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil, pluginServiceMock, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil, pluginServiceMock, nil)
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
Loading