Add mandatory configuration 59/70359/6
authorTomas Markovic <tomas.markovic@pantheon.tech>
Thu, 5 Apr 2018 06:44:17 +0000 (08:44 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 10 Apr 2018 21:18:01 +0000 (21:18 +0000)
Result of: BGPCEP-743
On Fluorine we have to add default policies
when reconfiguring example-bgp-rib, which does
contain in fluorine config located in
odl-bgpcep-bgp-config-example feature.

Change-Id: I9df5ab2ed8fc0fe8c706b9c5e9111672a0c6439e
Signed-off-by: Tomas Markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot
csit/variables/bgpfunctional/multipaths/rib.boron/data.xml [deleted file]
csit/variables/bgpfunctional/multipaths/rib.boron/location.uri [deleted file]
csit/variables/bgpfunctional/multipaths/rib_policies/data.xml [new file with mode: 0644]
csit/variables/bgpfunctional/multipaths/rib_policies/location.uri [new file with mode: 0644]

index d67f5fc43dbf5866958697e36afb2bc214f64a6a..114fecc9fd73ec22ef97c9ab89575dba6522b3d1 100644 (file)
@@ -15,7 +15,7 @@ Suite Teardown    Stop_Suite
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Library           RequestsLibrary
 Library           SSHLibrary
-Variables         ${CURDIR}/../../../variables/Variables.py
+Resource          ${CURDIR}/../../../variables/Variables.robot
 Resource          ${CURDIR}/../../../libraries/ExaBgpLib.robot
 Resource          ${CURDIR}/../../../libraries/Utils.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
@@ -23,6 +23,7 @@ Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Library           ${CURDIR}/../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
 Resource          ${CURDIR}/../../../libraries/BGPcliKeywords.robot
 Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource          ${CURDIR}/../../../libraries/CompareStream.robot
 
 *** Variables ***
 ${HOLDTIME}       180
@@ -147,7 +148,8 @@ Configure_Odl_Peer_With_Path_Selection_Mode
     ${npaths}=    BuiltIn.Set_Variable_If    "${psm}"=="${ALLPATHS_SELM}"    0    ${N_PATHS_VALUE}
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    HOLDTIME=${HOLDTIME}    PEER_PORT=${BGP_TOOL_PORT}    PASSIVE_MODE=true    MULTIPATH=${npaths}
     ...    BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
-    TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/rib    mapping=${mapping}    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_Less_Than_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/rib    mapping=${mapping}    session=${CONFIG_SESSION}
+    CompareStream.Run_Keyword_If_At_Least_Fluorine    TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/rib_policies    mapping=${mapping}    session=${CONFIG_SESSION}
     TemplatedRequests.Put_As_Xml_Templated    ${MULT_VAR_FOLDER}/bgp_peer    mapping=${mapping}    session=${CONFIG_SESSION}
 
 Configure_Odl_With_Multipaths
diff --git a/csit/variables/bgpfunctional/multipaths/rib.boron/data.xml b/csit/variables/bgpfunctional/multipaths/rib.boron/data.xml
deleted file mode 100644 (file)
index ccc0850..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-   <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-impl</type>
-   <name>example-bgp-rib</name>
-   <local-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">64496</local-as>
-   <dom-data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>pingpong-broker</name>
-      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
-   </dom-data-provider>
-   <bgp-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">192.0.2.2</bgp-rib-id>
-   <bgp-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>global-bgp-dispatcher</name>
-      <type>bgp-dispatcher</type>
-   </bgp-dispatcher>
-   <data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>pingpong-binding-data-broker</name>
-      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-async-data-broker</type>
-   </data-provider>
-   <!--openconfig-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>openconfig-bgp</name>
-      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp-openconfig-spi">x:bgp-openconfig-provider</type>
-   </openconfig-provider-->
-   <extensions xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>global-rib-extensions</name>
-      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:spi">x:extensions</type>
-   </extensions>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv4-unicast</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv6-unicast</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>linkstate</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv4-flowspec</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv6-flowspec</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv4-flowspec-l3vpn</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv6-flowspec-l3vpn</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv4-labeled-unicast</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv6-labeled-unicast</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv4-l3vpn</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv6-l3vpn</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <local-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>evpn</name>
-      <type>bgp-table-type</type>
-   </local-table>
-   <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-bgp-rib</rib-id>
-   <codec-tree-factory xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>runtime-mapping-singleton</name>
-      <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">x:binding-codec-tree-factory</type>
-   </codec-tree-factory>
-   <rib-path-selection-mode xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
-      <name>ipv4-unicast-path-selection-mode</name>
-      <type>bgp-path-selection-mode</type>
-   </rib-path-selection-mode>
-</module>
diff --git a/csit/variables/bgpfunctional/multipaths/rib.boron/location.uri b/csit/variables/bgpfunctional/multipaths/rib.boron/location.uri
deleted file mode 100644 (file)
index 2f612b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:rib-impl/example-bgp-rib
diff --git a/csit/variables/bgpfunctional/multipaths/rib_policies/data.xml b/csit/variables/bgpfunctional/multipaths/rib_policies/data.xml
new file mode 100644 (file)
index 0000000..20e528e
--- /dev/null
@@ -0,0 +1,27 @@
+<protocol xmlns="http://openconfig.net/yang/network-instance">
+    <name>example-bgp-rib</name>
+    <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
+    <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+        <global>
+            <config>
+                <router-id>192.0.2.2</router-id>
+                <as>64496</as>
+            </config>
+            <apply-policy>
+                <config>
+                    <default-export-policy>REJECT-ROUTE</default-export-policy>
+                    <default-import-policy>REJECT-ROUTE</default-import-policy>
+                    <import-policy>default-odl-import-policy</import-policy>
+                    <export-policy>default-odl-export-policy</export-policy>
+                </config>
+            </apply-policy>
+            <afi-safis>
+                <afi-safi>
+                    <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
+                    <receive>true</receive>
+                    <send-max>$MULTIPATH</send-max>
+                </afi-safi>
+            </afi-safis>
+        </global>
+    </bgp>
+</protocol>
diff --git a/csit/variables/bgpfunctional/multipaths/rib_policies/location.uri b/csit/variables/bgpfunctional/multipaths/rib_policies/location.uri
new file mode 100644 (file)
index 0000000..e44e670
--- /dev/null
@@ -0,0 +1 @@
+/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/example-bgp-rib