Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 1 | <!-- |
| 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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 17 | <import file="${ONOS_SCENARIOS}/dist-setup.xml"/> |
| 18 | <dependency name="Distributed-Primitives-Setup"/> |
| 19 | |
| 20 | <group name="Upgrade" requires="Distributed-Primitives-Setup"> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 21 | <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> |
| 22 | |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 23 | <step name="Initialize-ECM" |
| 24 | exec="onos ${OC1} ec-map-test foo put a b"/> |
| 25 | |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 26 | <step name="Initialize-CM" |
| 27 | exec="onos ${OC1} map-test foo put a b" |
| 28 | requires="Initialize-ECM"/> |
| 29 | |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 30 | <step name="Initialize-Upgrade" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 31 | exec="onos ${OC1} issu init" |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 32 | requires="Initialize-CM"/> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 33 | |
| 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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 66 | |
| 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 Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 72 | exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --retry 5 --expect b" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 73 | requires="Phase-One-Distributed-Primitives-Check-Apps-${#}"/> |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 74 | |
| 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 Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 78 | </sequential> |
| 79 | </group> |
| 80 | |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 81 | <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 Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 85 | <step name="Change-Majority-CM" |
| 86 | exec="onos ${OCMA1} map-test foo put a d"/> |
| 87 | |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 88 | <step name="Change-Minority-ECM" |
| 89 | exec="onos ${OCMI1} ec-map-test foo put a c"/> |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 90 | |
| 91 | <step name="Change-Minority-CM" |
| 92 | exec="onos ${OCMI1} map-test foo put a c"/> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 93 | </group> |
| 94 | |
| 95 | <group name="Check-ECM-values" requires="Change-ECM-values"> |
| 96 | <parallel var="${OCMI#}"> |
| 97 | <step name="Parallel-Check-Minority-ECM-${#}" |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 98 | 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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 102 | </parallel> |
| 103 | |
| 104 | <parallel var="${OCMA#}"> |
| 105 | <step name="Parallel-Check-Majority-ECM-${#}" |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 106 | 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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 110 | </parallel> |
| 111 | </group> |
| 112 | |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 113 | <step name="Run-Upgrade" |
| 114 | exec="onos ${OC1} issu upgrade" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 115 | requires="Check-ECM-values"/> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 116 | |
| 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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 149 | |
| 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 Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 155 | exec="onos-execute-expect ${OC#} ec-map-test foo get a --retry 5 --expect c" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 156 | requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/> |
Dimitrios Mavrommatis | 30675ca | 2017-11-13 18:26:53 -0800 | [diff] [blame] | 157 | |
| 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 Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 161 | </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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 172 | delay="3"/> |
| 173 | |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 174 | <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 Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 182 | |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 183 | <step name="Check-Apps-${#}" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 184 | exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes" |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 185 | requires="~Check-Components-${#}"/> |
| 186 | </parallel> |
| 187 | </group> |
| 188 | </group> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 189 | </scenario> |