adding path-id into the route template 90/40590/5
authorPeter Gubka <pgubka@cisco.com>
Tue, 21 Jun 2016 09:41:01 +0000 (11:41 +0200)
committerVratko Polák <vrpolak@cisco.com>
Wed, 22 Jun 2016 10:59:00 +0000 (10:59 +0000)
Change-Id: I733e19070c00d29d9bc12badb34e1e4d50eace60
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/suites/bgpcep/bgpingest/bgp_app_peer_prefixcount.robot
csit/suites/bgpcep/bgpuser/bgp_app_peer_basic.robot
tools/fastbgp/bgp_app_peer.py
tools/fastbgp/ipv4-routes-template.xml
tools/fastbgp/ipv4-routes-template.xml.beryllium [new file with mode: 0755]
tools/fastbgp/ipv4-routes-template.xml.stable-lithium [new file with mode: 0755]

index b6a8e90394b8252d6f1e3bd18228f3803fe91ab7..fdb26f53616eeb0c98f62fb6950b3b0d1ad7329c 100644 (file)
@@ -58,10 +58,10 @@ ${CONTROLLER_BGP_LOG_LEVEL}    DEFAULT
 ${BGP_PEER_COMMAND}    python play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
 ${BGP_PEER_OPTIONS}    &>bgp_peer.log
 ${BGP_APP_PEER_ID}    10.0.0.10
-${BGP_APP_PEER_INITIAL_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_PUT_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_DELETE_ALL_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_GET_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL}
+${BGP_APP_PEER_INITIAL_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_PUT_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count ${PREFILL} --prefix 8.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_DELETE_ALL_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_GET_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
 ${BGP_APP_PEER_OPTIONS}    &>bgp_app_peer.log
 ${TEST_DURATION_MULTIPLIER}    30
 ${last_prefix_count}    -1
@@ -106,7 +106,7 @@ Check_Bgp_Peer_Updates_For_Prefilled_Routes
 BGP_Application_Peer_Introduce_Single_Routes
     [Documentation]    Start BGP application peer tool and introduce routes.
     SSHLibrary.Switch Connection    bgp_app_peer_console
-    Start_Console_Tool    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command add --count ${remaining_prefixes} --prefix 12.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}    ${BGP_APP_PEER_OPTIONS}
+    Start_Console_Tool    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command add --count ${remaining_prefixes} --prefix 12.0.0.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}    ${BGP_APP_PEER_OPTIONS} --stream=${ODL_STREAM}
     Wait_Until_Console_Tool_Finish    ${bgp_filling_timeout}
     Store_File_To_Workspace    bgp_app_peer.log    bgp_app_peer_singles.log
 
index 4240743e9832d24b64cee79393ed86c7e4b73009..291462b63bcde7c89b5d337e633dc719e39ed9ab 100644 (file)
@@ -81,11 +81,11 @@ ${CONTROLLER_BGP_LOG_LEVEL}    DEFAULT
 ${BGP_PEER_COMMAND}    python play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
 ${BGP_PEER_OPTIONS}    ${EMPTY}
 ${BGP_APP_PEER_ID}    10.0.0.10
