Updating CordVTN tests with integration of VSG component and use of new chameleon apis

Change-Id: I975a22d153139dbdba9a330ccea4f8f2efff04fb
diff --git a/src/test/cord-api/Framework/utils/openstackUtils.py b/src/test/cord-api/Framework/utils/openstackUtils.py
new file mode 100644
index 0000000..80d92b0
--- /dev/null
+++ b/src/test/cord-api/Framework/utils/openstackUtils.py
@@ -0,0 +1,40 @@
+import time
+import json
+import collections
+import sys
+import os.path
+import re
+
+def get_neutron_lists(netlist):
+    pairs = re.split("\+-*\+-*\+\n?",netlist)[2:-1]
+    ids,names,subnets = [],[],[]
+    for p in pairs:
+      for l in p.split('\n'):
+        pair = l.split('|')
+        if len(pair) > 1:
+          ids.append(pair[1].strip())
+          names.append(pair[2].strip())
+          subnets.append(pair[3].strip())
+    nets = dict(zip(names,subnets))
+    return nets
+
+def get_nova_lists(novalist,nameWildCard=None):
+    pairs = re.split("\+-*\+-*\+\n?",novalist)[2:-1]
+    ids,names,status,taskState,powerState,networks = [],[],[],[],[],[]
+    for p in pairs:
+      for l in p.split('\n'):
+        pair = l.split('|')
+        if len(pair) > 1:
+          ids.append(pair[1].strip())
+          names.append(pair[2].strip())
+          status.append(pair[3].strip())
+          taskState.append(pair[4].strip())
+          powerState.append(pair[5].strip())
+          networks.append(pair[6].strip())
+    instances = dict(zip(names,networks))
+    if nameWildCard is not None:
+        for key in instances.keys():
+            if re.match(nameWildCard, key):
+                return instances[key]
+    else:
+        return instances
\ No newline at end of file
diff --git a/src/test/cord-api/Framework/utils/utils.py b/src/test/cord-api/Framework/utils/utils.py
index 832bee2..38a148f 100644
--- a/src/test/cord-api/Framework/utils/utils.py
+++ b/src/test/cord-api/Framework/utils/utils.py
@@ -7,6 +7,8 @@
 import os.path
 from os.path import expanduser
 import uuid
+import random
+import re
 
 class utils(object):
 
@@ -128,12 +130,10 @@
         return_dict = {}
         result = ''
         for data in getJsonDataList:
-            print "data..",data
             return_dict = {}
             found = False
             input_keys = data.keys()
             for key in input_keys:
-                print "key in input_keys...",key
                 if key == searchKey and str(data[key]) == str(searchKeyValue):
                    found = True
                    return_dict = data
@@ -219,254 +219,31 @@
     def generate_uuid(self):
         return uuid.uuid4()
 
