blob: 0890dedc9cb3c6905f544b40c6cd59e226643bb5 [file] [log] [blame]
Jordan Halterman980a8c12017-09-22 18:01:19 -07001<!--
2 ~ Copyright 2017-present Open Networking Foundation
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="upgrade" description="ONOS cluster upgrade">
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080017 <import file="${ONOS_SCENARIOS}/dist-setup.xml"/>
18 <dependency name="Distributed-Primitives-Setup"/>
19
20 <group name="Upgrade" requires="Distributed-Primitives-Setup">
Jordan Halterman980a8c12017-09-22 18:01:19 -070021 <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/>
22
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080023 <step name="Initialize-ECM"
24 exec="onos ${OC1} ec-map-test foo put a b"/>
25
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080026 <step name="Initialize-CM"
27 exec="onos ${OC1} map-test foo put a b"
28 requires="Initialize-ECM"/>
29
Jordan Halterman980a8c12017-09-22 18:01:19 -070030 <step name="Initialize-Upgrade"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080031 exec="onos ${OC1} issu init"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080032 requires="Initialize-CM"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070033
34 <group name="Phase-1">
35 <sequential var="${OCMI#}"
36 starts="Phase-One-Stop-Service-${#}"
37 ends="Phase-One-Wait-for-Start-${#-1}">
38 <step name="Phase-One-Stop-Service-${#}"
39 exec="onos-service ${OCMI#} stop"
40 requires="Initialize-Upgrade"/>
41
42 <step name="Phase-One-Wait-for-Stop-${#}"
43 exec="onos-wait-for-stop ${OCMI#}"
44 requires="~Phase-One-Stop-Service-${#}"/>
45
46 <step name="Phase-One-Uninstall-${#}"
47 exec="onos-uninstall ${OCMI#}"
48 requires="~Phase-One-Wait-for-Stop-${#}"/>
49
50 <step name="Phase-One-Push-Bits-${#}"
51 exec="onos-push-bits ${OCMI#}"
52 unless="${OCT}"
53 requires="~Phase-One-Stop-Service-${#}"/>
54
55 <step name="Phase-One-Install-Upgrade-${#}"
56 exec="onos-install -v ${OCMI#}"
57 requires="Phase-One-Push-Bits-${#},Push-Bits,Phase-One-Uninstall-${#}"/>
58
59 <step name="Phase-One-Secure-SSH-${#}"
60 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}"
61 requires="~Phase-One-Install-Upgrade-${#}"/>
62
63 <step name="Phase-One-Wait-for-Start-${#}"
64 exec="onos-wait-for-start ${OCMI#}"
65 requires="Phase-One-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080066
67 <step name="Phase-One-Distributed-Primitives-Check-Apps-${#}"
68 exec="onos-check-apps ${OCMI#} distributedprimitives includes"
69 requires="Phase-One-Wait-for-Start-${#}"/>
70
71 <step name="Phase-One-Check-ECM-${#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080072 exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --retry 5 --expect b"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080073 requires="Phase-One-Distributed-Primitives-Check-Apps-${#}"/>
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080074
75 <step name="Phase-One-Check-CM-${#}"
76 exec="onos-execute-expect ${OCMI#} map-test foo get a --retry 5 --expect b"
77 requires="Phase-One-Check-ECM-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070078 </sequential>
79 </group>
80
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080081 <group name="Change-ECM-values" requires="Phase-1">
82 <step name="Change-Majority-ECM"
83 exec="onos ${OCMA1} ec-map-test foo put a d"/>
84
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080085 <step name="Change-Majority-CM"
86 exec="onos ${OCMA1} map-test foo put a d"/>
87
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080088 <step name="Change-Minority-ECM"
89 exec="onos ${OCMI1} ec-map-test foo put a c"/>
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080090
91 <step name="Change-Minority-CM"
92 exec="onos ${OCMI1} map-test foo put a c"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080093 </group>
94
95 <group name="Check-ECM-values" requires="Change-ECM-values">
96 <parallel var="${OCMI#}">
97 <step name="Parallel-Check-Minority-ECM-${#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -080098 exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --retry 5 --expect c"/>
99
100 <step name="Parallel-Check-Minority-CM-${#}"
101 exec="onos-execute-expect ${OCMI#} map-test foo get a --retry 5 --expect c"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800102 </parallel>
103
104 <parallel var="${OCMA#}">
105 <step name="Parallel-Check-Majority-ECM-${#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800106 exec="onos-execute-expect ${OCMA#} ec-map-test foo get a --retry 5 --expect d"/>
107
108 <step name="Parallel-Check-Majority-CM-${#}"
109 exec="onos-execute-expect ${OCMA#} map-test foo get a --retry 5 --expect d"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800110 </parallel>
111 </group>
112
Jordan Halterman980a8c12017-09-22 18:01:19 -0700113 <step name="Run-Upgrade"
114 exec="onos ${OC1} issu upgrade"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800115 requires="Check-ECM-values"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -0700116
117 <group name="Phase-2" requires="Run-Upgrade">
118 <sequential var="${OCMA#}"
119 starts="Phase-Two-Stop-Service-${#}"
120 ends="Phase-Two-Wait-for-Start-${#-1}">
121 <step name="Phase-Two-Stop-Service-${#}"
122 exec="onos-service ${OCMA#} stop"
123 requires="Run-Upgrade"/>
124
125 <step name="Phase-Two-Wait-for-Stop-${#}"
126 exec="onos-wait-for-stop ${OCMA#}"
127 requires="~Phase-Two-Stop-Service-${#}"/>
128
129 <step name="Phase-Two-Uninstall-${#}"
130 exec="onos-uninstall ${OCMA#}"
131 requires="~Phase-Two-Wait-for-Stop-${#}"/>
132
133 <step name="Phase-Two-Push-Bits-${#}"
134 exec="onos-push-bits ${OCMA#}"
135 unless="${OCT}"
136 requires="~Phase-Two-Stop-Service-${#}"/>
137
138 <step name="Phase-Two-Install-Upgrade-${#}"
139 exec="onos-install -v ${OCMA#}"
140 requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/>
141
142 <step name="Phase-Two-Secure-SSH-${#}"
143 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMA#}"
144 requires="~Phase-Two-Install-Upgrade-${#}"/>
145
146 <step name="Phase-Two-Wait-for-Start-${#}"
147 exec="onos-wait-for-start ${OCMA#}"
148 requires="Phase-Two-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800149
150 <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}"
151 exec="onos-check-apps ${OCMA#} distributedprimitives includes"
152 requires="Phase-Two-Wait-for-Start-${#}"/>
153
154 <step name="Phase-Two-Check-ECM-${#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800155 exec="onos-execute-expect ${OC#} ec-map-test foo get a --retry 5 --expect c"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800156 requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/>
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800157
158 <step name="Phase-Two-Check-CM-${#}"
159 exec="onos-execute-expect ${OC#} map-test foo get a --retry 5 --expect c"
160 requires="Phase-Two-Check-ECM-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -0700161 </sequential>
162 </group>
163
164 <step name="Commit-Upgrade"
165 exec="onos ${OC1} issu commit"
166 requires="Phase-2"/>
167
168 <group name="Verify-Upgrade" requires="Commit-Upgrade">
169 <parallel var="${OC#}">
170 <step name="Check-Nodes-${#}"
171 exec="onos-check-nodes ${OC#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800172 delay="3"/>
173
Jordan Halterman980a8c12017-09-22 18:01:19 -0700174 <step name="Check-Components-${#}"
175 exec="onos-check-components ${OC#}"
176 delay="5"
177 requires="~Check-Nodes-${#}"/>
178
179 <step name="Check-Logs-${#}"
180 exec="onos-check-logs ${OC#}"
181 requires="~Check-Components-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800182
Jordan Halterman980a8c12017-09-22 18:01:19 -0700183 <step name="Check-Apps-${#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800184 exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes"
Jordan Halterman980a8c12017-09-22 18:01:19 -0700185 requires="~Check-Components-${#}"/>
186 </parallel>
187 </group>
188 </group>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800189</scenario>