Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 1 | <!-- |
| 2 | ~ Copyright 2016-present Open Networking Laboratory |
| 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 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 17 | <scenario name="distributed-counter-test" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 18 | description="ONOS AtomicCounter distributed primitive Test"> |
| 19 | <group name="Distributed-Primitive-Counter"> |
| 20 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 21 | <step name="Distributed-Primitive-Counter.Activate-Distributed-Primitives-App" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 22 | exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/> |
| 23 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 24 | <step name="Distributed-Primitive-Counter.Test-Counter-Initial-Value" requires="Distributed-Primitive-Counter.Activate-Distributed-Primitives-App" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 25 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 26 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 27 | <step name="Distributed-Primitive-Counter.Test-Counter-Set" requires="Distributed-Primitive-Counter.Test-Counter-Initial-Value" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 28 | exec="onos ${OCI} counter-test test-counter set 1"/> |
| 29 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 30 | <step name="Distributed-Primitive-Counter.Test-Counter-Get" requires="Distributed-Primitive-Counter.Test-Counter-Set" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 31 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 1"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 32 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 33 | <step name="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet" requires="Distributed-Primitive-Counter.Test-Counter-Get" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 34 | exec="onos-execute-expect ${OCI} counter-test test-counter incrementAndGet --expect 2"/> |
| 35 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 36 | <step name="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement" requires="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 37 | exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/> |
| 38 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 39 | <step name="Distributed-Primitive-Counter.Test-Counter-Incremented" requires="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 40 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 3"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 41 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 42 | <step name="Distributed-Primitive-Counter.Test-Counter-AddAndGet" requires="Distributed-Primitive-Counter.Test-Counter-Incremented" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 43 | exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/> |
| 44 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 45 | <step name="Distributed-Primitive-Counter.Test-Counter-GetAndAdd" requires="Distributed-Primitive-Counter.Test-Counter-AddAndGet" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 46 | exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/> |
| 47 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 48 | <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd" requires="Distributed-Primitive-Counter.Test-Counter-GetAndAdd" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 49 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 50 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 51 | <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False" requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 52 | exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/> |
| 53 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 54 | <step name="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS" requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 55 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 56 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 57 | <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True" requires="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 58 | exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/> |
| 59 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 60 | <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS" requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 61 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/> |
| 62 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 63 | <step name="Distributed-Primitive-Counter.Test-Counter-Reset" requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 64 | exec="onos ${OCI} counter-test test-counter set 0"/> |
| 65 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 66 | <step name="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset" requires="Distributed-Primitive-Counter.Test-Counter-Reset" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 67 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 68 | |
| 69 | <!--Check with check logs--> |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 70 | <step name="Distributed-Primitive-Counter.Check-Log-Exceptions" requires="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 71 | exec="onos-check-logs ${OCI}"/> |
| 72 | |
Ray Milkey | 685e34d | 2016-09-01 12:01:09 -0700 | [diff] [blame] | 73 | <step name="Distributed-Primitive-Counter.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Counter.Check-Log-Exceptions" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 74 | exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/> |
| 75 | </group> |
| 76 | </scenario> |
| 77 | |