Adapts PLA to new SOL006 NSD descriptors format
[osm/PLA.git] / osm_pla / test / test_server.py
index 737ca68..9d7582f 100644 (file)
@@ -194,9 +194,7 @@ list_of_vims = [{"_id": "73cd1a1b-333e-4e29-8db2-00d23bd9b644", "vim_user": "adm
                  "schema_version": "1.1", "config": {}}]
 
 # FIXME this is not correct re mgmt-network setting.
-nsd_from_db = {"_id": "15fc1941-f095-4cd8-af2d-1000bd6d9eaa", "short-name": "three_vnf_constrained_nsd_low",
-               "name": "three_vnf_constrained_nsd_low", "version": "1.0",
-               "description": "Placement constraints NSD",
+nsd_from_db = {"_id": "15fc1941-f095-4cd8-af2d-1000bd6d9eaa",
                "_admin": {"modified": 1567672251.7531693,
                           "storage": {"pkg-dir": "ns_constrained_nsd", "fs": "local",
                                       "descriptor": "ns_constrained_nsd/ns_constrained_nsd.yaml",
@@ -206,33 +204,62 @@ nsd_from_db = {"_id": "15fc1941-f095-4cd8-af2d-1000bd6d9eaa", "short-name": "thr
                           "projects_write": ["0a5d0c5b-7e08-48a1-a686-642a038bbd70"], "operationalState": "ENABLED",
                           "userDefinedData": {}, "created": 1567672251.7531693,
                           "projects_read": ["0a5d0c5b-7e08-48a1-a686-642a038bbd70"]},
-               "constituent-vnfd": [{"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index": "one"},
-                                    {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index": "two"},
-                                    {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index": "three"}],
-               "id": "three_vnf_constrained_nsd_low", "vendor": "ArctosLabs",
-               "vld": [{"type": "ELAN", "short-name": "ns_constrained_nsd_low_vld1",
-                        "link-constraint": [{"constraint-type": "LATENCY", "value": "100"},
-                                            {"constraint-type": "JITTER", "value": "30"}],
-                        "vim-network-name": "external", "mgmt-network": True,
-                        "id": "three_vnf_constrained_nsd_low_vld1",
-                        "vnfd-connection-point-ref": [
-                            {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index-ref": "one",
-                             "vnfd-connection-point-ref": "vnf-cp0"},
-                            {"vnfd-id-ref": "cirros_vnfd_v2",
-                             "member-vnf-index-ref": "two",
-                             "vnfd-connection-point-ref": "vnf-cp0"}],
-                        "name": "ns_constrained_nsd_vld1"},
-                       {"type": "ELAN", "short-name": "ns_constrained_nsd_low_vld2",
-                        "link-constraint": [{"constraint-type": "LATENCY", "value": "50"},
-                                            {"constraint-type": "JITTER", "value": "30"}],
-                        "vim-network-name": "lanretxe", "mgmt-network": True,
-                        "id": "three_vnf_constrained_nsd_low_vld2",
-                        "vnfd-connection-point-ref": [
-                            {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index-ref": "two",
-                             "vnfd-connection-point-ref": "vnf-cp0"},
-                            {"vnfd-id-ref": "cirros_vnfd_v2", "member-vnf-index-ref": "three",
-                             "vnfd-connection-point-ref": "vnf-cp0"}],
-                        "name": "ns_constrained_nsd_vld2"}]}
+               'id': 'three_vnf_constrained_nsd_low',
+               'name': 'three_vnf_constrained_nsd_low',
+               'description': 'Placement constraints NSD',
+               'designer': 'ArctosLabs',
+               'version': '1.0',
+               'vnfd-id': ['cirros_vnfd_v2'],
+               'df': [{
+                   'id': 'default-df',
+                   'vnf-profile': [{
+                       'id': 'one',
+                       'vnfd-id': 'cirros_vnfd_v2',
+                       'virtual-link-connectivity': [{
+                           'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld1',
+                           'constituent-cpd-id': [{
+                               'constituent-base-element-id': 'one',
+                               'constituent-cpd-id': 'vnf-cp0-ext'
+                           }]
+                       }]
+                   }, {
+                       'id': 'two',
+                       'vnfd-id': 'cirros_vnfd_v2',
+                       'virtual-link-connectivity': [{
+                           'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld1',
+                           'constituent-cpd-id': [{
+                               'constituent-base-element-id': 'two',
+                               'constituent-cpd-id': 'vnf-cp0-ext'
+                           }]
+                       }, {
+                           'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld2',
+                           'constituent-cpd-id': [{
+                               'constituent-base-element-id': 'two',
+                               'constituent-cpd-id': 'vnf-cp0-ext'
+                           }]
+                       }]
+                   }, {
+                       'id': 'three',
+                       'vnfd-id': 'cirros_vnfd_v2',
+                       'virtual-link-connectivity': [{
+                           'virtual-link-profile-id': 'three_vnf_constrained_nsd_low_vld2',
+                           'constituent-cpd-id': [{
+                               'constituent-base-element-id': 'three',
+                               'constituent-cpd-id': 'vnf-cp0-ext'
+                           }]
+                       }]
+                   }]
+               }],
+               'virtual-link-desc': [{
+                   'id': 'three_vnf_constrained_nsd_low_vld1',
+                   'mgmt-network': True,
+                   'vim-network-name': 'external'
+               }, {
+                   'id': 'three_vnf_constrained_nsd_low_vld2',
+                   'mgmt-network': True,
+                   'vim-network-name': 'lanretxe'
+               }],
+            }
 
 
 ######################################################