aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/plugins/network/plugin_test.go
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2019-07-31 16:35:52 +0200
committerKonrad Bańka <k.banka@samsung.com>2019-08-01 08:38:33 +0200
commitb668aa42997b74ebdcf609bc0a55906d7eb59ff8 (patch)
tree7eb68feb75cbfec83facfa0605c98df101b25de7 /src/k8splugin/plugins/network/plugin_test.go
parent09dffa6d151b046a87edcb91a46449cabc66532c (diff)
Correct cni retrieval process from resource name
Due to some minor issues, network resource name wasn't being parsed properly, thus failing removing ovn networks when deleting VNF instance. Issue-ID: MULTICLOUD-708 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I14d8eb6b82d0ee74b266272fd8a842b45e6c2b40
Diffstat (limited to 'src/k8splugin/plugins/network/plugin_test.go')
-rw-r--r--src/k8splugin/plugins/network/plugin_test.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/k8splugin/plugins/network/plugin_test.go b/src/k8splugin/plugins/network/plugin_test.go
index 586bccb8..33cae1c7 100644
--- a/src/k8splugin/plugins/network/plugin_test.go
+++ b/src/k8splugin/plugins/network/plugin_test.go
@@ -130,18 +130,23 @@ func TestDeleteNetwork(t *testing.T) {
}{
{
label: "Fail to load non-existing plugin",
- input: "test",
- expectedError: "No plugin for resource",
+ input: "non-existing-cni_test",
+ expectedError: "No plugin for resource non-existing-cni",
},
{
- label: "Fail to delete a network",
+ label: "Fail to extract cni from network name",
input: "1_ovn4nfvk8s_test",
+ expectedError: "Error extracting CNI type from resource: Couldn't split resource '1_ovn4nfvk8s_test' into CNI type and Network name",
+ },
+ {
+ label: "Fail to delete a network",
+ input: "ovn4nfvk8s_test",
mockError: "Internal error",
expectedError: "Error during the deletion for ovn4nfvk8s plugin: Internal error",
},
{
label: "Successfully delete a ovn4nfv network",
- input: "1_ovn4nfvk8s_test",
+ input: "ovn4nfvk8s_test",
},
}