blob: 16fc6271d1a4c7fbf75e31071934814e332f6a92 [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
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 <group name="Phase-2" requires="Run-Upgrade">
98 <sequential var="${OCMA#}"
99 starts="Phase-Two-Stop-Service-${#}"
100 ends="Phase-Two-Wait-for-Start-${#-1}">
101 <step name="Phase-Two-Stop-Service-${#}"
102 exec="onos-service ${OCMA#} stop"
103 requires="Run-Upgrade"/>
104
105 <step name="Phase-Two-Wait-for-Stop-${#}"
106 exec="onos-wait-for-stop ${OCMA#}"
107 requires="~Phase-Two-Stop-Service-${#}"/>
108
109 <step name="Phase-Two-Uninstall-${#}"
110 exec="onos-uninstall ${OCMA#}"
111 requires="~Phase-Two-Wait-for-Stop-${#}"/>
112
113 <step name="Phase-Two-Push-Bits-${#}"
114 exec="onos-push-bits ${OCMA#}"
115 unless="${OCT}"
116 requires="~Phase-Two-Stop-Service-${#}"/>
117
118 <step name="Phase-Two-Install-Upgrade-${#}"
119 exec="onos-install -v ${OCMA#}"
120 requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/>
121
122 <step name="Phase-Two-Secure-SSH-${#}"
123 exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMA#}"
124 requires="~Phase-Two-Install-Upgrade-${#}"/>
125
126 <step name="Phase-Two-Wait-for-Start-${#}"
127 exec="onos-wait-for-start ${OCMA#}"
128 requires="Phase-Two-Secure-SSH-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800129
130 <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}"
131 exec="onos-check-apps ${OCMA#} distributedprimitives includes"
132 requires="Phase-Two-Wait-for-Start-${#}"/>
133
134 <step name="Phase-Two-Check-ECM-${#}"
135 exec="onos-execute-expect ${OC#} ec-map-test foo get a --expect c"
136 requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/>
Jordan Halterman980a8c12017-09-22 18:01:19 -0700137 </sequential>
138 </group>
139
140 <step name="Commit-Upgrade"
141 exec="onos ${OC1} issu commit"
142 requires="Phase-2"/>
143
144 <group name="Verify-Upgrade" requires="Commit-Upgrade">
145 <parallel var="${OC#}">
146 <step name="Check-Nodes-${#}"
147 exec="onos-check-nodes ${OC#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800148 delay="3"/>
149
Jordan Halterman980a8c12017-09-22 18:01:19 -0700150 <step name="Check-Components-${#}"
151 exec="onos-check-components ${OC#}"
152 delay="5"
153 requires="~Check-Nodes-${#}"/>
154
155 <step name="Check-Logs-${#}"
156 exec="onos-check-logs ${OC#}"
157 requires="~Check-Components-${#}"/>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800158
Jordan Halterman980a8c12017-09-22 18:01:19 -0700159 <step name="Check-Apps-${#}"
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800160 exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes"
Jordan Halterman980a8c12017-09-22 18:01:19 -0700161 requires="~Check-Components-${#}"/>
162 </parallel>
163 </group>
164 </group>
Dimitrios Mavrommatis03728eb2017-11-06 13:09:07 -0800165</scenario>