Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 1 | <!-- |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | ~ Copyright 2015-present Open Networking Foundation |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 3 | ~ |
| 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | ~ you may not use this file except in compliance with the License. |
| 6 | ~ You may obtain a copy of the License at |
| 7 | ~ |
| 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ~ |
| 10 | ~ Unless required by applicable law or agreed to in writing, software |
| 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | ~ See the License for the specific language governing permissions and |
| 14 | ~ limitations under the License. |
| 15 | --> |
| 16 | <scenario name="net-create-flows" |
| 17 | description="Network Flow Creation Test Using REST API"> |
| 18 | <!-- TODO: parametrize this via recipes --> |
| 19 | <group name="Net-Create-Flows"> |
| 20 | |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 21 | <!-- Force discovery of hosts --> |
Ray Milkey | 955c4b8 | 2016-07-11 09:48:53 -0700 | [diff] [blame] | 22 | <step name="Net-Create-Flows.Find-Host-1" |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 23 | exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect 100% packet loss"/> |
| 24 | <step name="Net-Create-Flows.Find-Host-2" requires="^" |
| 25 | exec="onos-mininet sendAndExpect h4 ping -c1 -w1 h1 --expect 100% packet loss"/> |
| 26 | |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 27 | <!-- Use REST API to create a point to point intent in each direction --> |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 28 | <step name="Net-Create-Flows.1-to-19" requires="^" |
| 29 | exec="create-flow.py ${OC1} f2 of:0000000000000001 1 2"/> |
| 30 | <step name="Net-Create-Flows.19-to-7" requires="^" |
| 31 | exec="create-flow.py ${OC1} f3 of:0000000000000019 2 8"/> |
| 32 | <step name="Net-Create-Flows.7-to-4" requires="^" |
| 33 | exec="create-flow.py ${OC1} f4 of:0000000000000007 2 3"/> |
| 34 | <step name="Net-Create-Flows.4-to-Host" requires="^" |
| 35 | exec="create-flow.py ${OC1} f5 of:0000000000000004 1 3"/> |
| 36 | |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 37 | <step name="Net-Create-Flows.19-to-1" requires="^" |
| 38 | exec="create-flow.py ${OC1} f7 of:0000000000000001 2 1"/> |
| 39 | <step name="Net-Create-Flows.7-to-19" requires="^" |
| 40 | exec="create-flow.py ${OC1} f8 of:0000000000000019 8 2"/> |
| 41 | <step name="Net-Create-Flows.4-to-7" requires="^" |
| 42 | exec="create-flow.py ${OC1} f9 of:0000000000000007 3 2"/> |
| 43 | <step name="Net-Create-Flows.Host-to-4" requires="^" |
| 44 | exec="create-flow.py ${OC1} f10 of:0000000000000004 3 1"/> |
| 45 | |
Ray Milkey | 407ef25 | 2016-06-14 11:30:52 -0700 | [diff] [blame] | 46 | <!-- Make sure all flows are added --> |
| 47 | <step name="Net-Create-Flows.Check-Flows-Added" requires="^" |
| 48 | exec="onos-check-flows ${OC1}"/> |
| 49 | |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 50 | <!-- Check that connectivity was established --> |
| 51 | <step name="Net-Create-Flows.Ping-XY" requires="^" |
| 52 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> |
| 53 | <step name="Net-Create-Flows.Ping-YX" requires="^" |
| 54 | exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 0% packet loss"/> |
| 55 | |
| 56 | <!-- Use REST API to remove the flows. --> |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 57 | <step name="Net-Create-Flows.Delete-f2" requires="^" |
| 58 | exec="curl -f -X DELETE -uonos:rocks ${f2Location}"/> |
| 59 | <step name="Net-Create-Flows.Delete-f3" requires="^" |
| 60 | exec="curl -f -X DELETE -uonos:rocks ${f3Location}"/> |
| 61 | <step name="Net-Create-Flows.Delete-f4" requires="^" |
| 62 | exec="curl -f -X DELETE -uonos:rocks ${f4Location}"/> |
| 63 | <step name="Net-Create-Flows.Delete-f5" requires="^" |
| 64 | exec="curl -f -X DELETE -uonos:rocks ${f5Location}"/> |
Ray Milkey | 43ee97f | 2015-09-04 15:14:40 -0700 | [diff] [blame] | 65 | <step name="Net-Create-Flows.Delete-f7" requires="^" |
| 66 | exec="curl -f -X DELETE -uonos:rocks ${f7Location}"/> |
| 67 | <step name="Net-Create-Flows.Delete-f8" requires="^" |
| 68 | exec="curl -f -X DELETE -uonos:rocks ${f8Location}"/> |
| 69 | <step name="Net-Create-Flows.Delete-f9" requires="^" |
| 70 | exec="curl -f -X DELETE -uonos:rocks ${f9Location}"/> |
| 71 | <step name="Net-Create-Flows.Delete-f10" requires="^" |
| 72 | exec="curl -f -X DELETE -uonos:rocks ${f10Location}"/> |
| 73 | |
| 74 | <!-- Ping again to be sure the path was removed. --> |
| 75 | <step name="Net-Create-Flows.Fail-Ping-XY" requires="^" |
| 76 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 100% packet loss"/> |
| 77 | <step name="Net-Create-Flows.Fail-Ping-YX" requires="^" |
| 78 | exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 100% packet loss"/> |
| 79 | |
| 80 | |
| 81 | </group> |
| 82 | </scenario> |