dist-leader.xml 2.42 KB
<!--
  ~ Copyright 2016-present Open Networking Laboratory
  ~
  ~ 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="distributed-leader-elector-test"
          description="ONOS LeaderElector distributed primitive Test">
    <group name="Distributed-Primitive-Leader">

        <step name="Distributed-Primitive-Leader.Activate-Distributed-Primitives-App"
            exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>

        <step name="Distributed-Primitive-Leader.Test-Initial-No-Leader" requires="Distributed-Primitive-Leader.Activate-Distributed-Primitives-App"
              exec="onos-cluster-execute-expect leader-test test-elector show foo --expect leader=none#candidates=none"/>

        <step name="Distributed-Primitive-Leader.Test-Leader-Run" requires="Distributed-Primitive-Leader.Test-Initial-No-Leader"
              exec="onos-execute-expect ${OCI} leader-test test-elector run foo --expect leader=${OCI}#term=[0-9][0-9]*#candidates=${OCI}"/>

        <step name="Distributed-Primitive-Leader.Test-Leader-Withdraw" requires="Distributed-Primitive-Leader.Test-Leader-Run"
              exec="onos ${OCI} leader-test test-elector withdraw foo"/>

        <step name="Distributed-Primitive-Leader.Test-No-Leader-After-Withdraw" requires="Distributed-Primitive-Leader.Test-Leader-Withdraw"
              exec="onos-cluster-execute-expect leader-test test-elector show foo --expect leader=none#candidates=none"/>

        <!--Check with check logs-->
        <step name="Distributed-Primitive-Leader.Check-Log-Exceptions" requires="Distributed-Primitive-Leader.Test-No-Leader-After-Withdraw"
              exec="onos-check-logs ${OCI}"/>

        <step name="Distributed-Primitive-Leader.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Leader.Check-Log-Exceptions"
              exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
    </group>
</scenario>