blob: aadfe9447c924a3dd824bfa84622e97c7a4c3569 [file] [log] [blame]
Ray Milkey48bf76c2016-02-23 15:27:39 -08001<!--
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 ~ Copyright 2016-present Open Networking Laboratory
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
21 <!-- Make sure that reactive forwarding is off -->
22 <step name="Net-Flow-Objectives.Uninstall-Reactive-Forwarding"
23 exec="onos ${OC1} app deactivate org.onosproject.fwd org.onosproject.ifwd"/>
24 <step name="Net-Flow-Objectives.Check-Apps" requires="^"
25 exec="onos-check-apps ${OC1} fwd,ifwd excludes"/>
26
27 <!-- Force discovery of hosts -->
28 <step name="Net-Flow-Objectives.Find-Host-1" requires="^"
29 exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect ."/>
30 <step name="Net-Flow-Objectives.Find-Host-2" requires="^"
31 exec="onos-mininet sendAndExpect h4 ping -c1 -w1 h1 --expect ."/>
32
33 <!-- Verify the hosts using the REST API -->
34 <step name="Net-Flow-Objectives.Query-Host-1" requires="Net-Flow-Objectives.Find-Host-1"
Ray Milkey90289b02016-03-31 15:23:28 -070035 exec="find-host.py ${OC1} host1 00:00:00:00:00:01/None"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080036 <step name="Net-Flow-Objectives.Validate-Host-1-Id" requires="^"
Ray Milkey90289b02016-03-31 15:23:28 -070037 exec="test '${host1Id}' == '00:00:00:00:00:01/None'"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080038 <step name="Net-Flow-Objectives.Validate-Host-1-Mac" requires="^"
39 exec="test '${host1Mac}' == '00:00:00:00:00:01'"/>
40 <step name="Net-Flow-Objectives.Validate-Host-1-Ip" requires="^"
41 exec="test '${host1IpAddress}' == '10.0.0.1'"/>
42
43 <step name="Net-Flow-Objectives.Query-Host-2" requires="Net-Flow-Objectives.Find-Host-2"
Ray Milkey90289b02016-03-31 15:23:28 -070044 exec="find-host.py ${OC1} host2 00:00:00:00:00:04/None"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080045 <step name="Net-Flow-Objectives.Validate-Host-2-Id" requires="^"
Ray Milkey90289b02016-03-31 15:23:28 -070046 exec="test '${host2Id}' == '00:00:00:00:00:04/None'"/>
Ray Milkey48bf76c2016-02-23 15:27:39 -080047 <step name="Net-Flow-Objectives.Validate-Host-2-Mac" requires="^"
48 exec="test '${host2Mac}' == '00:00:00:00:00:04'"/>
49 <step name="Net-Flow-Objectives.Validate-Host-2-Ip" requires="^"
50 exec="test '${host2IpAddress}' == '10.0.0.4'"/>
51
52 <!-- Use REST API to create flow objectives to connect h1 and h4 -->
53 <step name="Net-Flow-Objectives.Objective-1F" requires="Net-Flow-Objectives.Find-Host-2"
54 exec="create-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:01 00:00:00:00:00:04 1 2"/>
55 <step name="Net-Flow-Objectives.Objective-1R" requires="Net-Flow-Objectives.Find-Host-2"
56 exec="create-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:04 00:00:00:00:00:01 2 1"/>
57
58 <step name="Net-Flow-Objectives.Objective-19F" requires="Net-Flow-Objectives.Find-Host-2"
59 exec="create-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:01 00:00:00:00:00:04 2 8"/>
60 <step name="Net-Flow-Objectives.Objective-19R" requires="^"
61 exec="create-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:04 00:00:00:00:00:01 8 2"/>
62
63 <step name="Net-Flow-Objectives.Objective-7F" requires="Net-Flow-Objectives.Find-Host-2"
64 exec="create-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:01 00:00:00:00:00:04 2 3"/>
65 <step name="Net-Flow-Objectives.Objective-7R" requires="Net-Flow-Objectives.Find-Host-2"
66 exec="create-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:04 00:00:00:00:00:01 3 2"/>
67
68 <step name="Net-Flow-Objectives.Objective-4F" requires="Net-Flow-Objectives.Find-Host-2"
69 exec="create-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:01 00:00:00:00:00:04 3 1"/>
70 <step name="Net-Flow-Objectives.Objective-4R" requires="Net-Flow-Objectives.Find-Host-2"
71 exec="create-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:04 00:00:00:00:00:01 1 3"/>
72
73
74 <!-- Check that connectivity was established -->
75 <step name="Net-Flow-Objectives.Ping-XY" requires="Net-Flow-Objectives.Objective-1F,
76 Net-Flow-Objectives.Objective-1R,
77 Net-Flow-Objectives.Objective-19F,
78 Net-Flow-Objectives.Objective-19R
79 Net-Flow-Objectives.Objective-7F,
80 Net-Flow-Objectives.Objective-7R
81 Net-Flow-Objectives.Objective-4F,
82 Net-Flow-Objectives.Objective-4R"
83 exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/>
84 <step name="Net-Flow-Objectives.Ping-YX" requires="^"
85 exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 0% packet loss"/>
86
87 </group>
88</scenario>