blob: 13f44038541eeb72e9606c342253bdbd2d7836f4 [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-rollback" description="ONOS cluster upgrade and rollback">
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-Rollback" 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"
32 requires="Initialize-ECM"/>
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 <step name="Run-Rollback"
118 exec="onos ${OC1} issu rollback"
119 requires="Run-Upgrade"/>
120
121 <group name="Phase-2" requires="Run-Rollback">
122 <sequential var="${OCMI#}"
123 starts="Phase-Two-Stop-Service-${#}"
124 ends="Phase-Two-Wait-for-Start-${#-1}">
125 <step name="Phase-Two-Stop-Service-${#}"
126 exec="onos-service ${OCMI#} stop"
127 requires="Run-Rollback"/>
128
129 <step name="Phase-Two-Wait-for-Stop-${#}"
130 exec="onos-wait-for-stop ${OCMI#}"
131 requires="~Phase-Two-Stop-Service-${#}"/>
132
133 <step name="Phase-Two-Uninstall-${#}"
134 exec="onos-uninstall ${OCMI#}"
135 requires="~Phase-Two-Wait-for-Stop-${#}"/>
136
137 <step name="Phase-Two-Push-Bits-${#}"
138 exec="onos-push-bits ${OCMI#}"
139 unless="${OCT}"
140 requires="~Phase-Two-Stop-Service-${#}"/>
141
142 <step name="Phase-Two-Install-Upgrade-${#}"
143 exec="onos-install ${OCMI#}"
144 requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/>
145
146 <step name="Phase-Two-Secure-SSH-${#}"
147 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}"
148 requires="~Phase-Two-Install-Upgrade-${#}"/>
149
150 <step name="Phase-Two-Wait-for-Start-${#}"
151 exec="onos-wait-for-start ${OCMI#}"
152 requires="Phase-Two-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800153
154 <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}"
155 exec="onos-check-apps ${OCMA#} distributedprimitives includes"
156 requires="Phase-Two-Wait-for-Start-${#}"/>
157
158 <step name="Phase-Two-Check-ECM-${#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800159 exec="onos-execute-expect ${OC#} ec-map-test foo get a --retry 5 --expect d"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800160 requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/>
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800161
162 <step name="Phase-Two-Check-CM-${#}"
163 exec="onos-execute-expect ${OC#} map-test foo get a --retry 5 --expect d"
164 requires="Phase-Two-Check-ECM-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -0700165 </sequential>
166 </group>
167
168 <step name="Reset-Upgrade"
169 exec="onos ${OC1} issu reset"
170 requires="Phase-2"/>
171
172 <group name="Verify-Rollback" requires="Reset-Upgrade">
173 <parallel var="${OC#}">
174 <step name="Check-Nodes-${#}"
175 exec="onos-check-nodes ${OC#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800176 delay="3"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800177
Jordan Halterman980a8c12017-09-22 18:01:19 -0700178 <step name="Check-Components-${#}"
179 exec="onos-check-components ${OC#}"
180 delay="5"
181 requires="~Check-Nodes-${#}"/>
182
183 <step name="Check-Logs-${#}"
184 exec="onos-check-logs ${OC#}"
185 requires="~Check-Components-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800186
Jordan Halterman980a8c12017-09-22 18:01:19 -0700187 <step name="Check-Apps-${#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800188 exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes"
Jordan Halterman980a8c12017-09-22 18:01:19 -0700189 requires="~Check-Components-${#}"/>
190 </parallel>
191 </group>
192 </group>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800193</scenario>