+    def generate_random_number_from_blacklist(self, blacklist, min=100, max=500, typeTag=False):
+        num = None
+        while num in blacklist or num is None:
+            num = random.randrange(int(min), int(max))
+        if typeTag:
+            return num
+        else:
+            return str(num)
+
 '''
 #Test
 dict_list = {
-[
-    {
-        "humanReadableName": "mysite_vsg-1",
-        "validators": {
-            "policed": [],
-            "creator": [],
-            "ip": [],
-            "image": [
-                "notBlank"
-            ],
-            "backend_register": [
-                "notBlank"
-            ],
-            "flavor": [
-                "notBlank"
-            ],
-            "backend_status": [
-                "notBlank"
-            ],
-            "id": [],
-            "instance_name": [],
-            "slice": [
-                "notBlank"
-            ],
-            "backend_need_delete": [],
-            "enacted": [],
-            "no_sync": [],
-            "node": [
-                "notBlank"
-            ],
-            "userData": [],
-            "updated": [
-                "notBlank"
-            ],
-            "parent": [],
-            "deleted": [],
-            "lazy_blocked": [],
-            "deployment": [
-                "notBlank"
-            ],
-            "backend_need_reap": [],
-            "instance_uuid": [],
-            "numberCores": [
-                "notBlank"
-            ],
-            "name": [
-                "notBlank"
-            ],
-            "created": [],
-            "write_protect": [],
-            "isolation": [
-                "notBlank"
-            ],
-            "no_policy": [],
-            "instance_id": [],
-            "volumes": []
+ "humanReadableName": "cordSubscriber-17",
+        "id": 17,
+        "features": {
+            "uplink_speed": 1000000000,
+            "downlink_speed": 1000000000,
+            "status": "enabled"
         },
-        "id": 1,
-        "created": "2017-03-13T22:23:48.805109Z",
-        "updated": "2017-03-13T22:38:06.084074Z",
-        "enacted": "2017-03-13T22:38:43.894253Z",
-        "policed": "2017-03-13T22:38:08.086489Z",
-        "backend_register": "{\"next_run\": 0, \"last_success\": 1489444729.019414, \"exponent\": 0}",
-        "backend_status": "1 - OK",
-        "instance_id": "instance-00000001",
-        "instance_uuid": "a46d716f-e82c-4088-a042-72c3a97ed3ff",
-        "name": "mysite_vsg",
-        "instance_name": "mysite_vsg-1",
-        "ip": "10.1.0.17",
-        "image": "http://ms1333.utah.cloudlab.us:8080/api/core/images/1/",
-        "creator": "http://ms1333.utah.cloudlab.us:8080/api/core/users/1/",
-        "slice": "http://ms1333.utah.cloudlab.us:8080/api/core/slices/2/",
-        "deployment": "http://ms1333.utah.cloudlab.us:8080/api/core/deployments/1/",
-        "node": "http://ms1333.utah.cloudlab.us:8080/api/core/nodes/1/",
-        "numberCores": 0,
-        "flavor": "http://ms1333.utah.cloudlab.us:8080/api/core/flavors/1/",
-        "isolation": "vm",
-        "volumes": "/etc/dnsmasq.d,/etc/ufw",
-        "networks": [
-            "http://ms1333.utah.cloudlab.us:8080/api/core/networks/1/",
-            "http://ms1333.utah.cloudlab.us:8080/api/core/networks/2/"
-        ]
-    },
-    {
-        "humanReadableName": "mysite_exampleservice-2",
-        "validators": {
-            "policed": [],
-            "creator": [],
-            "ip": [],
-            "image": [
-                "notBlank"
-            ],
-            "backend_register": [
-                "notBlank"
-            ],
-            "flavor": [
-                "notBlank"
-            ],
-            "backend_status": [
-                "notBlank"
-            ],
-            "id": [],
-            "instance_name": [],
-            "slice": [
-                "notBlank"
-            ],
-            "backend_need_delete": [],
-            "enacted": [],
-            "no_sync": [],
-            "node": [
-                "notBlank"
-            ],
-            "userData": [],
-            "updated": [
-                "notBlank"
-            ],
-            "parent": [],
-            "deleted": [],
-            "lazy_blocked": [],
-            "deployment": [
-                "notBlank"
-            ],
-            "backend_need_reap": [],
-            "instance_uuid": [],
-            "numberCores": [
-                "notBlank"
-            ],
-            "name": [
-                "notBlank"
-            ],
-            "created": [],
-            "write_protect": [],
-            "isolation": [
-                "notBlank"
-            ],
-            "no_policy": [],
-            "instance_id": [],
-            "volumes": []
+        "identity": {
+            "account_num": "20",
+            "name": "My House"
         },
-        "id": 2,
-        "created": "2017-03-13T22:38:03.872267Z",
-        "updated": "2017-03-13T22:38:06.047153Z",
-        "enacted": "2017-03-13T22:39:07.002800Z",
-        "policed": "2017-03-13T22:38:07.895147Z",
-        "backend_register": "{\"next_run\": 0, \"last_success\": 1489444774.726988, \"exponent\": 0}",
-        "backend_status": "1 - OK",
-        "instance_id": "instance-00000002",
-        "instance_uuid": "cb219739-0d11-48a2-9f19-1e2aba1f004e",
-        "name": "mysite_exampleservice",
-        "instance_name": "mysite_exampleservice-2",
-        "ip": "10.1.0.17",
-        "image": "http://ms1333.utah.cloudlab.us:8080/api/core/images/3/",
-        "creator": "http://ms1333.utah.cloudlab.us:8080/api/core/users/1/",
-        "slice": "http://ms1333.utah.cloudlab.us:8080/api/core/slices/4/",
-        "deployment": "http://ms1333.utah.cloudlab.us:8080/api/core/deployments/1/",
-        "node": "http://ms1333.utah.cloudlab.us:8080/api/core/nodes/1/",
-        "numberCores": 0,
-        "flavor": "http://ms1333.utah.cloudlab.us:8080/api/core/flavors/1/",
-        "isolation": "vm",
-        "networks": [
-            "http://ms1333.utah.cloudlab.us:8080/api/core/networks/3/",
-            "http://ms1333.utah.cloudlab.us:8080/api/core/networks/1/",
-            "http://ms1333.utah.cloudlab.us:8080/api/core/networks/4/"
-        ]
-    },
-    {
-        "humanReadableName": "mysite_vsg-3",
-        "validators": {
-            "policed": [],
-            "creator": [],
-            "ip": [],
-            "image": [
-                "notBlank"
-            ],
-            "backend_register": [
-                "notBlank"
-            ],
-            "flavor": [
-                "notBlank"
-            ],
-            "backend_status": [
-                "notBlank"
-            ],
-            "id": [],
-            "instance_name": [],
-            "slice": [
-                "notBlank"
-            ],
-            "backend_need_delete": [],
-            "enacted": [],
-            "no_sync": [],
-            "node": [
-                "notBlank"
-            ],
-            "userData": [],
-            "updated": [
-                "notBlank"
-            ],
-            "parent": [],
-            "deleted": [],
-            "lazy_blocked": [],
-            "deployment": [
-                "notBlank"
-            ],
-            "backend_need_reap": [],
-            "instance_uuid": [],
-            "numberCores": [
-                "notBlank"
-            ],
-            "name": [
-                "notBlank"
-            ],
-            "created": [],
-            "write_protect": [],
-            "isolation": [
-                "notBlank"
-            ],
-            "no_policy": [],
-            "instance_id": [],
-            "volumes": []
-        },
-        "id": 3,
-        "created": "2017-03-17T23:15:13.556863Z",
-        "updated": "2017-03-17T23:15:13.555271Z",
-        "enacted": "2017-03-17T23:15:24.376854Z",
-        "policed": "2017-03-17T23:15:14.991037Z",
-        "backend_register": "{\"next_run\": 0, \"last_success\": 1489792538.996003, \"exponent\": 0}",
-        "backend_status": "1 - OK",
-        "instance_id": "instance-00000003",
-        "instance_uuid": "ec5ece6d-bebe-4165-98c5-3a026a41c63c",
-        "name": "mysite_vsg",
-        "instance_name": "mysite_vsg-3",
-        "ip": "10.1.0.17",
-        "image": "http://ms1333.utah.cloudlab.us:8080/api/core/images/1/",
-        "creator": "http://ms1333.utah.cloudlab.us:8080/api/core/users/1/",
-        "slice": "http://ms1333.utah.cloudlab.us:8080/api/core/slices/2/",
-        "deployment": "http://ms1333.utah.cloudlab.us:8080/api/core/deployments/1/",
-        "node": "http://ms1333.utah.cloudlab.us:8080/api/core/nodes/1/",
-        "numberCores": 0,
-        "flavor": "http://ms1333.utah.cloudlab.us:8080/api/core/flavors/1/",
-        "isolation": "vm",
-        "volumes": "/etc/dnsmasq.d,/etc/ufw"
+        "related": {}
     }
-   ]
-  }
 input_dict = {
  "s_tag" : "111",
  "c_tag" : "222",
@@ -477,10 +254,10 @@
 #data=test.jsonToList("Subscribers.json","SubscriberInfo")
 #print  test.jsonToList("Subscribers.json","SubscriberInfo")
 #print "index 1...",test.listToDict(data,1)
-result = test.getDictFromListOfDict(dict_list,"instance_name","mysite_vsg-3")
+#result = test.getDictFromListOfDict(dict_list,"email",21)
 #result = test.getFieldValueFromDict(dict_list,"id")
 #result = test.getDictFromListOfDict(dict_list,"account_num",21)
 #result = test.setFieldValueInDict(input_dict,"subscriber",new_value)
-#result = test.getAllFieldValues(list1,"instance_name")
+result = test.getAllFieldValues(list1,"instance_name")
 print "finalllllll result....", result
 '''
diff --git a/src/test/cord-api/Framework/utils/utils.robot b/src/test/cord-api/Framework/utils/utils.robot
index 0536a8a..d456308 100644
--- a/src/test/cord-api/Framework/utils/utils.robot
+++ b/src/test/cord-api/Framework/utils/utils.robot
@@ -25,7 +25,7 @@
     [Return]    ${output}
 
 Execute Command on CIAB Server in Specific VM
-    [Arguments]    ${system}    ${vm}    ${cmd}    ${user}=${VM_USER}    ${password}=${VM_PASS}    ${prompt}=$    ${use_key}=True
+    [Arguments]    ${system}    ${vm}    ${cmd}    ${user}=${VM_USER}    ${password}=${VM_PASS}    ${prompt}=$    ${use_key}=True    ${strip_line}=True
     [Documentation]    SSHs into ${HOST} where CIAB is running and executes a command in the Prod Vagrant VM where all the containers are running
     ${conn_id}=    SSHLibrary.Open Connection    ${system}    prompt=${prompt}    timeout=300s
     Run Keyword If    '${use_key}' == 'False'    SSHLibrary.Login    ${user}    ${pass}    ELSE    SSHLibrary.Login With Public Key    ${user}    %{HOME}/.ssh/${SSH_KEY}    any
@@ -34,7 +34,8 @@
     SSHLibrary.Write    ${cmd}
     ${output}=    SSHLibrary.Read Until Prompt
     SSHLibrary.Close Connection
-    ${output}=    Get Line    ${output}    0
+    ${output_1}=    Run Keyword If    '${strip_line}' == 'True'    Get Line    ${output}    0
+    ${output}=    Set Variable If    '${strip_line}' == 'True'    ${output_1}    ${output}
     [Return]    ${output}
 
 Execute Command on Compute Node in CIAB