-${BGP_APP_PEER_POST_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_PUT_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_DELETE_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_DELETE_ALL_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL}
-${BGP_APP_PEER_GET_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL}
+${BGP_APP_PEER_POST_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_PUT_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_DELETE_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_DELETE_ALL_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete-all --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
+${BGP_APP_PEER_GET_COMMAND}    python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
 ${BGP_APP_PEER_OPTIONS}    &>/dev/null
 ${BGP_APP_PEER_TIMEOUT}    30s
 
@@ -311,7 +311,7 @@ Setup_Everything
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/play.py
     Open_BGP_Aplicationp_Peer_Console
     SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/bgp_app_peer.py
-    SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/ipv4-routes-template.xml
+    SSHLibrary.Put_File    ${CURDIR}/../../../../tools/fastbgp/ipv4-routes-template.xml*
     OperatingSystem.Remove_Directory    ${EXPECTED_RESPONSES_FOLDER}    recursive=True
     OperatingSystem.Remove_Directory    ${ACTUAL_RESPONSES_FOLDER}    recursive=True
     # The previous suite may have been using the same directories.
index a068beee5bc0f7cee07d7df785f66585e56684c5..4c7488e1bfac3aa42420759abaf859a3cc013205 100755 (executable)
@@ -314,14 +314,15 @@ def delete_prefixes(odl_ip, port, uri, auth, prefix_base, prefix_len, count,
     """
     logger.info("Delete %s prefix(es) (starting from %s/%s) from %s:%s/restconf/%s",
                 count, prefix_base, prefix_len, odl_ip, port, uri)
+    partkey = "" if args.stream in ["stable-lithium", "beryllium"] else "/0"
     uri_del_prefix = uri + _uri_suffix_ipv4_routes + _uri_suffix_ipv4_route
     prefix_gap = 2 ** (32 - prefix_len)
     for prefix_index in range(count):
         prefix = prefix_base + prefix_index * prefix_gap
-        logger.info("Deleting prefix %s/%s from %s:%s/restconf/%s",
-                    prefix, prefix_len, odl_ip, port, uri)
+        logger.info("Deleting prefix %s/%s/%s from %s:%s/restconf/%s",
+                    prefix, prefix_len, partkey, odl_ip, port, uri)
         send_request("DELETE", odl_ip, port,
-                     uri_del_prefix + str(prefix) + "%2F" + str(prefix_len), auth)
+                     uri_del_prefix + str(prefix) + "%2F" + str(prefix_len) + partkey, auth)
 
 
 def delete_all_prefixes(odl_ip, port, uri, auth, prefix_base=None,
@@ -393,6 +394,7 @@ if __name__ == "__main__":
                         const=logging.DEBUG, default=logging.INFO,
                         help="Set log level to debug (default is info)")
     parser.add_argument("--logfile", default="bgp_app_peer.log", help="Log file name")
+    parser.add_argument("--stream", default="", help="Stream - beryllium, boron ...")
 
     args = parser.parse_args()
 
@@ -416,7 +418,7 @@ if __name__ == "__main__":
     count = args.count
     auth = (args.user, args.password)
     uri = args.uri
-    xml_template = args.xml
+    xml_template = "{}.{}".format(args.xml, args.stream) if args.stream in ["stable-lithium", "beryllium"] else args.xml
 
     test_start_time = time.time()
     total_build_data_time_counter = 0
index 636e6d938330441281be926a9a6f27b368dfab56..ac44b3bbd706b0ee8919b37560e34bd7afcfabe9 100755 (executable)
@@ -1,6 +1,7 @@
 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
  <ipv4-route>
   <prefix>0.0.0.0/32</prefix>
+  <path-id>0</path-id>
   <attributes>
    <ipv4-next-hop>
     <global>192.0.2.1</global>
diff --git a/tools/fastbgp/ipv4-routes-template.xml.beryllium b/tools/fastbgp/ipv4-routes-template.xml.beryllium
new file mode 100755 (executable)
index 0000000..636e6d9
--- /dev/null
@@ -0,0 +1,25 @@
+<ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
+ <ipv4-route>
+  <prefix>0.0.0.0/32</prefix>
+  <attributes>
+   <ipv4-next-hop>
+    <global>192.0.2.1</global>
+   </ipv4-next-hop><as-path/>
+   <multi-exit-disc>
+    <med>0</med>
+   </multi-exit-disc>
+   <local-pref>
+    <pref>100</pref>
+   </local-pref>
+   <originator-id>
+    <originator>41.41.41.41</originator>
+   </originator-id>
+   <origin>
+    <value>igp</value>
+   </origin>
+   <cluster-id>
+    <cluster>40.40.40.40</cluster>
+   </cluster-id>
+  </attributes>
+ </ipv4-route>
+</ipv4-routes>
diff --git a/tools/fastbgp/ipv4-routes-template.xml.stable-lithium b/tools/fastbgp/ipv4-routes-template.xml.stable-lithium
new file mode 100755 (executable)
index 0000000..636e6d9
--- /dev/null
@@ -0,0 +1,25 @@
+<ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
+ <ipv4-route>
+  <prefix>0.0.0.0/32</prefix>
+  <attributes>
+   <ipv4-next-hop>
+    <global>192.0.2.1</global>
+   </ipv4-next-hop><as-path/>
+   <multi-exit-disc>
+    <med>0</med>
+   </multi-exit-disc>
+   <local-pref>
+    <pref>100</pref>
+   </local-pref>
+   <originator-id>
+    <originator>41.41.41.41</originator>
+   </originator-id>
+   <origin>
+    <value>igp</value>
+   </origin>
+   <cluster-id>
+    <cluster>40.40.40.40</cluster>
+   </cluster-id>
+  </attributes>
+ </ipv4-route>
+</ipv4-routes>