Use new TOSCA engine to bring up VMMEVendor and VMMETenant

Change-Id: I60f96b41e8f4d0af9b78d110ebef21dad47b3469
diff --git a/roles/cord-profile/templates/mcord-services.yml.j2 b/roles/cord-profile/templates/mcord-services.yml.j2
index 56d5549..80ea69c 100644
--- a/roles/cord-profile/templates/mcord-services.yml.j2
+++ b/roles/cord-profile/templates/mcord-services.yml.j2
@@ -60,32 +60,48 @@
         no-update: true
 {% endif %}
 
-# shared_network is for connectivity between VMs, fully created in shared-net.yaml
-    shared_network:
+# s1u_network is for connectivity between VMs, fully created in s1u-net.yaml
+    s1u_network:
       type: tosca.nodes.network.Network.XOS
       properties:
         no-create: true
         no-delete: true
         no-update: true
 
-# wan_network for vPGWU and its upstream connectivity, fully created in wan-net.yaml
-    wan_network:
+# s11_network is for connectivity between VMs, fully created in s11-net.yaml
+    s11_network:
       type: tosca.nodes.network.Network.XOS
       properties:
         no-create: true
         no-delete: true
         no-update: true
 
-# VLAN networks for RRH and vBBU, fully created in vsg-net.yaml
-    vsg_network:
+# s1mme_network is for connectivity between VMs, fully created in s1mme-net.yaml
+    s1mme_network:
       type: tosca.nodes.network.Network.XOS
       properties:
         no-create: true
         no-delete: true
         no-update: true
 
-# flat network for vMME, vSGWC, vSGWU, to connect to RRU, fully created in flat-net.yaml
-    flat_network:
+# nbi_network is for connectivity between VMs, fully created in nbi-net.yaml
+    nbi_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+        no-create: true
+        no-delete: true
+        no-update: true
+
+# sbi_network is for connectivity between VMs, fully created in sbi-net.yaml
+    sbi_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+        no-create: true
+        no-delete: true
+        no-update: true
+
+# sgi_network is for connectivity between VMs, fully created in sgi-net.yaml
+    sgi_network:
       type: tosca.nodes.network.Network.XOS
       properties:
         no-create: true
@@ -119,7 +135,7 @@
           pubkey: /opt/cord_profile/key_import/mcord_rsa.pub
 
 # CORD Slices
-    mysite_vMME_slice:
+    {{ site_name }}_vmme:
       description: vMME Service Slice
       type: tosca.nodes.Slice
       properties:
@@ -140,9 +156,9 @@
           - connection_to_management:
               node: management
               relationship: tosca.relationships.ConnectsToNetwork
-          - connection_to_shared_network:
-              node: shared_network
+          - connection_to_s11_network:
+              node: s11_network
               relationship: tosca.relationships.ConnectsToNetwork
-          - connection_to_flat_network:
-              node: flat_network
-              relationship: tosca.relationships.ConnectsToNetwork
\ No newline at end of file
+          - connection_to_s1mme_network:
+              node: s1mme_network
+              relationship: tosca.relationships.ConnectsToNetwork
diff --git a/roles/cord-profile/templates/s1mme-net.yaml.j2 b/roles/cord-profile/templates/s1mme-net.yaml.j2
new file mode 100644
index 0000000..7026333
--- /dev/null
+++ b/roles/cord-profile/templates/s1mme-net.yaml.j2
@@ -0,0 +1,46 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+   - custom_types/xos.yaml
+
+description: network for S1MME interface
+
+topology_template:
+  node_templates:
+
+# site, fully created in deployment.yaml
+    {{ site_name }}:
+      type: tosca.nodes.Site
+
+# s1mme network
+    s1mme_template:
+      type: tosca.nodes.NetworkTemplate
+      properties:
+          visibility: private
+          translation: none
+          vtn_kind: PRIVATE
+
+    s1mme_network:
+      type: tosca.nodes.network.Network
+      properties:
+          ip_version: 4
+          cidr: 116.0.0.0/24
+      requirements:
+          - network_template:
+              node: s1mme_template
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: {{ site_name }}_s1mme
+              relationship: tosca.relationships.MemberOfSlice
+
+    {{ site_name }}_s1mme:
+      description: This slice exists solely to own the private network
+      type: tosca.nodes.Slice
+      properties:
+          network: noauto
+      requirements:
+          - site:
+              node: {{ site_name }}
+              relationship: tosca.relationships.MemberOfSite
+
+
diff --git a/roles/cord-profile/templates/vmme-service.yaml.j2 b/roles/cord-profile/templates/vmme-service.yaml.j2
new file mode 100644
index 0000000..b2ca43f
--- /dev/null
+++ b/roles/cord-profile/templates/vmme-service.yaml.j2
@@ -0,0 +1,77 @@
+
+{#
+Copyright 2017-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: create VMMEVendor and VMMETenant
+
+imports:
+   - custom_types/xos.yaml
+   - custom_types/flavor.yaml
+   - custom_types/image.yaml
+   - custom_types/vmmeservice.yaml
+   - custom_types/vmmevendor.yaml
+   - custom_types/vmmetenant.yaml
+
+topology_template:
+  node_templates:
+
+    # Created earlier, throws an error without name field
+    m1.small:
+      type: tosca.nodes.Flavor
+      properties:
+        name: m1.small
+        must-exist: true
+
+    # Created earlier, throws an error without name field
+    trusty-server-multi-nic:
+      type: tosca.nodes.Image
+      properties:
+        name: trusty-server-multi-nic
+        must-exist: true
+
+    # Created earlier, throws an error without name field
+    service#vmme:
+      type: tosca.nodes.VMMEService
+      properties:
+        name: vmme
+        must-exist: true
+
+    intel_mme:
+      type: tosca.nodes.VMMEVendor
+      properties:
+        name: intel_mme
+      requirements:
+        - image:
+            node: trusty-server-multi-nic
+            relationship: tosca.relationships.BelongsToOne
+        - flavor:
+            node: m1.small
+            relationship: tosca.relationships.BelongsToOne
+
+    vmme_tenant1:
+      type: tosca.nodes.VMMETenant
+      properties:
+        name: vmme_tenant1
+      requirements:
+        - vmme_vendor:
+            node: intel_mme
+            relationship: tosca.relationships.BelongsToOne
+        - owner:
+            node: service#vmme
+            relationship: tosca.relationships.BelongsToOne
diff --git a/roles/test-mcord-base/tasks/main.yml b/roles/test-mcord-base/tasks/main.yml
index a2aec01..8bdeb89 100644
--- a/roles/test-mcord-base/tasks/main.yml
+++ b/roles/test-mcord-base/tasks/main.yml
@@ -27,6 +27,8 @@
   with_items:
     - management
     - sgi_network
+    - s11_network
+    - s1mme_network
   tags:
     - skip_ansible_lint # running a sub job
 
@@ -38,5 +40,6 @@
   delay: 60
   with_items:
     - internetemulator
+    - vmme
   tags:
     - skip_ansible_lint # running a sub job