Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 1 | <!-- |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | ~ Copyright 2016-present Open Networking Laboratory |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [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-flow-objectives" |
| 17 | description="Network REST API test"> |
| 18 | <!-- TODO: parametrize this via recipes --> |
| 19 | <group name="Net-Flow-Objectives"> |
| 20 | |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 21 | <!-- Force discovery of hosts --> |
Ray Milkey | 955c4b8 | 2016-07-11 09:48:53 -0700 | [diff] [blame] | 22 | <step name="Net-Flow-Objectives.Find-Host-1" |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 23 | exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect ."/> |
| 24 | <step name="Net-Flow-Objectives.Find-Host-2" requires="^" |
| 25 | exec="onos-mininet sendAndExpect h4 ping -c1 -w1 h1 --expect ."/> |
| 26 | |
| 27 | <!-- Verify the hosts using the REST API --> |
| 28 | <step name="Net-Flow-Objectives.Query-Host-1" requires="Net-Flow-Objectives.Find-Host-1" |
Ray Milkey | 90289b0 | 2016-03-31 15:23:28 -0700 | [diff] [blame] | 29 | exec="find-host.py ${OC1} host1 00:00:00:00:00:01/None"/> |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 30 | <step name="Net-Flow-Objectives.Validate-Host-1-Id" requires="^" |
Ray Milkey | 90289b0 | 2016-03-31 15:23:28 -0700 | [diff] [blame] | 31 | exec="test '${host1Id}' == '00:00:00:00:00:01/None'"/> |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 32 | <step name="Net-Flow-Objectives.Validate-Host-1-Mac" requires="^" |
| 33 | exec="test '${host1Mac}' == '00:00:00:00:00:01'"/> |
| 34 | <step name="Net-Flow-Objectives.Validate-Host-1-Ip" requires="^" |
| 35 | exec="test '${host1IpAddress}' == '10.0.0.1'"/> |
| 36 | |
| 37 | <step name="Net-Flow-Objectives.Query-Host-2" requires="Net-Flow-Objectives.Find-Host-2" |
Ray Milkey | 90289b0 | 2016-03-31 15:23:28 -0700 | [diff] [blame] | 38 | exec="find-host.py ${OC1} host2 00:00:00:00:00:04/None"/> |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 39 | <step name="Net-Flow-Objectives.Validate-Host-2-Id" requires="^" |
Ray Milkey | 90289b0 | 2016-03-31 15:23:28 -0700 | [diff] [blame] | 40 | exec="test '${host2Id}' == '00:00:00:00:00:04/None'"/> |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 41 | <step name="Net-Flow-Objectives.Validate-Host-2-Mac" requires="^" |
| 42 | exec="test '${host2Mac}' == '00:00:00:00:00:04'"/> |
| 43 | <step name="Net-Flow-Objectives.Validate-Host-2-Ip" requires="^" |
| 44 | exec="test '${host2IpAddress}' == '10.0.0.4'"/> |
| 45 | |
| 46 | <!-- Use REST API to create flow objectives to connect h1 and h4 --> |
| 47 | <step name="Net-Flow-Objectives.Objective-1F" requires="Net-Flow-Objectives.Find-Host-2" |
| 48 | exec="create-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:01 00:00:00:00:00:04 1 2"/> |
| 49 | <step name="Net-Flow-Objectives.Objective-1R" requires="Net-Flow-Objectives.Find-Host-2" |
| 50 | exec="create-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:04 00:00:00:00:00:01 2 1"/> |
| 51 | |
| 52 | <step name="Net-Flow-Objectives.Objective-19F" requires="Net-Flow-Objectives.Find-Host-2" |
| 53 | exec="create-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:01 00:00:00:00:00:04 2 8"/> |
| 54 | <step name="Net-Flow-Objectives.Objective-19R" requires="^" |
| 55 | exec="create-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:04 00:00:00:00:00:01 8 2"/> |
| 56 | |
| 57 | <step name="Net-Flow-Objectives.Objective-7F" requires="Net-Flow-Objectives.Find-Host-2" |
| 58 | exec="create-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:01 00:00:00:00:00:04 2 3"/> |
| 59 | <step name="Net-Flow-Objectives.Objective-7R" requires="Net-Flow-Objectives.Find-Host-2" |
| 60 | exec="create-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:04 00:00:00:00:00:01 3 2"/> |
| 61 | |
| 62 | <step name="Net-Flow-Objectives.Objective-4F" requires="Net-Flow-Objectives.Find-Host-2" |
| 63 | exec="create-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:01 00:00:00:00:00:04 3 1"/> |
| 64 | <step name="Net-Flow-Objectives.Objective-4R" requires="Net-Flow-Objectives.Find-Host-2" |
| 65 | exec="create-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:04 00:00:00:00:00:01 1 3"/> |
| 66 | |
| 67 | |
| 68 | <!-- Check that connectivity was established --> |
| 69 | <step name="Net-Flow-Objectives.Ping-XY" requires="Net-Flow-Objectives.Objective-1F, |
| 70 | Net-Flow-Objectives.Objective-1R, |
| 71 | Net-Flow-Objectives.Objective-19F, |
Jon Hall | 3ea0a1c | 2017-02-20 15:25:08 -0800 | [diff] [blame^] | 72 | Net-Flow-Objectives.Objective-19R, |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 73 | Net-Flow-Objectives.Objective-7F, |
Jon Hall | 3ea0a1c | 2017-02-20 15:25:08 -0800 | [diff] [blame^] | 74 | Net-Flow-Objectives.Objective-7R, |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 75 | Net-Flow-Objectives.Objective-4F, |
| 76 | Net-Flow-Objectives.Objective-4R" |
| 77 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> |
| 78 | <step name="Net-Flow-Objectives.Ping-YX" requires="^" |
| 79 | exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 0% packet loss"/> |
| 80 | |
Ray Milkey | a481a11 | 2016-07-11 16:38:47 -0700 | [diff] [blame] | 81 | <!-- Use REST API to remove flow objectives --> |
| 82 | <step name="Net-Flow-Objectives.Objective-R1F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 83 | exec="remove-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:01 00:00:00:00:00:04 1 2"/> |
| 84 | <step name="Net-Flow-Objectives.Objective-R1R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 85 | exec="remove-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:04 00:00:00:00:00:01 2 1"/> |
| 86 | |
| 87 | <step name="Net-Flow-Objectives.Objective-R19F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 88 | exec="remove-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:01 00:00:00:00:00:04 2 8"/> |
| 89 | <step name="Net-Flow-Objectives.Objective-R19R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 90 | exec="remove-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:04 00:00:00:00:00:01 8 2"/> |
| 91 | |
| 92 | <step name="Net-Flow-Objectives.Objective-R7F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 93 | exec="remove-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:01 00:00:00:00:00:04 2 3"/> |
| 94 | <step name="Net-Flow-Objectives.Objective-R7R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 95 | exec="remove-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:04 00:00:00:00:00:01 3 2"/> |
| 96 | |
| 97 | <step name="Net-Flow-Objectives.Objective-R4F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 98 | exec="remove-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:01 00:00:00:00:00:04 3 1"/> |
| 99 | <step name="Net-Flow-Objectives.Objective-R4R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" |
| 100 | exec="remove-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:04 00:00:00:00:00:01 1 3"/> |
| 101 | |
Ray Milkey | 48bf76c | 2016-02-23 15:27:39 -0800 | [diff] [blame] | 102 | </group> |
| 103 | </scenario> |