@@ -71,4 +72,4 @@
     ${container_logs}=    SSHLibrary.Read Until    ${prompt}
     SSHLibrary.Close Connection
     Log    ${container_logs}
-    [Return]    ${container_logs}
\ No newline at end of file
+    [Return]    ${container_logs}
diff --git a/src/test/cord-api/Properties/RestApiProperties.py b/src/test/cord-api/Properties/RestApiProperties.py
index 014756b..399560d 100644
--- a/src/test/cord-api/Properties/RestApiProperties.py
+++ b/src/test/cord-api/Properties/RestApiProperties.py
@@ -37,4 +37,11 @@
 CORE_IMAGES = '/api/core/images/'
 CH_CORE_IMAGES = '/xosapi/v1/core/images'
 CORE_SITEDEPLOYMENTS = '/api/core/sitedeployments'
+CH_CORE_NETWORKS = '/xosapi/v1/core/networks'
+CH_CORE_SLICES = '/xosapi/v1/core/slices'
+CH_CORE_NETWORK_SLICES = '/xosapi/v1/core/networkslices'
+CH_CORE_PORTS = '/xosapi/v1/core/ports'
+CH_CORE_SERVICES = '/xosapi/v1/core/services'
 CH_CORE_SITEDEPLOYMENTS = '/xosapi/v1/core/sitedeployments'
+CH_CORE_NETWORK_TEMPLATES = '/xosapi/v1/core/networktemplates'
+VSG_TENANT = '/xosapi/v1/vsg/vsgtenants'
diff --git a/src/test/cord-api/Tests/CordVTN.txt b/src/test/cord-api/Tests/CordVTN.txt
index c9ee29e..668d24d 100644
--- a/src/test/cord-api/Tests/CordVTN.txt
+++ b/src/test/cord-api/Tests/CordVTN.txt
@@ -10,122 +10,266 @@
 Library           RequestsLibrary
 Library           ../Framework/utils/utils.py
 Library           ../Framework/restApi.py
+Library           ../Framework/utils/openstackUtils.py
 Variables         ../Properties/RestApiProperties.py
 Resource           ../Framework/utils/utils.robot
 
 *** Variables ***
-${VM_USER}            admin
-${VM_PASS}            admin
-${SSH_KEY}            id_rsa.pub
-${ONOS_CORDVTN_API}   http://onos-cord:8182/onos/cordvtn
+${VM_USER}                         admin
+${VM_PASS}                         admin
+${SSH_KEY}                         id_rsa.pub
+${ONOS_CORDVTN_API}                http://onos-cord:8182/onos/cordvtn
+${CORE_SERVICE_PATHFILE}           ${CURDIR}/data/Service.json
+${CORE_NETWORK_PATHFILE}           ${CURDIR}/data/CoreNetwork.json
+${CORE_SLICE_PATHFILE}             ${CURDIR}/data/CoreSlice.json
+${CORE_NETWORK_SLICE_PATHFILE}     ${CURDIR}/data/CoreNetworkSlice.json
+${CORE_INSTANCE_PATHFILE}          ${CURDIR}/data/CoreInstance.json
+${CORD_SUBSCRIBER_PATHFILE}        ${CURDIR}/data/CordSubscriber.json
+${VOLT_TENANT_PATHFILE}            ${CURDIR}/data/CordVoltTenant.json
 
 *** Test Cases ***
-Get Compute Node Hostname + IP
-    [Documentation]    Logs into ciab server and executes a 'cord prov list' on the headnode to get the compute node
-    [Tags]    computenode
-    ${compute_node_hostname}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    cord prov list | grep node | awk '{print $2}'
-    ${compute_node_ip}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    cord prov list | grep node | awk '{print $4}'
-    Set Suite Variable    ${compute_node_hostname}
-    set suite variable    ${compute_node_ip}
-
-Get ONOSCORD Container ID
-    [Documentation]    Logs into ciab server and extracts the onoscord container id on the headnode
-    [Tags]    onoscord
-    ${onoscord_id}=    Get Docker Container ID    ${SERVER_IP}    onoscord    ${VM_USER}    ${VM_PASS}
-
 Validate Default OVS Flow Count
     [Documentation]    Logs into the compute-node where OVS is running and validates the default flow count
     [Tags]    ovsflows
-    ${ovs_flow_count}=    Execute Command on Compute Node in CIAB    ${SERVER_IP}    ${compute_node_hostname}    ovs-ofctl dump-flows br-int | wc -l
-    ${ovs_flow_count}=    Get Line    ${ovs_flow_count}    0
-    Should Be Equal As Integers    ${ovs_flow_count}    42
-
-Validate Default Flow Count in ONOS
-    [Documentation]    Validates the number of flows pushed down by onos (should match number flow count in ovs)
-    [Tags]    onosflows    notready
-    Log    Validating ONOS Flow Count
+    Wait Until Keyword Succeeds    30s    5s    Validate Flow Count    42
 
 Validate Current VTN Service Networks and Ports
-    [Documentation]    Makes rest calls to both XOS and ONOSCORD to validate the default VTN Service Networks + Ports
-    [Tags]    vtnservice
+    [Documentation]    Makes rest calls to XOS to validate the default VTN Service Networks + Ports (public,management,exampleservice_network,mysite_vsg-access)
+    [Tags]    vtn
     Validate Default CIAB Service Networks and Ports via XOS
-    ${serviceNetworks}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -X GET -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/serviceNetworks; echo
-    Validate Default CIAB Service Networks via ONOSCORD    ${serviceNetworks}
-    ${servicePorts}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -X GET -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/servicePorts; echo
-    Validate Default CIAB Service Ports via ONOSCORD    ${servicePorts}
+
+Validate Default Subscriber
+    [Documentation]    Validates the default subscriber set up in CIAB (My House)
+    [Tags]    vsg
+    ${resp}=    CORD GET    ${SERVER_IP}    ${VOLT_SUBSCRIBER}/1
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Log    ${resp.content}
+    ${name}=    Get Json Value    ${resp.content}    /name
+    ${service_specific_id}=    Get Json Value    ${resp.content}    /service_specific_id
+    ${uplink_speed}=    Get Json Value    ${resp.content}    /uplink_speed
+    Should Be Equal As Strings    ${name}    "My House"
+    Should Be Equal As Strings    ${service_specific_id}    "123"
+    Should Be Equal As Strings    ${uplink_speed}    1000000000
+
+Create New Test Service
+    [Documentation]    Creates a generic service that will be used for the new VTN Network
+    [Tags]    vtn
+    ${updatedcservList}=    utils.setFieldValueInDict    ${cservlist[0]}    name    CordVTN-Test-Service
+    ${updatedcservList}=    utils.setFieldValueInDict    ${updatedcservList}    description    Test Service for CordVTN Test Suite
+    ${resp}=    Cord POST    ${SERVER_IP}    ${CH_CORE_SERVICES}    ${updatedcservList}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${name}=    Get Json Value    ${resp.content}    /name
+    ${generic_service_id}=    Get Json Value    ${resp.content}    /id
+    ${description}=    Get Json Value    ${resp.content}    /description
+    ${kind}=    Get Json Value    ${resp.content}    /kind
+    Should Be Equal As Strings    ${name}    "CordVTN-Test-Service"
+    Should Be Equal As Strings    ${description}    "Test Service for CordVTN Test Suite"
+    Should Be Equal As Strings    ${kind}    "generic"
+    Set Suite Variable    ${generic_service_id}
 
 Create New VTN Service Network
