summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/brokerhandler_test.go
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2020-01-07 15:33:04 +0100
committerKonrad Bańka <k.banka@samsung.com>2020-01-07 15:33:04 +0100
commit4f411bacefec35c9a51e078175668aa97a398477 (patch)
tree84a3110745d0ab5d5f5455a1d32b9af3917cbcf9 /src/k8splugin/api/brokerhandler_test.go
parent2a35410560f1c22ed12cd137cbf843e36f74740e (diff)
Instantiate infra_workload based on vf-module-*-ids
Deprecate k8s-rb-definition-* parameters from sdnc_directives in favor of vf-module-*-id that are used by newer artifact broker. Issue-ID: MULTICLOUD-836 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I26ae16bd53ced56ae11523584f900a102f6e0bb9
Diffstat (limited to 'src/k8splugin/api/brokerhandler_test.go')
-rw-r--r--src/k8splugin/api/brokerhandler_test.go49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/k8splugin/api/brokerhandler_test.go b/src/k8splugin/api/brokerhandler_test.go
index 00ca3b7b..83ff588b 100644
--- a/src/k8splugin/api/brokerhandler_test.go
+++ b/src/k8splugin/api/brokerhandler_test.go
@@ -48,18 +48,19 @@ func TestBrokerCreateHandler(t *testing.T) {
expectedCode: http.StatusUnprocessableEntity,
},
{
- label: "Missing parameter failure",
+ label: "Missing vf-module-*-id parameter",
input: bytes.NewBuffer([]byte(`{
"vf-module-model-customization-id": "84sdfkio938",
- "user_directives": {
+ "vf-module-model-invariant-id": "123456qwerty",
+ "sdnc_directives": {
"attributes": [
{
- "attribute_name": "k8s-rb-definition-name",
- "attribute_value": "test-rbdef"
+ "attribute_name": "vf_module_name",
+ "attribute_value": "test-vf-module-name"
},
{
- "attribute_name": "k8s-rb-definition-version",
- "attribute_value": "v1"
+ "attribute_name": "k8s-rb-profile-name",
+ "attribute_value": "profile1"
}
]
}
@@ -67,9 +68,11 @@ func TestBrokerCreateHandler(t *testing.T) {
expectedCode: http.StatusBadRequest,
},
{
- label: "Deprecated parameters passed (user_directives)",
+ label: "Missing parameter from sdnc_directives",
input: bytes.NewBuffer([]byte(`{
- "vf-module-model-customization-id": "97sdfkio168",
+ "vf-module-model-customization-id": "84sdfkio938",
+ "vf-module-model-invariant-id": "123456qwerty",
+ "vf-module-model-version-id": "123qweasdzxc",
"sdnc_directives": {
"attributes": [
{
@@ -77,22 +80,6 @@ func TestBrokerCreateHandler(t *testing.T) {
"attribute_value": "test-vf-module-name"
}
]
- },
- "user_directives": {
- "attributes": [
- {
- "attribute_name": "rb-definition-name",
- "attribute_value": "test-rbdef"
- },
- {
- "attribute_name": "rb-definition-version",
- "attribute_value": "v1"
- },
- {
- "attribute_name": "rb-profile-name",
- "attribute_value": "profile1"
- }
- ]
}
}`)),
expectedCode: http.StatusBadRequest,
@@ -101,6 +88,8 @@ func TestBrokerCreateHandler(t *testing.T) {
label: "Succesfully create an Instance",
input: bytes.NewBuffer([]byte(`{
"vf-module-model-customization-id": "84sdfkio938",
+ "vf-module-model-invariant-id": "123456qwerty",
+ "vf-module-model-version-id": "123qweasdzxc",
"sdnc_directives": {
"attributes": [
{
@@ -108,14 +97,6 @@ func TestBrokerCreateHandler(t *testing.T) {
"attribute_value": "test-vf-module-name"
},
{
- "attribute_name": "k8s-rb-definition-name",
- "attribute_value": "test-rbdef"
- },
- {
- "attribute_name": "k8s-rb-definition-version",
- "attribute_value": "v1"
- },
- {
"attribute_name": "k8s-rb-profile-name",
"attribute_value": "profile1"
}
@@ -149,8 +130,8 @@ func TestBrokerCreateHandler(t *testing.T) {
{
ID: "HaKpys8e",
Request: app.InstanceRequest{
- RBName: "test-rbdef",
- RBVersion: "v1",
+ RBName: "123456qwerty",
+ RBVersion: "123qweasdzxc",
ProfileName: "profile1",
CloudRegion: "region1",
},