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