blob: a8c29190750f4f6971097df6c6779238d006cc18 [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
23 <step name="Initialize-Upgrade"
Jordan Haltermana57a4722018-03-19 15:44:24 -070024 exec="onos ${OC1} issu init"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070025
26 <group name="Phase-1">
27 <sequential var="${OCMI#}"
28 starts="Phase-One-Stop-Service-${#}"
29 ends="Phase-One-Wait-for-Start-${#-1}">
30 <step name="Phase-One-Stop-Service-${#}"
31 exec="onos-service ${OCMI#} stop"
32 requires="Initialize-Upgrade"/>
33
34 <step name="Phase-One-Wait-for-Stop-${#}"
35 exec="onos-wait-for-stop ${OCMI#}"
36 requires="~Phase-One-Stop-Service-${#}"/>
37
38 <step name="Phase-One-Uninstall-${#}"
39 exec="onos-uninstall ${OCMI#}"
40 requires="~Phase-One-Wait-for-Stop-${#}"/>
41
42 <step name="Phase-One-Push-Bits-${#}"
43 exec="onos-push-bits ${OCMI#}"
44 unless="${OCT}"
45 requires="~Phase-One-Stop-Service-${#}"/>
46
47 <step name="Phase-One-Install-Upgrade-${#}"
48 exec="onos-install -v ${OCMI#}"
49 requires="Phase-One-Push-Bits-${#},Push-Bits,Phase-One-Uninstall-${#}"/>
50
51 <step name="Phase-One-Secure-SSH-${#}"
52 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}"
53 requires="~Phase-One-Install-Upgrade-${#}"/>
54
55 <step name="Phase-One-Wait-for-Start-${#}"
56 exec="onos-wait-for-start ${OCMI#}"
57 requires="Phase-One-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -080058
59 <step name="Phase-One-Distributed-Primitives-Check-Apps-${#}"
60 exec="onos-check-apps ${OCMI#} distributedprimitives includes"
61 requires="Phase-One-Wait-for-Start-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070062 </sequential>
63 </group>
64
65 <step name="Run-Upgrade"
66 exec="onos ${OC1} issu upgrade"
Jordan Haltermana57a4722018-03-19 15:44:24 -070067 requires="Phase-1"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -070068
69 <step name="Run-Rollback"
70 exec="onos ${OC1} issu rollback"
71 requires="Run-Upgrade"/>
72
73 <group name="Phase-2" requires="Run-Rollback">
74 <sequential var="${OCMI#}"
75 starts="Phase-Two-Stop-Service-${#}"
76 ends="Phase-Two-Wait-for-Start-${#-1}">
77 <step name="Phase-Two-Stop-Service-${#}"
78 exec="onos-service ${OCMI#} stop"
79 requires="Run-Rollback"/>
80
81 <step name="Phase-Two-Wait-for-Stop-${#}"
82 exec="onos-wait-for-stop ${OCMI#}"
83 requires="~Phase-Two-Stop-Service-${#}"/>
84
85 <step name="Phase-Two-Uninstall-${#}"
86 exec="onos-uninstall ${OCMI#}"
87 requires="~Phase-Two-Wait-for-Stop-${#}"/>
88
89 <step name="Phase-Two-Push-Bits-${#}"
90 exec="onos-push-bits ${OCMI#}"
91 unless="${OCT}"
92 requires="~Phase-Two-Stop-Service-${#}"/>
93
94 <step name="Phase-Two-Install-Upgrade-${#}"
95 exec="onos-install ${OCMI#}"
96 requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/>
97
98 <step name="Phase-Two-Secure-SSH-${#}"
99 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}"
100 requires="~Phase-Two-Install-Upgrade-${#}"/>
101
102 <step name="Phase-Two-Wait-for-Start-${#}"
103 exec="onos-wait-for-start ${OCMI#}"
104 requires="Phase-Two-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800105
106 <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}"
107 exec="onos-check-apps ${OCMA#} distributedprimitives includes"
108 requires="Phase-Two-Wait-for-Start-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -0700109 </sequential>
110 </group>
111
112 <step name="Reset-Upgrade"
113 exec="onos ${OC1} issu reset"
114 requires="Phase-2"/>
115
116 <group name="Verify-Rollback" requires="Reset-Upgrade">
117 <parallel var="${OC#}">
118 <step name="Check-Nodes-${#}"
119 exec="onos-check-nodes ${OC#}"
Dimitrios Mavrommatis30675ca2017-11-13 18:26:53 -0800120 delay="3"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800121
Jordan Halterman980a8c12017-09-22 18:01:19 -0700122 <step name="Check-Components-${#}"
123 exec="onos-check-components ${OC#}"
124 delay="5"
125 requires="~Check-Nodes-${#}"/>
126
127 <step name="Check-Logs-${#}"
128 exec="onos-check-logs ${OC#}"
129 requires="~Check-Components-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800130
Jordan Halterman980a8c12017-09-22 18:01:19 -0700131 <step name="Check-Apps-${#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800132 exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes"
Jordan Halterman980a8c12017-09-22 18:01:19 -0700133 requires="~Check-Components-${#}"/>
134 </parallel>
135 </group>
136 </group>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800137</scenario>