blob: 1892b18707d556fa35c72069b13e5b10d725ee73 [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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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 Hallda9fd4a2017-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
Jon Halle4a61002017-02-16 18:37:02 -080081 <group name="Distributed-Primitive-Counter.Check-Log-Exceptions"
82 requires="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset">
83 <parallel var="${OC#}">
84 <step name="Distributed-Primitive-Counter.Check-Log-Exceptions-${#}"
85 exec="onos-check-logs ${OC#}"/>
86 </parallel>
87 </group>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070088
Madan Jampani9e1a8c12016-06-27 11:19:10 -070089 </group>
90</scenario>
91