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 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 21 | <step name="Distributed-Primitive-Counter.Test-Counter-Initial-Value" |
| 22 | requires="Distributed-Primitives-Setup" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 23 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 24 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 25 | <step name="Distributed-Primitive-Counter.Test-Counter-Set" |
| 26 | requires="Distributed-Primitive-Counter.Test-Counter-Initial-Value" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 27 | exec="onos ${OCI} counter-test test-counter set 1"/> |
| 28 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 29 | <step name="Distributed-Primitive-Counter.Test-Counter-Get" |
| 30 | 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 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 33 | <step name="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet" |
| 34 | requires="Distributed-Primitive-Counter.Test-Counter-Get" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 35 | exec="onos-execute-expect ${OCI} counter-test test-counter incrementAndGet --expect 2"/> |
| 36 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 37 | <step name="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement" |
| 38 | requires="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 39 | exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/> |
| 40 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 41 | <step name="Distributed-Primitive-Counter.Test-Counter-Incremented" |
| 42 | requires="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 43 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 3"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 44 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 45 | <step name="Distributed-Primitive-Counter.Test-Counter-AddAndGet" |
| 46 | requires="Distributed-Primitive-Counter.Test-Counter-Incremented" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 47 | exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/> |
| 48 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 49 | <step name="Distributed-Primitive-Counter.Test-Counter-GetAndAdd" |
| 50 | requires="Distributed-Primitive-Counter.Test-Counter-AddAndGet" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 51 | exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/> |
| 52 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 53 | <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd" |
| 54 | requires="Distributed-Primitive-Counter.Test-Counter-GetAndAdd" |
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 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 57 | <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False" |
| 58 | requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 59 | exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/> |
| 60 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 61 | <step name="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS" |
| 62 | requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 63 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 64 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 65 | <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True" |
| 66 | requires="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 67 | exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/> |
| 68 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 69 | <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS" |
| 70 | requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 71 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/> |
| 72 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 73 | <step name="Distributed-Primitive-Counter.Test-Counter-Reset" |
| 74 | requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 75 | exec="onos ${OCI} counter-test test-counter set 0"/> |
| 76 | |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 77 | <step name="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset" |
| 78 | requires="Distributed-Primitive-Counter.Test-Counter-Reset" |
Madan Jampani | 145623d | 2016-07-22 14:55:57 -0700 | [diff] [blame] | 79 | exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/> |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 80 | |
| 81 | <!--Check with check logs--> |
Jon Hall | 4ad86cf | 2017-02-16 14:23:38 -0800 | [diff] [blame] | 82 | <step name="Distributed-Primitive-Counter.Check-Log-Exceptions" |
| 83 | requires="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset" |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 84 | exec="onos-check-logs ${OCI}"/> |
| 85 | |
Madan Jampani | 9e1a8c1 | 2016-06-27 11:19:10 -0700 | [diff] [blame] | 86 | </group> |
| 87 | </scenario> |
| 88 | |