summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/instance_test.go
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-23 13:50:50 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-23 19:28:22 -0700
commit5207bd099a84832a5d7c3333bf540fa8481ce78a (patch)
treeb6f3aaea641ceb3406dc1c14c7d642098558129f /src/k8splugin/internal/app/instance_test.go
parent525023e1d288bbf9cf59584c5b5dd37d83be7a4b (diff)
Update broker responses to match spec and SO
The broker responses need to match the spec and what SO expects as responses. CREATE_COMPLETE instead of CREATED in both POST and GET DELETE now returns a response body GET by name is now supported Name is an alias for vf_module_id which is expected to be provided as an attribute in sdnc_directives in the original POST request Issue-ID: MULTICLOUD-645 Change-Id: Ifeca755a07298d0a858cbe9e80f9ce654d6d21b8 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/internal/app/instance_test.go')
-rw-r--r--src/k8splugin/internal/app/instance_test.go22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/k8splugin/internal/app/instance_test.go b/src/k8splugin/internal/app/instance_test.go
index 87824d74..ea377482 100644
--- a/src/k8splugin/internal/app/instance_test.go
+++ b/src/k8splugin/internal/app/instance_test.go
@@ -339,7 +339,10 @@ func TestInstanceFind(t *testing.T) {
"profile-name":"profile1",
"rb-name":"test-rbdef",
"rb-version":"v1",
- "cloud-region":"region1"
+ "cloud-region":"region1",
+ "labels":{
+ "vf_module_id": "test-vf-module-id"
+ }
},
"namespace":"testnamespace",
"resources": [
@@ -439,6 +442,9 @@ func TestInstanceFind(t *testing.T) {
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
+ Labels: map[string]string{
+ "vf_module_id": "test-vf-module-id",
+ },
},
Namespace: "testnamespace",
Resources: []helm.KubernetesResource{
@@ -513,7 +519,7 @@ func TestInstanceFind(t *testing.T) {
}
ic := NewInstanceClient()
name := "test-rbdef"
- data, err := ic.Find(name, "", "")
+ data, err := ic.Find(name, "", "", nil)
if err != nil {
t.Fatalf("TestInstanceFind returned an error (%s)", err)
}
@@ -548,6 +554,9 @@ func TestInstanceFind(t *testing.T) {
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
+ Labels: map[string]string{
+ "vf_module_id": "test-vf-module-id",
+ },
},
Namespace: "testnamespace",
@@ -598,7 +607,7 @@ func TestInstanceFind(t *testing.T) {
}
ic := NewInstanceClient()
name := "test-rbdef"
- data, err := ic.Find(name, "v1", "")
+ data, err := ic.Find(name, "v1", "", nil)
if err != nil {
t.Fatalf("TestInstanceFind returned an error (%s)", err)
}
@@ -633,6 +642,9 @@ func TestInstanceFind(t *testing.T) {
RBVersion: "v1",
ProfileName: "profile1",
CloudRegion: "region1",
+ Labels: map[string]string{
+ "vf_module_id": "test-vf-module-id",
+ },
},
Namespace: "testnamespace",
@@ -656,7 +668,7 @@ func TestInstanceFind(t *testing.T) {
}
ic := NewInstanceClient()
name := "test-rbdef"
- data, err := ic.Find(name, "v1", "profile1")
+ data, err := ic.Find(name, "v1", "profile1", nil)
if err != nil {
t.Fatalf("TestInstanceFind returned an error (%s)", err)
}
@@ -715,7 +727,7 @@ func TestInstanceFind(t *testing.T) {
ic := NewInstanceClient()
name := "non-existing"
- resp, _ := ic.Find(name, "", "")
+ resp, _ := ic.Find(name, "", "", nil)
if len(resp) != 0 {
t.Fatalf("Expected 0 responses, but got %d", len(resp))
}