Basic tests - Unification termination point inside 38/29938/12
authorAndrej Záň <andrej.zan@pantheon.sk>
Thu, 19 Nov 2015 19:04:00 +0000 (20:04 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 21 Dec 2015 15:46:50 +0000 (15:46 +0000)
Change-Id: I1755f43b4cad5851d68f80f5500aac364390d1c3
Signed-off-by: Andrej Záň <andrej.zan@pantheon.sk>
Signed-off-by: Samuel Kontriš <samuel.kontris@pantheon.sk>
csit/libraries/TopoprocessingKeywords.robot
csit/suites/topoprocessing/basic-topology-operations/010_Aggregation.robot
csit/variables/topoprocessing/Topologies.py

index a52e478dcc52f9c87092d4d9344daec34aa18084..ee6cd3bd61425d0e39382851253481d82567c06c 100644 (file)
@@ -39,7 +39,7 @@ Setup Environment
     ${features}    Get Installed Features
     ${lines}    Get Lines Containing String    ${features}    odl-topoprocessing-framework
     ${length}    Get Length    ${lines}
-    Install a Feature    odl-openflowplugin-nsf-model-li odl-topoprocessing-framework odl-topoprocessing-network-topology odl-topoprocessing-inventory odl-bgpcep-pcep-all    timeout=100
+    Install a Feature    odl-openflowplugin-nsf-model-li odl-topoprocessing-framework odl-topoprocessing-network-topology odl-topoprocessing-inventory odl-bgpcep-pcep-all odl-ovsdb-southbound-impl    timeout=100
     Run Keyword If    ${length} == 0    Wait For Karaf Log    Registering Topology Request Listener    60
     Prepare New Feature Installation
     Insert Underlay topologies
index aebcc2c74b112fe6c1fac07b78406e6375e51daf..62d6f3c72135a75c500b550b5eee901bfa11393f 100644 (file)
@@ -48,7 +48,6 @@ Unification Node Inventory
     ${node}    Element to String    ${node}
     Should Contain X Times    ${node}    <node-ref>of-node:10</node-ref>    1
     Should Contain X Times    ${node}    <node-ref>of-node:4</node-ref>    1
-
 Unification Scripting Node
     [Documentation]    Test unification operation on Network Topology model using scripting
     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    network-topology-model    node    network-topology-pcep:path-computation-client/network-topology-pcep:ip-address    network-topo:1
@@ -104,3 +103,50 @@ Unification Node Inside Inventory
     Should Contain X Times    ${node}    <supporting-node>    2
     Should Contain    ${node}    <supporting-node><node-ref>of-node:7</node-ref>
     Should Contain    ${node}    <supporting-node><node-ref>of-node:9</node-ref>
+
+Unification Termination Point Inside
+    [Documentation]    Test aggregate inside operation on termination points
+    ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    network-topology-model    termination-point    ovsdb:ofport    network-topo:1
+    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
+    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    ${response_xml}    Get Element    ${resp.content}    xpath=.//topology[topology-id='topo:1']
+    ${response_xml}    Element to String    ${response_xml}
+    Should Contain X Times    ${resp.content}    <node-id>node:    5
+    Should Contain X Times    ${response_xml}    <termination-point>    6
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='pcep:1']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    2
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='pcep:3']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    2
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='pcep:4']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    1
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='pcep:5']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    1
+
+Unification Termination Point Inside Inventory
+    [Documentation]    Test aggregate inside operation on termination points
+    ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    opendaylight-inventory-model    termination-point    flow-node-inventory:port-number    openflow-topo:1
+    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
+    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    ${response_xml}    Get Element    ${resp.content}    xpath=.//topology[topology-id='topo:1']
+    ${response_xml}    Element to String    ${response_xml}
+    Should Contain X Times    ${resp.content}    <node-id>node:    5
+    Should Contain X Times    ${response_xml}    <termination-point>    7
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:1']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    1
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:2']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    2
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:3']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    2
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:4']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    1
+    ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:5']/..
+    ${node}    Element to String    ${node}
+    Should Contain X Times    ${node}    <termination-point>    1
\ No newline at end of file
index 0a1b7183b62007c637ec7db74b8205991eeed26b..13c77968446a980beb854c60c5d4153a418b03fe 100644 (file)
@@ -1,6 +1,7 @@
 NETWORK_UNDERLAY_TOPOLOGY_1 = '''<topology
                                 xmlns="urn:TBD:params:xml:ns:yang:network-topology"
-                                xmlns:pcep="urn:opendaylight:params:xml:ns:yang:topology:pcep">
+                                xmlns:pcep="urn:opendaylight:params:xml:ns:yang:topology:pcep"
+                                xmlns:ovsdb="urn:opendaylight:params:xml:ns:yang:ovsdb">
                             <topology-id>network-topo:1</topology-id>
                             <topology-types>
                                 <pcep:topology-pcep></pcep:topology-pcep>
@@ -10,6 +11,18 @@ NETWORK_UNDERLAY_TOPOLOGY_1 = '''<topology
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.1.1</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:1:1</tp-id>
+                                    <ovsdb:ofport>1119</ovsdb:ofport>
+                                </termination-point>
+                                <termination-point>
+                                    <tp-id>tp:1:2</tp-id>
+                                    <ovsdb:ofport>1119</ovsdb:ofport>
+                                </termination-point>
+                                <termination-point>
+                                    <tp-id>tp:1:3</tp-id>
+                                    <ovsdb:ofport>2119</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:2</node-id>
@@ -22,24 +35,45 @@ NETWORK_UNDERLAY_TOPOLOGY_1 = '''<topology
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.2.1</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:3:1</tp-id>
+                                    <ovsdb:ofport>1118</ovsdb:ofport>
+                                </termination-point>
+                                <termination-point>
+                                    <tp-id>tp:3:2</tp-id>
+                                    <ovsdb:ofport>2118</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:4</node-id>
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.2.1</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:4:1</tp-id>
+                                    <ovsdb:ofport>1117</ovsdb:ofport>
+                                </termination-point>
+                                <termination-point>
+                                    <tp-id>tp:4:2</tp-id>
+                                    <ovsdb:ofport>1117</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:5</node-id>
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.2.3</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:5:1</tp-id>
+                                    <ovsdb:ofport>1116</ovsdb:ofport>
+                                </termination-point>
                             </node>
                         </topology>'''
 
 NETWORK_UNDERLAY_TOPOLOGY_2 = '''<topology
                                 xmlns="urn:TBD:params:xml:ns:yang:network-topology"
-                                xmlns:pcep="urn:opendaylight:params:xml:ns:yang:topology:pcep">
+                                xmlns:pcep="urn:opendaylight:params:xml:ns:yang:topology:pcep"
+                                xmlns:ovsdb="urn:opendaylight:params:xml:ns:yang:ovsdb">
                             <topology-id>network-topo:2</topology-id>
                             <topology-types>
                                 <pcep:topology-pcep></pcep:topology-pcep>
@@ -49,30 +83,50 @@ NETWORK_UNDERLAY_TOPOLOGY_2 = '''<topology
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.1.3</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:6:1</tp-id>
+                                    <ovsdb:ofport>1116</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:7</node-id>
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.1.4</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:7:1</tp-id>
+                                    <ovsdb:ofport>1117</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:8</node-id>
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.2.4</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:8:1</tp-id>
+                                    <ovsdb:ofport>11120</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:9</node-id>
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.2.5</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:9:1</tp-id>
+                                    <ovsdb:ofport>1121</ovsdb:ofport>
+                                </termination-point>
                             </node>
                             <node>
                                 <node-id>pcep:10</node-id>
                                 <pcep:path-computation-client>
                                     <pcep:ip-address>192.168.2.3</pcep:ip-address>
                                 </pcep:path-computation-client>
