blob: 05841bbe3edd788e1265fb8727271df1ff5d9d9b [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
Jordan Halterman980a8c12017-09-22 18:01:19 -070026 <step name="Initialize-Upgrade"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080027 exec="onos ${OC1} issu init"
28 requires="Initialize-ECM"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070029
30 <group name="Phase-1">
31 <sequential var="${OCMI#}"
32 starts="Phase-One-Stop-Service-${#}"
33 ends="Phase-One-Wait-for-Start-${#-1}">
34 <step name="Phase-One-Stop-Service-${#}"
35 exec="onos-service ${OCMI#} stop"
36 requires="Initialize-Upgrade"/>
37
38 <step name="Phase-One-Wait-for-Stop-${#}"
39 exec="onos-wait-for-stop ${OCMI#}"
40 requires="~Phase-One-Stop-Service-${#}"/>
41
42 <step name="Phase-One-Uninstall-${#}"
43 exec="onos-uninstall ${OCMI#}"
44 requires="~Phase-One-Wait-for-Stop-${#}"/>
45
46 <step name="Phase-One-Push-Bits-${#}"
47 exec="onos-push-bits ${OCMI#}"
48 unless="${OCT}"
49 requires="~Phase-One-Stop-Service-${#}"/>
50
51 <step name="Phase-One-Install-Upgrade-${#}"
52 exec="onos-install -v ${OCMI#}"
53 requires="Phase-One-Push-Bits-${#},Push-Bits,Phase-One-Uninstall-${#}"/>
54
55 <step name="Phase-One-Secure-SSH-${#}"
56 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}"
57 requires="~Phase-One-Install-Upgrade-${#}"/>
58
59 <step name="Phase-One-Wait-for-Start-${#}"
60 exec="onos-wait-for-start ${OCMI#}"
61 requires="Phase-One-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080062
63 <step name="Phase-One-Distributed-Primitives-Check-Apps-${#}"
64 exec="onos-check-apps ${OCMI#} distributedprimitives includes"
65 requires="Phase-One-Wait-for-Start-${#}"/>
66
67 <step name="Phase-One-Check-ECM-${#}"
68 exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --expect b"
69 requires="Phase-One-Distributed-Primitives-Check-Apps-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070070 </sequential>
71 </group>
72
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080073 <group name="Change-ECM-values" requires="Phase-1">
74 <step name="Change-Majority-ECM"
75 exec="onos ${OCMA1} ec-map-test foo put a d"/>
76
77 <step name="Change-Minority-ECM"
78 exec="onos ${OCMI1} ec-map-test foo put a c"/>
79 </group>
80
81 <group name="Check-ECM-values" requires="Change-ECM-values">
82 <parallel var="${OCMI#}">
83 <step name="Parallel-Check-Minority-ECM-${#}"
84 exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --expect c"/>
85 </parallel>
86
87 <parallel var="${OCMA#}">
88 <step name="Parallel-Check-Majority-ECM-${#}"
89 exec="onos-execute-expect ${OCMA#} ec-map-test foo get a --expect d"/>
90 </parallel>
91 </group>
92
Jordan Halterman980a8c12017-09-22 18:01:19 -070093 <step name="Run-Upgrade"
94 exec="onos ${OC1} issu upgrade"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080095 requires="Check-ECM-values"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070096
97 <step name="Run-Rollback"
98 exec="onos ${OC1} issu rollback"
99 requires="Run-Upgrade"/>
100
101 <group name="Phase-2" requires="Run-Rollback">
102 <sequential var="${OCMI#}"
103 starts="Phase-Two-Stop-Service-${#}"
104 ends="Phase-Two-Wait-for-Start-${#-1}">
105 <step name="Phase-Two-Stop-Service-${#}"
106 exec="onos-service ${OCMI#} stop"
107 requires="Run-Rollback"/>
108
109 <step name="Phase-Two-Wait-for-Stop-${#}"
110 exec="onos-wait-for-stop ${OCMI#}"
111 requires="~Phase-Two-Stop-Service-${#}"/>
112
113 <step name="Phase-Two-Uninstall-${#}"
114 exec="onos-uninstall ${OCMI#}"
115 requires="~Phase-Two-Wait-for-Stop-${#}"/>
116
117 <step name="Phase-Two-Push-Bits-${#}"
118 exec="onos-push-bits ${OCMI#}"
119 unless="${OCT}"
120 requires="~Phase-Two-Stop-Service-${#}"/>
121
122 <step name="Phase-Two-Install-Upgrade-${#}"
123 exec="onos-install ${OCMI#}"
124 requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/>
125
126 <step name="Phase-Two-Secure-SSH-${#}"
127 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}"
128 requires="~Phase-Two-Install-Upgrade-${#}"/>
129
130 <step name="Phase-Two-Wait-for-Start-${#}"
131 exec="onos-wait-for-start ${OCMI#}"
132 requires="Phase-Two-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800133
134 <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}"
135 exec="onos-check-apps ${OCMA#} distributedprimitives includes"
136 requires="Phase-Two-Wait-for-Start-${#}"/>
137
138 <step name="Phase-Two-Check-ECM-${#}"
139 exec="onos-execute-expect ${OC#} ec-map-test foo get a --expect d"
140 requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -0700141 </sequential>
142 </group>
143
144 <step name="Reset-Upgrade"
145 exec="onos ${OC1} issu reset"
146 requires="Phase-2"/>
147
148 <group name="Verify-Rollback" requires="Reset-Upgrade">
149 <parallel var="${OC#}">
150 <step name="Check-Nodes-${#}"
151 exec="onos-check-nodes ${OC#}"
152 delay="3"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800153 requires="Verify-EC-Map-${#}"/>
154
Jordan Halterman980a8c12017-09-22 18:01:19 -0700155 <step name="Check-Components-${#}"
156 exec="onos-check-components ${OC#}"
157 delay="5"
158 requires="~Check-Nodes-${#}"/>
159
160 <step name="Check-Logs-${#}"
161 exec="onos-check-logs ${OC#}"
162 requires="~Check-Components-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800163
Jordan Halterman980a8c12017-09-22 18:01:19 -0700164 <step name="Check-Apps-${#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800165 exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes"
Jordan Halterman980a8c12017-09-22 18:01:19 -0700166 requires="~Check-Components-${#}"/>
167 </parallel>
168 </group>
169 </group>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800170</scenario>