-    [Documentation]    Makes a POST Request from the head-node to the ONOS Cord-VTN App to create a new service network
-    [Tags]    vtnservice
-    ${network_uuid}=    Generate UUID
-    Set Suite Variable    ${network_uuid}
-    ${networkCreation}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -s -o /dev/null -w "\%{http_code}" -X POST -u karaf:karaf -H "Content-Type: application/json" -d '{"ServiceNetwork": {"id": "${network_uuid}", "type": "PRIVATE", "name": "APITEST", "segment_id": 2221, "subnet": "2.2.2.0/24", "service_ip": "2.2.2.1", "providers": [{"id": "${public_network_id}", "bidirectional": true}]}}' http://onos-cord:8182/onos/cordvtn/serviceNetworks; echo
-    Should Be Equal As Integers    ${networkCreation}    201
-    ${new_network}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -X GET -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/serviceNetworks/${network_uuid}; echo
-    Log    ${new_network}
-    ${name}=    Get Json Value    ${new_network}    /ServiceNetwork/name
-    ${type}=    Get Json Value    ${new_network}    /ServiceNetwork/type
-    ${segment_id}=    Get Json Value    ${new_network}    /ServiceNetwork/segment_id
-    ${subnet}=    Get Json Value    ${new_network}    /ServiceNetwork/subnet
-    ${service_ip}=    Get Json Value    ${new_network}    /ServiceNetwork/service_ip
-    Should Be Equal As Strings    ${name}    "APITEST"
-    Should Be Equal As Strings    ${type}    "PRIVATE"
-    Should Be Equal As Strings    ${segment_id}    2221
+    [Documentation]    Makes a POST Request to XOS to create a new core network
+    [Tags]    vtn
+    ${updatedCnList}=    utils.setFieldValueInDict    ${cnlist[0]}    template_id    ${vsg_network_template_id}
+    ${updatedCnList}=    utils.setFieldValueInDict    ${updatedCnList}    owner_id    ${vsg_slice_id}
+    Log    ${updatedCnList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${CH_CORE_NETWORKS}    ${cnlist[0]}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${name}=    Get Json Value    ${resp.content}    /name
+    ${network_id}=    Get Json Value    ${resp.content}    /id
+    ${subnet}=    Get Json Value    ${resp.content}    /subnet
+    ${start_ip}=    Get Json Value    ${resp.content}    /start_ip
+    ${end_ip}=    Get Json Value    ${resp.content}    /end_ip
+    Should Be Equal As Strings    ${name}    "test-network"
     Should Be Equal As Strings    ${subnet}    "2.2.2.0/24"
-    Should Be Equal As Strings    ${service_ip}    "2.2.2.1"
+    Should Be Equal As Strings    ${start_ip}    "2.2.2.2"
+    Should Be Equal As Strings    ${end_ip}    "2.2.2.254"
+    Set Suite Variable    ${network_id}
 
-Create New VTN Service Port
-    [Documentation]    Makes a POST Request from the head-node to the ONOS Cord-VTN App to create a new service port for the newly created network
-    [Tags]    vtnservice
-    ${port_uuid}=    Generate UUID
-    Set Suite Variable    ${port_uuid}
-    ${networkCreation}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -s -o /dev/null -w "\%{http_code}" -X POST -u karaf:karaf -H "Content-Type: application/json" -d '{"ServicePort": {"id": "${port_uuid}", "network_id": "${network_uuid}", "name": "APITESTPORT", "mac_address": "FA:16:3E:A8:A1:AA", "ip_address": "2.2.2.1", "floating_address_pairs":[{"ip_address":"3.3.3.1","mac_address":"02:42:0A:06:01:11"}]}}' http://onos-cord:8182/onos/cordvtn/servicePorts; echo
-    Should Be Equal As Integers    ${networkCreation}    201
-    ${new_port}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -X GET -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/servicePorts/${port_uuid}; echo
-    Log    ${new_port}
-    ${name}=    Get Json Value    ${new_port}    /ServicePort/name
-    ${netId}=    Get Json Value    ${new_port}    /ServicePort/network_id
-    ${mac_address}=    Get Json Value    ${new_port}    /ServicePort/mac_address
-    ${ip_address}=    Get Json Value    ${new_port}    /ServicePort/ip_address
-    ${floating_pairs}=    Get Json Value    ${new_port}    /ServicePort/floating_address_pairs
-    Should Be Equal As Strings    ${name}    "APITESTPORT"
-    Should Be Equal As Strings    ${netId}    "${network_uuid}"
-    Should Be Equal As Strings    ${mac_address}    "FA:16:3E:A8:A1:AA"
-    Should Be Equal As Strings    ${ip_address}    "2.2.2.1"
+Create New Slice with New Test Service
+    [Documentation]    Makes a POST Request to XOS to create a new slice and adds new generic test service to that slice
+    [Tags]    vtn
+    ${updatedCsList}=    utils.setFieldValueInDict    ${cslist[0]}    service_id    ${generic_service_id}
+    Log    ${updatedCsList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${CH_CORE_SLICES}    ${updatedCsList}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${name}=    Get Json Value    ${resp.content}    /name
+    ${new_slice_id}=    Get Json Value    ${resp.content}    /id
+    ${max_instances}=    Get Json Value    ${resp.content}    /max_instances
+    ${ser_id}=    Get Json Value    ${resp.content}    /service_id
+    ${default_isolation}=    Get Json Value    ${resp.content}    /default_isolation
+    Should Be Equal As Strings    ${name}    "mysite_testservice"
+    Should Be Equal As Strings    ${max_instances}    10
+    Should Be Equal As Strings    ${ser_id}    ${generic_service_id}
+    Should Be Equal As Strings    ${default_isolation}    "vm"
+    Set Suite Variable    ${new_slice_id}
+
+Add Networks to New Test Network Slice
+    [Documentation]    Creates a new network slice for the new slice and adds mgmt and new network to it
+    [Tags]    vsg
+    ${updatedCsList}=    utils.setFieldValueInDict    ${cnslist[0]}    network_id    ${network_id}
+    ${updatedCsList}=    utils.setFieldValueInDict    ${updatedCsList}    slice_id    ${new_slice_id}
+    Log    ${updatedCsList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${CH_CORE_NETWORK_SLICES}    ${updatedCsList}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${s_id}=    Get Json Value    ${resp.content}    /slice_id
+    ${n_id}=    Get Json Value    ${resp.content}    /network_id
+    Should Be Equal As Strings    ${s_id}    ${new_slice_id}
+    Should Be Equal As Strings    ${n_id}    ${network_id}
+    ##Add mgmt network to this network slice
+    ${updatedCsList}=    utils.setFieldValueInDict    ${cnslist[0]}    network_id    ${mgmt_network_id}
+    ${updatedCsList}=    utils.setFieldValueInDict    ${updatedCsList}    slice_id    ${new_slice_id}
+    Log    ${updatedCsList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${CH_CORE_NETWORK_SLICES}    ${updatedCsList}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${s_id}=    Get Json Value    ${resp.content}    /slice_id
+    ${n_id}=    Get Json Value    ${resp.content}    /network_id
+    Should Be Equal As Strings    ${s_id}    ${new_slice_id}
+    Should Be Equal As Strings    ${n_id}    ${mgmt_network_id}
+
+Create New Test Instance
+    [Documentation]    Creates a new instance for the test service
+    [Tags]    vsg
+    ${updatedCiList}=    utils.setFieldValueInDict    ${cilist[0]}    slice_id    ${new_slice_id}
+    ${updatedCiList}=    utils.setFieldValueInDict    ${updatedCiList}    image_id    ${image_id}
+    Log    ${updatedCiList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${CH_CORE_INSTANCES}    ${updatedCiList}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${new_instance_id}=    Get Json Value    ${resp.content}    /id
+    ${slice_id}=    Get Json Value    ${resp.content}    /slice_id
+    ${i_id}=    Get Json Value    ${resp.content}    /image_id
+    ${node_id}=    Get Json Value    ${resp.content}    /node_id
+    ${name}=    Get Json Value    ${resp.content}    /name
+    ${instance_name}=    Get Json Value    ${resp.content}    /instance_name
+    Should Be Equal As Strings    ${slice_id}    ${new_slice_id}
+    Should Be Equal As Strings    ${i_id}    ${image_id}
+    Should Be Equal As Strings    ${node_id}    1
+    Should Be Equal As Strings    ${name}    "mysite_testservice"
+    Should Be Equal As Strings    ${instance_name}    "mysite_testservice-1"
+    Set Suite Variable    ${new_instance_id}
+
+Validate New OVS Flow Count
+    [Documentation]    Logs into the compute-node where OVS is running and validates the new flow count (new flow rules for new volt tenant instance)
+    [Tags]    ovsflows
+    Wait Until Keyword Succeeds    300s    5s    Validate Flow Count    49
+
+Validate Creation of Openstack Resources
+    [Documentation]    Retrieves openstack compute node state and validates the new network and instance has been created properly
+    [Tags]    openstack
+    Wait Until Keyword Succeeds    300s    5s    Validate Openstack Network    test-network    2.2.2.0/24
+    Wait Until Keyword Succeeds    300s    5s    Validate Openstack Nova Instance    mysite_testservice-1*    test-network
 
 Validate New Flows Pushed to OVS
-    [Documentation]    Logs into the compute-node where OVS is running and validates the default flow count
+    [Documentation]    Logs into the compute-node where OVS is running and validates the new flows added
     [Tags]    vtnservice
     ${ovs_flow_count}=    Execute Command on Compute Node in CIAB    ${SERVER_IP}    ${compute_node_hostname}    ovs-ofctl dump-flows br-int | grep 2.2.2.0 | wc -l
     ${ovs_flow_count}=    Get Line    ${ovs_flow_count}    0
-    Should Be Equal As Integers    ${ovs_flow_count}    3
+    Should Be Equal As Integers    ${ovs_flow_count}    2
     ${flows_added}=    Execute Command on Compute Node in CIAB    ${SERVER_IP}    ${compute_node_hostname}    ovs-ofctl dump-flows br-int
     ${flows_added}=    Get Lines Containing String    ${flows_added}    cookie=
     Log    ${flows_added}
     ## Match src/dst (bi-directional) rules on new flows added
-    Should Contain    ${flows_added}    nw_src=2.2.2.0/24,nw_dst=10.6.1.192/26
-    Should Contain    ${flows_added}    nw_src=10.6.1.192/26,nw_dst=2.2.2.0/24
-    Should Contain    ${flows_added}    nw_src=2.2.2.0/24,nw_dst=10.6.1.193
+    Should Contain    ${flows_added}    nw_src=2.2.2.0/24,nw_dst=2.2.2.0/24
 
-Delete VTN Service Port
-    [Documentation]    Makes a DELETE Request from the head-node to the ONOS Cord-VTN App to delete the new service port
-    [Tags]    vtnservice
-    ${networkDeletion}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -s -o /dev/null -w "\%{http_code}" -X DELETE -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/servicePorts/${port_uuid}; echo
-    Should Be Equal As Integers    ${networkDeletion}    204
-    ${get_port}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -s -o /dev/null -w "\%{http_code}" -X GET -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/servicePorts/${port_uuid}; echo
-    Should Be Equal As Integers    ${get_port}    404
+Create New Cord Subscriber
+    [Documentation]    Creates a new cord root subscriber
+    [Tags]    vsg
+    ${blacklist_sr_ids}=    Get Subscriber Root IDs in Use
+    ${ss_id}=    Generate Random Number from Blacklist    ${blacklist_sr_ids}
+    Set Suite Variable    ${ss_id}
+    ${updatedcsList}=    utils.setFieldValueInDict    ${csubList[0]}    service_specific_id    ${ss_id}
+    Log    ${updatedcsList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${VOLT_SUBSCRIBER}    ${updatedcsList}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${subscriber_root_id}=    Get Json Value    ${resp.content}    /id
+    ${kind}=    Get Json Value    ${resp.content}    /kind
+    ${enable_uverse}=    Get Json Value    ${resp.content}    /enable_uverse
+    ${uplink_speed}=    Get Json Value    ${resp.content}    /uplink_speed
+    ${downlink_speed}=    Get Json Value    ${resp.content}    /downlink_speed
+    ${status}=    Get Json Value    ${resp.content}    /status
+    ${is_demo_user}=    Get Json Value    ${resp.content}    /is_demo_user
+    ${service_specific_id}=    Get Json Value    ${resp.content}    /service_specific_id
+    Should Be Equal As Strings    ${kind}    "CordSubscriberRoot"
+    Should Be Equal As Strings    ${enable_uverse}    true
+    Should Be Equal As Strings    ${uplink_speed}    1000000011
+    Should Be Equal As Strings    ${downlink_speed}    1000000011
+    Should Be Equal As Strings    ${status}    "enabled"
+    Should Be Equal As Strings    ${is_demo_user}    false
+    Should Be Equal As Strings    ${service_specific_id}    "${ss_id}"
+    Set Suite Variable    ${service_specific_id}
+    Set Suite Variable    ${subscriber_root_id}
 
-Delete VTN Service Network
-    [Documentation]    Makes a DELETE Request from the head-node to the ONOS Cord-VTN App to delete the created service network
-    [Tags]    vtnservice
-    ${networkDeletion}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -s -o /dev/null -w "\%{http_code}" -X DELETE -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/serviceNetworks/${network_uuid}; echo
-    Should Be Equal As Integers    ${networkDeletion}    204
-    ${get_network}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    curl -s -o /dev/null -w "\%{http_code}" -X GET -u karaf:karaf -H "Content-Type: application/json" http://onos-cord:8182/onos/cordvtn/serviceNetworks/${network_uuid}; echo
-    Should Be Equal As Integers    ${get_network}    404
+Create New Volt Tenant for New Cord Subscriber
+    [Documentation]    Creates a new volt tenant for the newly created cord root subscriber
+    [Tags]    vsg
+    ${blacklist_tags}=    Get Tags in Use
+    Log    ${blacklist_tags}
+    ${s_tag}=    Generate Random Number from Blacklist    ${blacklist_tags}    1    4096    True
+    Append To List    ${blacklist_tags}    ${s_tag}
+    ${c_tag}=    Generate Random Number from Blacklist    ${blacklist_tags}    1    4096    True
+    Append To List    ${blacklist_tags}    ${c_tag}
+    Log    ${blacklist_tags}
+    ${updatedvtList}=    utils.setFieldValueInDict    ${vtList[0]}    provider_service_id    ${volt_service_id}
+    ${updatedvtList}=    utils.setFieldValueInDict    ${updatedvtList}    subscriber_root_id    ${subscriber_root_id}
+    ${updatedvtList}=    utils.setFieldValueInDict    ${updatedvtList}    s_tag    ${s_tag}
+    ${updatedvtList}=    utils.setFieldValueInDict    ${updatedvtList}    c_tag    ${c_tag}
+    Log    ${updatedvtList}
+    ${resp}=    Cord POST    ${SERVER_IP}    ${VOLT_TENANT}    ${vtList[0]}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${volt_tenant_id}=    Get Json Value    ${resp.content}    /id
+    ${stag}=    Get Json Value    ${resp.content}    /s_tag
+    ${ctag}=    Get Json Value    ${resp.content}    /c_tag
+    ${kind}=    Get Json Value    ${resp.content}    /kind
+    ${prov_service_id}=    Get Json Value    ${resp.content}    /provider_service_id
+    Should Be Equal As Strings    ${stag}    ${s_tag}
+    Should Be Equal As Strings    ${ctag}    ${c_tag}
+    Should Be Equal As Strings    ${kind}    "vOLT"
+    Should Be Equal As Strings    ${prov_service_id}    ${volt_service_id}
+    Set Suite Variable    ${volt_tenant_id}
+
+Validate Creation of New Subscriber Instance
+    [Documentation]    Validates instance (vm) for new subscriber is created in the vsg slice
+    [Tags]    openstack
+    Wait Until Keyword Succeeds    300s    5s    Validate Openstack Nova Instance    mysite_vsg-*    mysite_vsg-access
+
+Delete Volt Tenant
+    [Documentation]    Deletes new volt tenant
+    [Tags]    delete
+    ${resp}=    Cord DELETE    ${SERVER_IP}    ${VOLT_TENANT}    ${volt_tenant_id}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Delete Cord Subscriber
+    [Documentation]    Deletes new cord subscriber
+    [Tags]    deletes
+    ${resp}=    Cord DELETE    ${SERVER_IP}    ${VOLT_SUBSCRIBER}    ${subscriber_root_id}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Delete Test Instance
+    [Documentation]    Deletes the test instance created previously
+    [Tags]    delete
+    ${resp}=    Cord DELETE    ${SERVER_IP}    ${CH_CORE_INSTANCES}    ${new_instance_id}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Delete Test Slice
+    [Documentation]    Deletes the test slice created previously
+    [Tags]    delete
+    ${resp}=    Cord DELETE    ${SERVER_IP}    ${CH_CORE_SLICES}    ${new_slice_id}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Delete VTN Test Network
+    [Documentation]    Deletes the test network created previously
+    [Tags]    delete
+    ${resp}=    Cord DELETE    ${SERVER_IP}    ${CH_CORE_NETWORKS}    ${network_id}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Validate New OVS Flow Count
+    [Documentation]    Logs into the compute-node where OVS is running and validates the new flow count (new flow rules for new volt tenant instance)
+    [Tags]    ovsflows
+    Wait Until Keyword Succeeds    60s    5s    Validate Flow Count    42
 
 Validate New Flows Removed From OVS
     [Documentation]    Validates that the flow rules added by ONOS from the network creation has been removed
-    [Tags]    vtnservice
+    [Tags]    ovsflows
     ${ovs_flow_count}=    Execute Command on Compute Node in CIAB    ${SERVER_IP}    ${compute_node_hostname}    ovs-ofctl dump-flows br-int | grep 2.2.2.0 | wc -l
     ${ovs_flow_count}=    Get Line    ${ovs_flow_count}    0
     Should Be Equal As Integers    ${ovs_flow_count}    0
@@ -133,62 +277,96 @@
     ${flows_added}=    Get Lines Containing String    ${flows_added}    cookie=
     Log    ${flows_added}
     ## Validate flow rules arent in the flows table
-    Should Not Contain    ${flows_added}    nw_src=2.2.2.0/24,nw_dst=10.6.1.192/26
-    Should Not Contain    ${flows_added}    nw_src=10.6.1.192/26,nw_dst=2.2.2.0/24
-    Should Not Contain    ${flows_added}    nw_src=2.2.2.0/24,nw_dst=10.6.1.193
+    Should Not Contain    ${flows_added}    nw_src=2.2.2.0/24,nw_dst=2.2.2.0/24
 
 *** Keywords ***
 Suite Setup
     ${auth} =    Create List    ${USER}    ${PASSWD}
-    Create Session    ${SERVER_IP}    http://${SERVER_IP}:${SERVER_PORT}    auth=${AUTH}
+    ${HEADERS}    Create Dictionary    Content-Type=application/json
+    Create Session    ${SERVER_IP}    http://${SERVER_IP}:${SERVER_PORT}    auth=${AUTH}    headers=${HEADERS}
+    Read InputFile
+    ${vsg_service_id}=    Get ID    ${CH_CORE_SERVICES}    name    vsg
+    Set Suite Variable    ${vsg_service_id}
+    ${vsg_network_template_id}=    Get ID    ${CH_CORE_NETWORK_TEMPLATES}    name    vsg
+    Set Suite Variable    ${vsg_network_template_id}
+    ${mgmt_network_id}=    Get ID    ${CH_CORE_NETWORKS}    name    management
+    Set Suite Variable    ${mgmt_network_id}
+    ${vsg_slice_id}=    Get ID    ${CH_CORE_SLICES}    name    mysite_vsg
+    Set Suite Variable    ${vsg_slice_id}
+    ${volt_service_id}=    Get ID    ${CH_CORE_SERVICES}    name    volt
+    Set Suite Variable    ${volt_service_id}
+    ${image_id}=    Get ID    ${CH_CORE_IMAGES}    name    trusty-server-multi-nic
+    Set Suite Variable    ${image_id}
+    ##Get compute node information
+    ${compute_node_hostname}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    cord prov list | grep node | awk '{print $2}'
+    ${compute_node_ip}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    cord prov list | grep node | awk '{print $4}'
+    Set Suite Variable    ${compute_node_hostname}
+    set suite variable    ${compute_node_ip}
 
 Suite Teardown
     Delete All Sessions
     Close All Connections
 
+Read InputFile
+    ${coreServiceList} =    utils.jsonToList    ${CORE_SERVICE_PATHFILE}    ServiceInfo
+    Set Suite Variable    ${cservlist}    ${coreServiceList}
+    ${coreNetworkList} =    utils.jsonToList    ${CORE_NETWORK_PATHFILE}    NetworkInfo
+    Set Suite Variable    ${cnlist}    ${coreNetworkList}
+    ${coreSliceList} =    utils.jsonToList    ${CORE_SLICE_PATHFILE}    SliceInfo
+    Set Suite Variable    ${cslist}    ${coreSliceList}
+    ${coreNetworkSliceList} =    utils.jsonToList    ${CORE_NETWORK_SLICE_PATHFILE}    NetworkSliceInfo
+    Set Suite Variable    ${cnslist}    ${coreNetworkSliceList}
+    ${coreInstanceList} =    utils.jsonToList    ${CORE_INSTANCE_PATHFILE}    InstanceInfo
+    Set Suite Variable    ${cilist}    ${coreInstanceList}
+    ${cordSubscriberList} =    utils.jsonToList    ${CORD_SUBSCRIBER_PATHFILE}    CordSubscriberInfo
+    Set Suite Variable    ${csubList}    ${cordSubscriberList}
+    ${voltTenantList} =    utils.jsonToList    ${VOLT_TENANT_PATHFILE}    VoltTenantInfo
+    Set Suite Variable    ${vtList}    ${voltTenantList}
+
 CORD Get
-    [Documentation]    Make a rest call to the CORD controller
+    [Documentation]    Make a GET call to the CORD controller
     [Arguments]    ${session}    ${service}
     ${resp}=    Get Request    ${session}    ${service}
     Log    ${resp.content}
     [Return]    ${resp}
 
+CORD Post
+    [Documentation]    Make a POST call to the CORD controller
+    [Arguments]    ${session}    ${service}    ${data}
+    ${data}=    Evaluate    json.dumps(${data})    json
+    ${resp}=    Post Request    ${session}    uri=${service}    data=${data}
+    Log    ${resp.content}
+    [Return]    ${resp}
+
+CORD Delete
+    [Documentation]    Make a DELETE call to the CORD controller
+    [Arguments]    ${session}    ${service}    ${id}
+    ${resp}=    Delete Request    ${session}    uri=${service}/${id}
+    Log    ${resp.content}
+    [Return]    ${resp}
+
 Validate Default CIAB Service Networks and Ports via XOS
     [Documentation]    Using XOS API, this validates the default VTN Service Networks + Ports for a CIAB Environment
-    @{expected_types}=    Create List    PUBLIC    PRIVATE    MANAGEMENT_LOCAL    VSG
-    @{expected_owner_slices}=    Create List    mysite_public    mysite_exampleservice    mysite_management    mysite_vsg
     @{expected_network_names}=    Create List    public    management    exampleservice_network    mysite_vsg-access
-    @{types}=    Create List
-    @{ownerSlices}=    Create List
+    @{names}=    Create List
     @{network_names}=    Create List
-    ${resp}=    CORD GET    ${SERVER_IP}    /api/service/vtn/serviceNetworks/
+    ${resp}=    CORD GET    ${SERVER_IP}   ${CH_CORE_NETWORKS}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${jsondata}=    To Json    ${resp.content}
-    ${length}=    Get Length    ${jsondata['serviceNetworks']}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata['items']}
     Should Be Equal As Integers    ${length}    4
     : FOR    ${INDEX}    IN RANGE    0    ${length}
-    \    ${item}=    Get From List    ${jsondata['serviceNetworks']}    ${INDEX}
-    \    ${type}=    Get From Dictionary    ${item}    type
-    \    ${ownerSliceName}=    Get From Dictionary    ${item}    ownerSliceName
-    \    Append To List    ${types}    ${type}
-    \    Append To List    ${ownerSlices}    ${ownerSliceName}
-    : FOR    ${value}    IN    @{expected_types}
-    \    List Should Contain Value    ${types}    ${value}
-    : FOR    ${value}    IN    @{expected_owner_slices}
-    \    List Should Contain Value    ${ownerSlices}    ${value}
-    ${resp}=    CORD GET    ${SERVER_IP}    /api/service/vtn/servicePorts/
+    \    ${item}=    Get From List    ${jsondata['items']}    ${INDEX}
+    \    ${name}=    Get From Dictionary    ${item}    name
+    \    Append To List    ${names}    ${name}
+    : FOR    ${value}    IN    @{expected_network_names}
+    \    List Should Contain Value    ${names}    ${value}
+    ${resp}=    CORD GET    ${SERVER_IP}    ${CH_CORE_PORTS}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${jsondata}=    To Json    ${resp.content}
-    ${length}=    Get Length    ${jsondata['servicePorts']}
+    ${length}=    Get Length    ${jsondata['items']}
     Should Be Equal As Integers    ${length}    5
-    : FOR    ${INDEX}    IN RANGE    0    ${length}
-    \    ${item}=    Get From List    ${jsondata['servicePorts']}    ${INDEX}
-    \    ${network_name}=    Get From Dictionary    ${item}    network_name
-    \    Append To List    ${network_names}    ${network_name}
-    : FOR    ${value}    IN    @{expected_network_names}
-    \    List Should Contain Value    ${network_names}    ${value}
-    ${management_len}=    Count Values in List    ${network_names}    management
-    Should Be Equal As Integers    ${management_len}    2
 
 Validate Default CIAB Service Networks via ONOSCORD
     [Documentation]    Validates the default VTN Service Network via ONOSCORD for a CIAB Environment
@@ -232,3 +410,77 @@
     \    List Should Contain Value    ${network_ids}    ${value}
     ${management_len}=    Count Values in List    ${net_ids}    ${management_network_id}
     Should Be Equal As Integers    ${management_len}    2
+
+Get ID
+    [Documentation]    Retreives the id of any specific component
+    [Arguments]    ${endpoint}    ${item}    ${match}
+    ${resp}=    CORD GET    ${SERVER_IP}   ${endpoint}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${jsondata}=    To Json    ${resp.content}
+    Log    ${jsondata}
+    ${length}=    Get Length    ${jsondata['items']}
+    : FOR    ${INDEX}    IN RANGE    0    ${length}
+    \    ${value}=    Get From List    ${jsondata['items']}    ${INDEX}
+    \    ${name}=    Get From Dictionary    ${value}    ${item}
+    \    ${id}=    Get From Dictionary    ${value}    id
+    \    Run Keyword If    '${name}' == '${match}'    Exit For Loop
+    [Return]    ${id}
+
+Validate Flow Count
+    [Documentation]    Gets the count of the flows pushed to an ovs switch and validates that against expected count
+    [Arguments]    ${count}
+    ${ovs_flow_count}=    Execute Command on Compute Node in CIAB    ${SERVER_IP}    ${compute_node_hostname}    ovs-ofctl dump-flows br-int | wc -l
+    ${ovs_flow_count}=    Get Line    ${ovs_flow_count}    0
+    Should Be Equal As Integers    ${ovs_flow_count}    ${count}
+
+Get Subscriber Root IDs in Use
+    [Documentation]    Retrieves information for current subscribers and "blacklists" their subscriber root ids
+    @{sr_id_blacklist}=    Create List
+    ${resp}=    CORD GET    ${SERVER_IP}    ${VOLT_SUBSCRIBER}
+    ${jsondata}=    To Json    ${resp.content}
+    ${length}=    Get Length    ${jsondata['items']}
+    : FOR    ${INDEX}    IN RANGE    0    ${length}
+    \    ${item}=    Get From List    ${jsondata['items']}    ${INDEX}
+    \    ${id}=    Get From Dictionary    ${item}    service_specific_id
+    \    Append To List    ${sr_id_blacklist}    ${id}
+   [Return]    @{sr_id_blacklist}
+
+Get Tags in Use
+    [Documentation]    Retrieves information for current active volt tenants and "blacklists" their s/c tags
+    @{tag_blacklist}=    Create List
+    ${resp}=    CORD GET    ${SERVER_IP}    ${VOLT_TENANT}
+    ${jsondata}=    To Json    ${resp.content}
+    ${length}=    Get Length    ${jsondata['items']}
+    : FOR    ${INDEX}    IN RANGE    0    ${length}
+    \    ${item}=    Get From List    ${jsondata['items']}    ${INDEX}
+    \    ${s_tag}=    Get From Dictionary    ${item}    s_tag
+    \    ${c_tag}=    Get From Dictionary    ${item}    c_tag
+    \    Append To List    ${tag_blacklist}    ${s_tag}
+    \    Append To List    ${tag_blacklist}    ${c_tag}
+   [Return]    @{tag_blacklist}
+
+Get Openstack Info
+    [Documentation]    Executes a command in the prod vm in a CIAB environment where openstack is running
+    [Arguments]    ${cmd}
+    ${output}=    Execute Command on CIAB Server in Specific VM    ${SERVER_IP}    prod    source admin-openrc.sh; ${cmd}    strip_line=False
+    Log    ${output}
+    [Return]    ${output}
+
+Validate Openstack Network
+    [Documentation]    Validates that a particular network/subnet exists
+    [Arguments]    ${network_name}    ${subnet}
+    ${netlist}=    Get Openstack Info    neutron net-list
+    Log    ${netlist}
+    ${NET_DICT}=    openstackUtils.Get Neutron Lists    ${netlist}
+    Log    ${NET_DICT}
+    ${test-net}=    Get From Dictionary    ${NET_DICT}    ${network_name}
+    Should Contain    ${test-net}    ${subnet}
+
+Validate Openstack Nova Instance
+    [Documentation]    Validates that a particular nova instance/tenant exists
+    [Arguments]    ${instance_name}    ${network}    ${destroyed}=False
+    ${novalist}=    Get Openstack Info    nova list --all-tenants
+    Log    ${novalist}
+    ${NOVA_DICT}=    openstackUtils.Get Nova Lists    ${novalist}    ${instance_name}
+    Log    ${NOVA_DICT}
+    Should Contain    ${NOVA_DICT}    ${network}
\ No newline at end of file
diff --git a/src/test/cord-api/Tests/data/CordSubscriber.json b/src/test/cord-api/Tests/data/CordSubscriber.json
new file mode 100644
index 0000000..9250025
--- /dev/null
+++ b/src/test/cord-api/Tests/data/CordSubscriber.json
@@ -0,0 +1,19 @@
+{
+    "CordSubscriberInfo": [
+        {
+            "backend_status": "0 - Provisioning in progress",
+            "kind": "CordSubscriberRoot",
+            "name": "Test-House-1",
+            "service_specific_id": "1",
+            "firewall_rules": "accept all anywhere anywhere",
+            "url_filter_rules": "allow all",
+            "url_filter_level": "R",
+            "cdn_enable": false,
+            "is_demo_user": false,
+            "uplink_speed": "1000000011",
+            "downlink_speed": "1000000011",
+            "enable_uverse": true,
+            "status": "enabled"
+        }
+    ]
+}
diff --git a/src/test/cord-api/Tests/data/CordVoltTenant.json b/src/test/cord-api/Tests/data/CordVoltTenant.json
new file mode 100644
index 0000000..e4f1f9e
--- /dev/null
+++ b/src/test/cord-api/Tests/data/CordVoltTenant.json
@@ -0,0 +1,14 @@
+{
+    "VoltTenantInfo": [
+        {
+            "backend_status": "0 - Provisioning in progress",
+            "kind": "vOLT",
+            "subscriber_root_id": 1,
+            "connect_method": "na",
+            "provider_service_id": 1,
+            "creator_id": 1,
+            "s_tag": 1,
+            "c_tag": 1
+        }
+    ]
+}
diff --git a/src/test/cord-api/Tests/data/CoreInstance.json b/src/test/cord-api/Tests/data/CoreInstance.json
new file mode 100644
index 0000000..5212868
--- /dev/null
+++ b/src/test/cord-api/Tests/data/CoreInstance.json
@@ -0,0 +1,19 @@
+{
+        "InstanceInfo": [
+                {
+                        "backend_status": "1 - OK",
+                        "name": "mysite_testservice",
+                        "instance_name": "mysite_testservice-1",
+                        "ip": "10.1.0.17",
+                        "numberCores": 0,
+                        "isolation": "vm",
+                        "volumes": "/etc/dnsmasq.d,/etc/ufw",
+                        "image_id": 3,
+                        "creator_id": 1,
+                        "deployment_id": 1,
+                        "slice_id": 1,
+                        "node_id": 1,
+                        "flavor_id": 1
+                }
+        ]
+}
\ No newline at end of file
diff --git a/src/test/cord-api/Tests/data/CoreNetwork.json b/src/test/cord-api/Tests/data/CoreNetwork.json
new file mode 100644
index 0000000..e4da1c7
--- /dev/null
+++ b/src/test/cord-api/Tests/data/CoreNetwork.json
@@ -0,0 +1,16 @@
+{
+    "NetworkInfo": [
+        {
+            "backend_status": "0 - Provisioning in progress",
+            "name": "test-network",
+            "template_id": 1,
+            "owner_id": 1,
+            "guaranteed_bandwidth": 0,
+            "permit_all_slices": true,
+            "autoconnect": false,
+            "subnet": "2.2.2.0/24",
+            "start_ip": "2.2.2.2",
+            "end_ip": "2.2.2.254"
+        }
+    ]
+}
diff --git a/src/test/cord-api/Tests/data/CoreNetworkSlice.json b/src/test/cord-api/Tests/data/CoreNetworkSlice.json
new file mode 100644
index 0000000..48ab049
--- /dev/null
+++ b/src/test/cord-api/Tests/data/CoreNetworkSlice.json
@@ -0,0 +1,14 @@
+{
+    "NetworkSliceInfo": [
+        {
+            "backend_status": "0 - Provisioning in progress",
+            "network_id": 1,
+            "slice_id": 1
+        },
+        {
+            "backend_status": "0 - Provisioning in progress",
+            "network_id": 2,
+            "slice_id": 2
+        }
+    ]
+}
diff --git a/src/test/cord-api/Tests/data/CoreSlice.json b/src/test/cord-api/Tests/data/CoreSlice.json
new file mode 100644
index 0000000..0b20447
--- /dev/null
+++ b/src/test/cord-api/Tests/data/CoreSlice.json
@@ -0,0 +1,16 @@
+{
+    "SliceInfo": [
+        {
+            "backend_status": "0 - Provisioning in progress",
+            "name": "mysite_test-1",
+            "site_id": 1,
+            "max_instances": 10,
+            "service_id": 1,
+            "network": "noauto",
+            "creator_id": 1,
+            "default_image_id": 1,
+            "mount_data_sets": "Genbank",
+            "default_isolation": "vm"
+        }
+    ]
+}