updating flowspec suite to accept path-id 0 in json response 20/38620/1
authorPeter Gubka <pgubka@cisco.com>
Tue, 10 May 2016 09:48:00 +0000 (11:48 +0200)
committerPeter Gubka <pgubka@cisco.com>
Tue, 10 May 2016 09:48:00 +0000 (11:48 +0200)
suite must defferentiate between boron and beryllium because
the beryllium one miss this field

Change-Id: If26cd1b9a6b0bc5ca39ee1b7800006056d93e220
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot
csit/variables/bgpflowspec/bgp-flowspec-redirect.json
csit/variables/bgpflowspec/bgp-flowspec-redirect.json.beryllium [new file with mode: 0644]
csit/variables/bgpflowspec/bgp-flowspec.json
csit/variables/bgpflowspec/bgp-flowspec.json.beryllium [new file with mode: 0644]

index 36c3c910b519d3aee8480d5436dee205d5cbf4ef..70f804f17f53bdd036c2fd8f120fca2f165ac1df 100644 (file)
@@ -116,7 +116,7 @@ Verify Flowspec Data
     [Arguments]    ${exprspfile}
     [Documentation]    Verify expected response
     ${keys_with_bits}=    BuiltIn.Create_List    op
-    ${expected_rsp}=    OperatingSystem.Get File    ${CURDIR}/../../../variables/bgpflowspec/${exprspfile}
+    ${expected_rsp}=    Get Expected Response From File    ${exprspfile}
     ${expected_json}=    norm_json.Normalize Json Text    ${expected_rsp}    keys_with_bits=${keys_with_bits}
     ${rsp}=    RequestsLibrary.Get Request    session    ${FLOWSPEC_URL}
     BuiltIn.Log    ${rsp.content}
@@ -124,3 +124,11 @@ Verify Flowspec Data
     BuiltIn.Log    ${received_json}
     BuiltIn.Log    ${expected_json}
     BuiltIn.Should Be Equal    ${received_json}    ${expected_json}
