Jordan Halterman | 3c65d1b | 2018-01-09 13:01:03 -0800 | [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="ha-upgrade" description="ONOS cluster upgrade fault tolerance"> |
| 17 | <import file="${ONOS_SCENARIOS}/dist-setup.xml"/> |
| 18 | <dependency name="Distributed-Primitives-Setup"/> |
| 19 | |
| 20 | <group name="HA-Upgrade" requires="Distributed-Primitives-Setup"> |
| 21 | <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> |
| 22 | |
| 23 | <step name="Initialize-ECM" |
| 24 | exec="onos ${OC1} ec-map-test foo put a b"/> |
| 25 | |
| 26 | <step name="Initialize-CM" |
| 27 | exec="onos ${OC1} map-test foo put a b" |
| 28 | requires="Initialize-ECM"/> |
| 29 | |
| 30 | <step name="Initialize-Upgrade" |
| 31 | exec="onos ${OC1} issu init" |
| 32 | requires="Initialize-CM"/> |
| 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-${#}"/> |
| 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-${#}" |
| 72 | exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --retry 5 --expect b" |
| 73 | requires="Phase-One-Distributed-Primitives-Check-Apps-${#}"/> |
| 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-${#}"/> |
| 78 | </sequential> |
| 79 | </group> |
| 80 | |
| 81 | <step name="Run-Upgrade" |
| 82 | exec="onos ${OC1} issu upgrade" |
| 83 | requires="Phase-1"/> |
| 84 | |
| 85 | <step name="Kill-Upgraded-Node" |
| 86 | exec="onos-power ${OCMI1} off" |
| 87 | requires="Run-Upgrade"/> |
| 88 | |
| 89 | <step name="Wait-For-Downgrade" |
| 90 | exec="onos-check-issu-status ROLLED_BACK" |
| 91 | requires="Kill-Upgraded-Node"/> |
| 92 | |
| 93 | <group name="Phase-2"> |
| 94 | <sequential var="${OCMI#}" |
| 95 | starts="Phase-Two-Stop-Service-${#}" |
| 96 | ends="Phase-Two-Wait-for-Start-${#-1}"> |
| 97 | <step name="Phase-Two-Stop-Service-${#}" |
| 98 | exec="onos-service ${OCMI#} stop" |
| 99 | requires="Wait-For-Downgrade"/> |
| 100 | |
| 101 | <step name="Phase-Two-Wait-for-Stop-${#}" |
| 102 | exec="onos-wait-for-stop ${OCMI#}" |
| 103 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 104 | |
| 105 | <step name="Phase-Two-Uninstall-${#}" |
| 106 | exec="onos-uninstall ${OCMI#}" |
| 107 | requires="~Phase-Two-Wait-for-Stop-${#}"/> |
| 108 | |
| 109 | <step name="Phase-Two-Push-Bits-${#}" |
| 110 | exec="onos-push-bits ${OCMI#}" |
| 111 | unless="${OCT}" |
| 112 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 113 | |
| 114 | <step name="Phase-Two-Install-Downgrade-${#}" |
| 115 | exec="onos-install ${OCMI#}" |
| 116 | requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/> |
| 117 | |
| 118 | <step name="Phase-Two-Secure-SSH-${#}" |
| 119 | exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}" |
| 120 | requires="~Phase-Two-Install-Downgrade-${#}"/> |
| 121 | |
| 122 | <step name="Phase-Two-Wait-for-Start-${#}" |
| 123 | exec="onos-wait-for-start ${OCMI#}" |
| 124 | requires="Phase-Two-Secure-SSH-${#}"/> |
| 125 | |
| 126 | <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}" |
| 127 | exec="onos-check-apps ${OCMI#} distributedprimitives includes" |
| 128 | requires="Phase-Two-Wait-for-Start-${#}"/> |
| 129 | |
| 130 | <step name="Phase-Two-Check-ECM-${#}" |
| 131 | exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --retry 5 --expect b" |
| 132 | requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/> |
| 133 | |
| 134 | <step name="Phase-Two-Check-CM-${#}" |
| 135 | exec="onos-execute-expect ${OCMI#} map-test foo get a --retry 5 --expect b" |
| 136 | requires="Phase-Two-Check-ECM-${#}"/> |
| 137 | </sequential> |
| 138 | </group> |
| 139 | |
| 140 | <step name="Reset-Downgrade" |
| 141 | exec="onos ${OC1} issu reset" |
| 142 | requires="Phase-2"/> |
| 143 | |
| 144 | <group name="Verify-Upgrade" requires="Reset-Downgrade"> |
| 145 | <parallel var="${OC#}"> |
| 146 | <step name="Check-Nodes-${#}" |
| 147 | exec="onos-check-nodes ${OC#}" |
| 148 | delay="3"/> |
| 149 | |
| 150 | <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-${#}"/> |
| 158 | |
| 159 | <step name="Check-Apps-${#}" |
| 160 | exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes" |
| 161 | requires="~Check-Components-${#}"/> |
| 162 | </parallel> |
| 163 | </group> |
| 164 | </group> |
| 165 | </scenario> |