blob: 5b7535c51b725a6453442cff747df02ac3849779 [file] [log] [blame]
Ray Milkey48bf76c2016-02-23 15:27:39 -08001<!--
Brian O'Connorce2a03d2017-08-03 19:21:03 -07002 ~ Copyright 2016-present Open Networking Foundation
Ray Milkey48bf76c2016-02-23 15:27:39 -08003 ~
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 Milkey48bf76c2016-02-23 15:27:39 -080021 <!-- Force discovery of hosts -->
Ray Milkey955c4b82016-07-11 09:48:53 -070022 <step name="Net-Flow-Objectives.Find-Host-1"
Ray Milkey48bf76c2016-02-23 15:27:39 -080023 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 Milkey90289b02016-03-31 15:23:28 -070029 exec="find-host.py ${OC1} host1 00:00:00:00:00:01/None"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080030 <step name="Net-Flow-Objectives.Validate-Host-1-Id" requires="^"
Ray Milkey90289b02016-03-31 15:23:28 -070031 exec="test '${host1Id}' == '00:00:00:00:00:01/None'"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080032 <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 Milkey90289b02016-03-31 15:23:28 -070038 exec="find-host.py ${OC1} host2 00:00:00:00:00:04/None"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080039 <step name="Net-Flow-Objectives.Validate-Host-2-Id" requires="^"
Ray Milkey90289b02016-03-31 15:23:28 -070040 exec="test '${host2Id}' == '00:00:00:00:00:04/None'"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080041 <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 Hall1d854392017-02-20 15:25:08 -080072 Net-Flow-Objectives.Objective-19R,
Ray Milkey48bf76c2016-02-23 15:27:39 -080073 Net-Flow-Objectives.Objective-7F,
Jon Hall1d854392017-02-20 15:25:08 -080074 Net-Flow-Objectives.Objective-7R,
Ray Milkey48bf76c2016-02-23 15:27:39 -080075 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 Milkeya481a112016-07-11 16:38:47 -070081 <!-- 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 Milkey48bf76c2016-02-23 15:27:39 -0800102 </group>
103</scenario>