blob: 57ba15f6ad3a7a08f6c6545574f98b6fafbb4964 [file] [log] [blame]
Madan Jampani9e1a8c12016-06-27 11:19:10 -07001<!--
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 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 Hall4ad86cf2017-02-16 14:23:38 -080021 <step name="Distributed-Primitive-Counter.Test-Counter-Initial-Value"
22 requires="Distributed-Primitives-Setup"
Madan Jampani145623d2016-07-22 14:55:57 -070023 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070024
Jon Hall4ad86cf2017-02-16 14:23:38 -080025 <step name="Distributed-Primitive-Counter.Test-Counter-Set"
26 requires="Distributed-Primitive-Counter.Test-Counter-Initial-Value"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070027 exec="onos ${OCI} counter-test test-counter set 1"/>
28
Jon Hall4ad86cf2017-02-16 14:23:38 -080029 <step name="Distributed-Primitive-Counter.Test-Counter-Get"
30 requires="Distributed-Primitive-Counter.Test-Counter-Set"
Madan Jampani145623d2016-07-22 14:55:57 -070031 exec="onos-cluster-execute-expect counter-test test-counter get --expect 1"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070032
Jon Hall4ad86cf2017-02-16 14:23:38 -080033 <step name="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet"
34 requires="Distributed-Primitive-Counter.Test-Counter-Get"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070035 exec="onos-execute-expect ${OCI} counter-test test-counter incrementAndGet --expect 2"/>
36
Jon Hall4ad86cf2017-02-16 14:23:38 -080037 <step name="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement"
38 requires="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070039 exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/>
40
Jon Hall4ad86cf2017-02-16 14:23:38 -080041 <step name="Distributed-Primitive-Counter.Test-Counter-Incremented"
42 requires="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement"
Madan Jampani145623d2016-07-22 14:55:57 -070043 exec="onos-cluster-execute-expect counter-test test-counter get --expect 3"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070044
Jon Hall4ad86cf2017-02-16 14:23:38 -080045 <step name="Distributed-Primitive-Counter.Test-Counter-AddAndGet"
46 requires="Distributed-Primitive-Counter.Test-Counter-Incremented"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070047 exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/>
48
Jon Hall4ad86cf2017-02-16 14:23:38 -080049 <step name="Distributed-Primitive-Counter.Test-Counter-GetAndAdd"
50 requires="Distributed-Primitive-Counter.Test-Counter-AddAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070051 exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/>
52
Jon Hall4ad86cf2017-02-16 14:23:38 -080053 <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd"
54 requires="Distributed-Primitive-Counter.Test-Counter-GetAndAdd"
Madan Jampani145623d2016-07-22 14:55:57 -070055 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070056
Jon Hall4ad86cf2017-02-16 14:23:38 -080057 <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False"
58 requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070059 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/>
60
Jon Hall4ad86cf2017-02-16 14:23:38 -080061 <step name="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS"
62 requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False"
Madan Jampani145623d2016-07-22 14:55:57 -070063 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070064
Jon Hall4ad86cf2017-02-16 14:23:38 -080065 <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True"
66 requires="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070067 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/>
68
Jon Hall4ad86cf2017-02-16 14:23:38 -080069 <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS"
70 requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True"
Madan Jampani145623d2016-07-22 14:55:57 -070071 exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/>
72
Jon Hall4ad86cf2017-02-16 14:23:38 -080073 <step name="Distributed-Primitive-Counter.Test-Counter-Reset"
74 requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS"
Madan Jampani145623d2016-07-22 14:55:57 -070075 exec="onos ${OCI} counter-test test-counter set 0"/>
76
Jon Hall4ad86cf2017-02-16 14:23:38 -080077 <step name="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset"
78 requires="Distributed-Primitive-Counter.Test-Counter-Reset"
Madan Jampani145623d2016-07-22 14:55:57 -070079 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070080
81 <!--Check with check logs-->
Jon Hall4ad86cf2017-02-16 14:23:38 -080082 <step name="Distributed-Primitive-Counter.Check-Log-Exceptions"
83 requires="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070084 exec="onos-check-logs ${OCI}"/>
85
Madan Jampani9e1a8c12016-06-27 11:19:10 -070086 </group>
87</scenario>
88