+                                <termination-point>
+                                    <tp-id>tp:10:1</tp-id>
+                                    <ovsdb:ofport>1122</ovsdb:ofport>
+                                </termination-point>
                             </node>
                         </topology>'''
 
@@ -82,26 +136,70 @@ OPENFLOW_UNDERLAY_NODES = '''
     xmlns:flov-inv="urn:opendaylight:flow:inventory">
     <node>
         <id>openflow:1</id>
+        <node-connector>
+            <id>openflow:1:1</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
+        <node-connector>
+            <id>openflow:1:2</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
         <flov-inv:manufacturer>Pantheon Technologies</flov-inv:manufacturer>
         <flov-inv:ip-address>192.168.1.1</flov-inv:ip-address>
     </node>
     <node>
         <id>openflow:2</id>
+        <node-connector>
+            <id>openflow:2:1</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
+        <node-connector>
+            <id>openflow:2:2</id>
+            <flov-inv:port-number>2</flov-inv:port-number>
+        </node-connector>
         <flov-inv:manufacturer>Pantheon Technologies</flov-inv:manufacturer>
         <flov-inv:ip-address>192.168.1.2</flov-inv:ip-address>
     </node>
     <node>
         <id>openflow:3</id>
+        <node-connector>
+            <id>openflow:3:1</id>
+            <flov-inv:port-number>2</flov-inv:port-number>
+        </node-connector>
+        <node-connector>
+            <id>openflow:3:2</id>
+            <flov-inv:port-number>2</flov-inv:port-number>
+        </node-connector>
+        <node-connector>
+            <id>openflow:3:3</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
         <flov-inv:manufacturer>Pantheon Technologies</flov-inv:manufacturer>
         <flov-inv:ip-address>192.168.1.3</flov-inv:ip-address>
     </node>
     <node>
         <id>openflow:4</id>
