| <!-- |
| ~ Copyright 2017-present Open Networking Foundation |
| ~ |
| ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| ~ you may not use this file except in compliance with the License. |
| ~ You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, software |
| ~ distributed under the License is distributed on an "AS IS" BASIS, |
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| ~ See the License for the specific language governing permissions and |
| ~ limitations under the License. |
| --> |
| <scenario name="upgrade-rollback" description="ONOS cluster upgrade and rollback"> |
| <import file="${ONOS_SCENARIOS}/dist-setup.xml"/> |
| <dependency name="Distributed-Primitives-Setup"/> |
| |
| <group name="Upgrade-Rollback" requires="Distributed-Primitives-Setup"> |
| <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> |
| |
| <step name="Initialize-Upgrade" |
| exec="onos ${OC1} issu init"/> |
| |
| <group name="Phase-1"> |
| <sequential var="${OCMI#}" |
| starts="Phase-One-Stop-Service-${#}" |
| ends="Phase-One-Wait-for-Start-${#-1}"> |
| <step name="Phase-One-Stop-Service-${#}" |
| exec="onos-service ${OCMI#} stop" |
| requires="Initialize-Upgrade"/> |
| |
| <step name="Phase-One-Wait-for-Stop-${#}" |
| exec="onos-wait-for-stop ${OCMI#}" |
| requires="~Phase-One-Stop-Service-${#}"/> |
| |
| <step name="Phase-One-Uninstall-${#}" |
| exec="onos-uninstall ${OCMI#}" |
| requires="~Phase-One-Wait-for-Stop-${#}"/> |
| |
| <step name="Phase-One-Push-Bits-${#}" |
| exec="onos-push-bits ${OCMI#}" |
| unless="${OCT}" |
| requires="~Phase-One-Stop-Service-${#}"/> |
| |
| <step name="Phase-One-Install-Upgrade-${#}" |
| exec="onos-install -v ${OCMI#}" |
| requires="Phase-One-Push-Bits-${#},Push-Bits,Phase-One-Uninstall-${#}"/> |
| |
| <step name="Phase-One-Secure-SSH-${#}" |
| exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}" |
| requires="~Phase-One-Install-Upgrade-${#}"/> |
| |
| <step name="Phase-One-Wait-for-Start-${#}" |
| exec="onos-wait-for-start ${OCMI#}" |
| requires="Phase-One-Secure-SSH-${#}"/> |
| |
| <step name="Phase-One-Distributed-Primitives-Check-Apps-${#}" |
| exec="onos-check-apps ${OCMI#} distributedprimitives includes" |
| requires="Phase-One-Wait-for-Start-${#}"/> |
| </sequential> |
| </group> |
| |
| <step name="Run-Upgrade" |
| exec="onos ${OC1} issu upgrade" |
| requires="Phase-1"/> |
| |
| <step name="Run-Rollback" |
| exec="onos ${OC1} issu rollback" |
| requires="Run-Upgrade"/> |
| |
| <group name="Phase-2" requires="Run-Rollback"> |
| <sequential var="${OCMI#}" |
| starts="Phase-Two-Stop-Service-${#}" |
| ends="Phase-Two-Wait-for-Start-${#-1}"> |
| <step name="Phase-Two-Stop-Service-${#}" |
| exec="onos-service ${OCMI#} stop" |
| requires="Run-Rollback"/> |
| |
| <step name="Phase-Two-Wait-for-Stop-${#}" |
| exec="onos-wait-for-stop ${OCMI#}" |
| requires="~Phase-Two-Stop-Service-${#}"/> |
| |
| <step name="Phase-Two-Uninstall-${#}" |
| exec="onos-uninstall ${OCMI#}" |
| requires="~Phase-Two-Wait-for-Stop-${#}"/> |
| |
| <step name="Phase-Two-Push-Bits-${#}" |
| exec="onos-push-bits ${OCMI#}" |
| unless="${OCT}" |
| requires="~Phase-Two-Stop-Service-${#}"/> |
| |
| <step name="Phase-Two-Install-Upgrade-${#}" |
| exec="onos-install ${OCMI#}" |
| requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/> |
| |
| <step name="Phase-Two-Secure-SSH-${#}" |
| exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}" |
| requires="~Phase-Two-Install-Upgrade-${#}"/> |
| |
| <step name="Phase-Two-Wait-for-Start-${#}" |
| exec="onos-wait-for-start ${OCMI#}" |
| requires="Phase-Two-Secure-SSH-${#}"/> |
| |
| <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}" |
| exec="onos-check-apps ${OCMA#} distributedprimitives includes" |
| requires="Phase-Two-Wait-for-Start-${#}"/> |
| </sequential> |
| </group> |
| |
| <step name="Reset-Upgrade" |
| exec="onos ${OC1} issu reset" |
| requires="Phase-2"/> |
| |
| <group name="Verify-Rollback" requires="Reset-Upgrade"> |
| <parallel var="${OC#}"> |
| <step name="Check-Nodes-${#}" |
| exec="onos-check-nodes ${OC#}" |
| delay="3"/> |
| |
| <step name="Check-Components-${#}" |
| exec="onos-check-components ${OC#}" |
| delay="5" |
| requires="~Check-Nodes-${#}"/> |
| |
| <step name="Check-Logs-${#}" |
| exec="onos-check-logs ${OC#}" |
| requires="~Check-Components-${#}"/> |
| |
| <step name="Check-Apps-${#}" |
| exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes" |
| requires="~Check-Components-${#}"/> |
| </parallel> |
| </group> |
| </group> |
| </scenario> |