| <!-- |
| ~ 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" description="ONOS cluster upgrade"> |
| <import file="${ONOS_SCENARIOS}/dist-setup.xml"/> |
| <dependency name="Distributed-Primitives-Setup"/> |
| |
| <group name="Upgrade" requires="Distributed-Primitives-Setup"> |
| <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> |
| |
| <step name="Initialize-ECM" |
| exec="onos ${OC1} ec-map-test foo put a b"/> |
| |
| <step name="Initialize-Upgrade" |
| exec="onos ${OC1} issu init" |
| requires="Initialize-ECM"/> |
| |
| <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-${#}"/> |
| |
| <step name="Phase-One-Check-ECM-${#}" |
| exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --expect b" |
| requires="Phase-One-Distributed-Primitives-Check-Apps-${#}"/> |
| </sequential> |
| </group> |
| |
| <group name="Change-ECM-values" requires="Phase-1"> |
| <step name="Change-Majority-ECM" |
| exec="onos ${OCMA1} ec-map-test foo put a d"/> |
| |
| <step name="Change-Minority-ECM" |
| exec="onos ${OCMI1} ec-map-test foo put a c"/> |
| </group> |
| |
| <group name="Check-ECM-values" requires="Change-ECM-values"> |
| <parallel var="${OCMI#}"> |
| <step name="Parallel-Check-Minority-ECM-${#}" |
| exec="onos-execute-expect ${OCMI#} ec-map-test foo get a --expect c"/> |
| </parallel> |
| |
| <parallel var="${OCMA#}"> |
| <step name="Parallel-Check-Majority-ECM-${#}" |
| exec="onos-execute-expect ${OCMA#} ec-map-test foo get a --expect d"/> |
| </parallel> |
| </group> |
| |
| <step name="Run-Upgrade" |
| exec="onos ${OC1} issu upgrade" |
| requires="Check-ECM-values"/> |
| |
| <group name="Phase-2" requires="Run-Upgrade"> |
| <sequential var="${OCMA#}" |
| starts="Phase-Two-Stop-Service-${#}" |
| ends="Phase-Two-Wait-for-Start-${#-1}"> |
| <step name="Phase-Two-Stop-Service-${#}" |
| exec="onos-service ${OCMA#} stop" |
| requires="Run-Upgrade"/> |
| |
| <step name="Phase-Two-Wait-for-Stop-${#}" |
| exec="onos-wait-for-stop ${OCMA#}" |
| requires="~Phase-Two-Stop-Service-${#}"/> |
| |
| <step name="Phase-Two-Uninstall-${#}" |
| exec="onos-uninstall ${OCMA#}" |
| requires="~Phase-Two-Wait-for-Stop-${#}"/> |
| |
| <step name="Phase-Two-Push-Bits-${#}" |
| exec="onos-push-bits ${OCMA#}" |
| unless="${OCT}" |
| requires="~Phase-Two-Stop-Service-${#}"/> |
| |
| <step name="Phase-Two-Install-Upgrade-${#}" |
| exec="onos-install -v ${OCMA#}" |
| 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} ${OCMA#}" |
| requires="~Phase-Two-Install-Upgrade-${#}"/> |
| |
| <step name="Phase-Two-Wait-for-Start-${#}" |
| exec="onos-wait-for-start ${OCMA#}" |
| 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-${#}"/> |
| |
| <step name="Phase-Two-Check-ECM-${#}" |
| exec="onos-execute-expect ${OC#} ec-map-test foo get a --expect c" |
| requires="Phase-Two-Distributed-Primitives-Check-Apps-${#}"/> |
| </sequential> |
| </group> |
| |
| <step name="Commit-Upgrade" |
| exec="onos ${OC1} issu commit" |
| requires="Phase-2"/> |
| |
| <group name="Verify-Upgrade" requires="Commit-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> |