+        <node-connector>
+            <id>openflow:4:1</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
+        <node-connector>
+            <id>openflow:4:2</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
+        <node-connector>
+            <id>openflow:4:3</id>
+            <flov-inv:port-number>1</flov-inv:port-number>
+        </node-connector>
         <flov-inv:manufacturer>Cisco</flov-inv:manufacturer>
         <flov-inv:ip-address>192.168.2.1</flov-inv:ip-address>
     </node>
     <node>
         <id>openflow:5</id>
+        <node-connector>
+            <id>openflow:5:1</id>
+            <flov-inv:port-number>3</flov-inv:port-number>
+        </node-connector>
         <flov-inv:manufacturer>Cisco</flov-inv:manufacturer>
         <flov-inv:ip-address>192.168.2.2</flov-inv:ip-address>
     </node>
@@ -142,22 +240,88 @@ OPENFLOW_UNDERLAY_TOPOLOGY_1 = '''
     <node>
         <node-id>of-node:1</node-id>
         <inventory-topo:inventory-node-ref>/inventory:nodes/inventory:node[inventory:id="openflow:1"]</inventory-topo:inventory-node-ref>
+        <termination-point>
+            <tp-id>tp:1:1</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:1"]/inventory:node-connector[inventory:id="openflow:1:1"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
+        <termination-point>
+            <tp-id>tp:1:2</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:1"]/inventory:node-connector[inventory:id="openflow:1:2"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
     </node>
     <node>
         <node-id>of-node:2</node-id>
         <inventory-topo:inventory-node-ref>/inventory:nodes/inventory:node[inventory:id="openflow:2"]</inventory-topo:inventory-node-ref>
+        <termination-point>
+            <tp-id>tp:2:1</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:2"]/inventory:node-connector[inventory:id="openflow:2:1"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
+        <termination-point>
+            <tp-id>tp:2:2</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:2"]/inventory:node-connector[inventory:id="openflow:2:2"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
     </node>
     <node>
         <node-id>of-node:3</node-id>
         <inventory-topo:inventory-node-ref>/inventory:nodes/inventory:node[inventory:id="openflow:3"]</inventory-topo:inventory-node-ref>
+        <termination-point>
+            <tp-id>tp:3:1</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:3"]/inventory:node-connector[inventory:id="openflow:3:1"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
+        <termination-point>
+            <tp-id>tp:3:2</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:3"]/inventory:node-connector[inventory:id="openflow:3:2"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
+        <termination-point>
+            <tp-id>tp:3:3</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:3"]/inventory:node-connector[inventory:id="openflow:3:3"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
     </node>
     <node>
         <node-id>of-node:4</node-id>
         <inventory-topo:inventory-node-ref>/inventory:nodes/inventory:node[inventory:id="openflow:4"]</inventory-topo:inventory-node-ref>
+        <termination-point>
+            <tp-id>tp:4:1</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:4"]/inventory:node-connector[inventory:id="openflow:4:1"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
+        <termination-point>
+            <tp-id>tp:4:2</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:4"]/inventory:node-connector[inventory:id="openflow:4:2"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
+        <termination-point>
+            <tp-id>tp:4:3</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:4"]/inventory:node-connector[inventory:id="openflow:4:3"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
     </node>
     <node>
         <node-id>of-node:5</node-id>
         <inventory-topo:inventory-node-ref>/inventory:nodes/inventory:node[inventory:id="openflow:5"]</inventory-topo:inventory-node-ref>
+        <termination-point>
+            <tp-id>tp:5:1</tp-id>
+            <inventory-topo:inventory-node-connector-ref>
+                /inventory:nodes/inventory:node[inventory:id="openflow:5"]/inventory:node-connector[inventory:id="openflow:5:1"]
+            </inventory-topo:inventory-node-connector-ref>
+        </termination-point>
     </node>
 </topology>
 '''