+
+Get Expected Response From File
+    [Arguments]    ${exprspfile}
+    [Documentation]    Looks for release specific response first, then take default.
+    ${status}    ${expresponse}=    BuiltIn.Run_Keyword_And_Ignore_Error    OperatingSystem.Get File    ${CURDIR}/../../../variables/bgpflowspec/${exprspfile}.${ODL_STREAM}
+    Return From Keyword If    '${status}' == 'PASS'    ${expresponse}
+    ${expresponse}=    OperatingSystem.Get File    ${CURDIR}/../../../variables/bgpflowspec/${exprspfile}
+    [Return]    ${expresponse}
index a98b15e302e9c05a13f0efc6c732cfa12f92baf5..200403fa17616b47b77e1e5318430a71b5e6b880 100644 (file)
@@ -2,6 +2,7 @@
     "bgp-flowspec:flowspec-routes": {
         "flowspec-route": [
             {
+                "path-id": 0,
                 "route-key": "all packets to 192.168.0.2/32 AND from 10.0.0.2/32",
                 "attributes": {
                     "extended-communities": [
@@ -34,6 +35,7 @@
                 ]
             },
             {
+                "path-id": 0,
                 "route-key": "all packets to 192.168.0.1/32 AND from 10.0.0.1/32",
                 "attributes": {
                     "extended-communities": [
@@ -63,6 +65,7 @@
                 ]
             },
             {
+                "path-id": 0,
                 "route-key": "all packets to 192.168.0.4/32 AND from 10.0.0.4/32",
                 "attributes": {
                     "extended-communities": [
diff --git a/csit/variables/bgpflowspec/bgp-flowspec-redirect.json.beryllium b/csit/variables/bgpflowspec/bgp-flowspec-redirect.json.beryllium
new file mode 100644 (file)
index 0000000..a98b15e
--- /dev/null
@@ -0,0 +1,99 @@
+{
+    "bgp-flowspec:flowspec-routes": {
+        "flowspec-route": [
+            {
+                "route-key": "all packets to 192.168.0.2/32 AND from 10.0.0.2/32",
+                "attributes": {
+                    "extended-communities": [
+                        {
+                            "transitive": true,
+                            "redirect-ip-nh-extended-community": {
+                                "next-hop-address": "0.0.0.0",
+                                "copy": false
+                            }
+                        }
+                    ],
+                    "ipv4-next-hop": {
+                        "global": "1.2.3.4"
+                    },
+                    "origin": {
+                        "value": "igp"
+                    },
+                    "as-path": {},
+                    "local-pref": {
+                        "pref": 100
+                    }
+                },
+                "flowspec": [
+                    {
+                        "destination-prefix": "192.168.0.2/32"
+                    },
+                    {
+                        "source-prefix": "10.0.0.2/32"
+                    }
+                ]
+            },
+            {
+                "route-key": "all packets to 192.168.0.1/32 AND from 10.0.0.1/32",
+                "attributes": {
+                    "extended-communities": [
+                        {
+                            "transitive": true,
+                            "redirect-extended-community": {
+                                "global-administrator": 65500,
+                                "local-administrator": "AAAwOQ=="
+                            }
+                        }
+                    ],
+                    "origin": {
+                        "value": "igp"
+                    },
+                    "as-path": {},
+                    "local-pref": {
+                        "pref": 100
+                    }
+                },
+                "flowspec": [
+                    {
+                        "destination-prefix": "192.168.0.1/32"
+                    },
+                    {
+                        "source-prefix": "10.0.0.1/32"
+                    }
+                ]
+            },
+            {
+                "route-key": "all packets to 192.168.0.4/32 AND from 10.0.0.4/32",
+                "attributes": {
+                    "extended-communities": [
+                        {
+                            "transitive": true,
+                            "redirect-ip-nh-extended-community": {
+                                "next-hop-address": "0.0.0.0",
+                                "copy": false
+                            }
+                        }
+                    ],
+                    "ipv4-next-hop": {
+                        "global": "127.0.0.1"
+                    },
+                    "origin": {
+                        "value": "igp"
+                    },
+                    "as-path": {},
+                    "local-pref": {
+                        "pref": 100
+                    }
+                },
+                "flowspec": [
+                    {
+                        "destination-prefix": "192.168.0.4/32"
+                    },
+                    {
+                        "source-prefix": "10.0.0.4/32"
+                    }
+                ]
+            }
+        ]
+    }
+}
index 56eb06b1a1a3df4bc7b8feaa98cbba93598fb194..617ba21e30c15179effd52402ef959668f343c3e 100644 (file)
@@ -2,6 +2,7 @@
     "bgp-flowspec:flowspec-routes": {
         "flowspec-route": [
             {
+                "path-id": 0,
                 "route-key": "all packets to 192.168.0.1/32 AND from 10.0.0.1/32 AND where IP protocol equals to 6 AND where port equals to 80 AND where destination port is greater than 8080 and is less than 8088 AND where source port is greater than 1024 AND where ICMP type equals to 0 AND where ICMP code equals to 0 AND where TCP flags does match 32 AND where packet length is greater than 400 and is less than 500 AND where DSCP equals to 20 AND where fragment does match 'IS FIRST' ",
                 "attributes": {
                     "extended-communities": [
diff --git a/csit/variables/bgpflowspec/bgp-flowspec.json.beryllium b/csit/variables/bgpflowspec/bgp-flowspec.json.beryllium
new file mode 100644 (file)
index 0000000..56eb06b
--- /dev/null
@@ -0,0 +1,123 @@
+{
+    "bgp-flowspec:flowspec-routes": {
+        "flowspec-route": [
+            {
+                "route-key": "all packets to 192.168.0.1/32 AND from 10.0.0.1/32 AND where IP protocol equals to 6 AND where port equals to 80 AND where destination port is greater than 8080 and is less than 8088 AND where source port is greater than 1024 AND where ICMP type equals to 0 AND where ICMP code equals to 0 AND where TCP flags does match 32 AND where packet length is greater than 400 and is less than 500 AND where DSCP equals to 20 AND where fragment does match 'IS FIRST' ",
+                "attributes": {
+                    "extended-communities": [
+                        {
+                            "transitive": true,
+                            "traffic-action-extended-community": {
+                                "sample": true,
+                                "terminal-action": true
+                            }
+                        }
+                    ],
+                    "origin": {
+                        "value": "igp"
+                    },
+                    "as-path": {},
+                    "local-pref": {
+                        "pref": 100
+                    }
+                },
+                "flowspec": [
+                    {
+                        "destination-prefix": "192.168.0.1/32"
+                    },
+                    {
+                        "source-prefix": "10.0.0.1/32"
+                    },
+                    {
+                        "protocol-ips": [
+                            {
+                                "op": "equals end-of-list",
+                                "value": 6
+                            }
+                        ]
+                    },
+                    {
+                        "ports": [
+                            {
+                                "op": "equals end-of-list",
+                                "value": 80
+                            }
+                        ]
+                    },
+                    {
+                        "destination-ports": [
+                            {
+                                "op": "greater-than",
+                                "value": 8080
+                            },
+                            {
+                                "op": "end-of-list less-than and-bit",
+                                "value": 8088
+                            }
+                        ]
+                    },
+                    {
+                        "source-ports": [
+                            {
+                                "op": "end-of-list greater-than",
+                                "value": 1024
+                            }
+                        ]
+                    },
+                    {
+                        "types": [
+                            {
+                                "op": "equals end-of-list",
+                                "value": 0
+                            }
+                        ]
+                    },
+                    {
+                        "codes": [
+                            {
+                                "op": "equals end-of-list",
+                                "value": 0
+                            }
+                        ]
+                    },
+                    {
+                        "tcp-flags": [
+                            {
+                                "op": "match end-of-list",
+                                "value": 32
+                            }
+                        ]
+                    },
+                    {
+                        "packet-lengths": [
+                            {
+                                "op": "greater-than",
+                                "value": 400
+                            },
+                            {
+                                "op": "end-of-list less-than and-bit",
+                                "value": 500
+                            }
+                        ]
+                    },
+                    {
+                        "dscps": [
+                            {
+                                "op": "equals end-of-list",
+                                "value": 20
+                            }
+                        ]
+                    },
+                    {
+                        "fragments": [
+                            {
+                                "op": "match end-of-list",
+                                "value": "first"
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    }
+}