blob: 425650f72ef023ce4be2ff6eb62c086db14a3b13 [file] [log] [blame]
Madan Jampani9e1a8c12016-06-27 11:19:10 -07001<!--
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 ~ Copyright 2016-present Open Networking Foundation
Madan Jampani9e1a8c12016-06-27 11:19:10 -07003 ~
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 Milkey685e34d2016-09-01 12:01:09 -070017<scenario name="distributed-counter-test"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070018 description="ONOS AtomicCounter distributed primitive Test">
19 <group name="Distributed-Primitive-Counter">
20
Jon Hallda9fd4a2017-02-16 14:23:38 -080021 <step name="Distributed-Primitive-Counter.Test-Counter-Initial-Value"
Madan Jampani145623d2016-07-22 14:55:57 -070022 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070023
Jon Hallda9fd4a2017-02-16 14:23:38 -080024 <step name="Distributed-Primitive-Counter.Test-Counter-Set"
25 requires="Distributed-Primitive-Counter.Test-Counter-Initial-Value"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070026 exec="onos ${OCI} counter-test test-counter set 1"/>
27
Jon Hallda9fd4a2017-02-16 14:23:38 -080028 <step name="Distributed-Primitive-Counter.Test-Counter-Get"
29 requires="Distributed-Primitive-Counter.Test-Counter-Set"
Madan Jampani145623d2016-07-22 14:55:57 -070030 exec="onos-cluster-execute-expect counter-test test-counter get --expect 1"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070031
Jon Hallda9fd4a2017-02-16 14:23:38 -080032 <step name="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet"
33 requires="Distributed-Primitive-Counter.Test-Counter-Get"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070034 exec="onos-execute-expect ${OCI} counter-test test-counter incrementAndGet --expect 2"/>
35
Jon Hallda9fd4a2017-02-16 14:23:38 -080036 <step name="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement"
37 requires="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070038 exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/>
39
Jon Hallda9fd4a2017-02-16 14:23:38 -080040 <step name="Distributed-Primitive-Counter.Test-Counter-Incremented"
41 requires="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement"
Madan Jampani145623d2016-07-22 14:55:57 -070042 exec="onos-cluster-execute-expect counter-test test-counter get --expect 3"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070043
Jon Hallda9fd4a2017-02-16 14:23:38 -080044 <step name="Distributed-Primitive-Counter.Test-Counter-AddAndGet"
45 requires="Distributed-Primitive-Counter.Test-Counter-Incremented"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070046 exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/>
47
Jon Hallda9fd4a2017-02-16 14:23:38 -080048 <step name="Distributed-Primitive-Counter.Test-Counter-GetAndAdd"
49 requires="Distributed-Primitive-Counter.Test-Counter-AddAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070050 exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/>
51
Jon Hallda9fd4a2017-02-16 14:23:38 -080052 <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd"
53 requires="Distributed-Primitive-Counter.Test-Counter-GetAndAdd"
Madan Jampani145623d2016-07-22 14:55:57 -070054 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070055
Jon Hallda9fd4a2017-02-16 14:23:38 -080056 <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False"
57 requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070058 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/>
59
Jon Hallda9fd4a2017-02-16 14:23:38 -080060 <step name="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS"
61 requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False"
Madan Jampani145623d2016-07-22 14:55:57 -070062 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070063
Jon Hallda9fd4a2017-02-16 14:23:38 -080064 <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True"
65 requires="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070066 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/>
67
Jon Hallda9fd4a2017-02-16 14:23:38 -080068 <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS"
69 requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True"
Madan Jampani145623d2016-07-22 14:55:57 -070070 exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/>
71
Jon Hallda9fd4a2017-02-16 14:23:38 -080072 <step name="Distributed-Primitive-Counter.Test-Counter-Reset"
73 requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS"
Madan Jampani145623d2016-07-22 14:55:57 -070074 exec="onos ${OCI} counter-test test-counter set 0"/>
75
Jon Hallda9fd4a2017-02-16 14:23:38 -080076 <step name="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset"
77 requires="Distributed-Primitive-Counter.Test-Counter-Reset"
Madan Jampani145623d2016-07-22 14:55:57 -070078 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070079
Jon Halle4a61002017-02-16 18:37:02 -080080 <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 Jampani9e1a8c12016-06-27 11:19:10 -070087
Madan Jampani9e1a8c12016-06-27 11:19:10 -070088 </group>
89</scenario>
90