Skip to content
Snippets Groups Projects
Commit eeb79a7d authored by Malte Bauch's avatar Malte Bauch
Browse files

Update test cases for pndFilesystemStore

parent de669a68
No related branches found
No related tags found
1 merge request!401Change the current gosdn plugin implementation from Go's internal plugin system to hashicorp's go-plugins
Pipeline #131701 failed
......@@ -11,10 +11,11 @@ import (
func TestAddPnd(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
pndStore := NewPndStore(pluginServiceMock)
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)
......@@ -26,11 +27,12 @@ func TestAddPnd(t *testing.T) {
func TestGetAllPnds(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil)
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil, pluginServiceMock, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil, pluginServiceMock, nil)
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
......@@ -62,11 +64,12 @@ func TestGetAllPnds(t *testing.T) {
func TestGetPnd(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil)
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil, pluginServiceMock, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil, pluginServiceMock, nil)
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
......@@ -96,11 +99,12 @@ func TestGetPnd(t *testing.T) {
func TestDeletePnd(t *testing.T) {
defer ensureStoreFileForTestsIsRemoved(store.PndFilename)
pndStore := NewPndStore()
pluginServiceMock := NewPluginServiceMock()
pndStore := NewPndStore(pluginServiceMock)
pndID1, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
pndID2, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bab")
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil)
pnd1, _ := NewPND("testpnd", "test", pndID1, nil, nil, pluginServiceMock, nil)
pnd2, _ := NewPND("testpnd2", "test", pndID2, nil, nil, pluginServiceMock, nil)
inputPnds := [2]networkdomain.NetworkDomain{pnd1, pnd2}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment