blob: ca3c6b1eb373e09a8e811bb461bc2a8633e19e7d [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
Ray Milkey685e34d2016-09-01 12:01:09 -070021 <step name="Distributed-Primitive-Counter.Activate-Distributed-Primitives-App"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070022 exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
23
Ray Milkey685e34d2016-09-01 12:01:09 -070024 <step name="Distributed-Primitive-Counter.Test-Counter-Initial-Value" requires="Distributed-Primitive-Counter.Activate-Distributed-Primitives-App"
Madan Jampani145623d2016-07-22 14:55:57 -070025 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070026
Ray Milkey685e34d2016-09-01 12:01:09 -070027 <step name="Distributed-Primitive-Counter.Test-Counter-Set" requires="Distributed-Primitive-Counter.Test-Counter-Initial-Value"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070028 exec="onos ${OCI} counter-test test-counter set 1"/>
29
Ray Milkey685e34d2016-09-01 12:01:09 -070030 <step name="Distributed-Primitive-Counter.Test-Counter-Get" 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
Ray Milkey685e34d2016-09-01 12:01:09 -070033 <step name="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet" 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
Ray Milkey685e34d2016-09-01 12:01:09 -070036 <step name="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement" requires="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070037 exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/>
38
Ray Milkey685e34d2016-09-01 12:01:09 -070039 <step name="Distributed-Primitive-Counter.Test-Counter-Incremented" requires="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement"
Madan Jampani145623d2016-07-22 14:55:57 -070040 exec="onos-cluster-execute-expect counter-test test-counter get --expect 3"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070041
Ray Milkey685e34d2016-09-01 12:01:09 -070042 <step name="Distributed-Primitive-Counter.Test-Counter-AddAndGet" requires="Distributed-Primitive-Counter.Test-Counter-Incremented"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070043 exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/>
44
Ray Milkey685e34d2016-09-01 12:01:09 -070045 <step name="Distributed-Primitive-Counter.Test-Counter-GetAndAdd" requires="Distributed-Primitive-Counter.Test-Counter-AddAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070046 exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/>
47
Ray Milkey685e34d2016-09-01 12:01:09 -070048 <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd" requires="Distributed-Primitive-Counter.Test-Counter-GetAndAdd"
Madan Jampani145623d2016-07-22 14:55:57 -070049 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070050
Ray Milkey685e34d2016-09-01 12:01:09 -070051 <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False" requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070052 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/>
53
Ray Milkey685e34d2016-09-01 12:01:09 -070054 <step name="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS" requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False"
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
Ray Milkey685e34d2016-09-01 12:01:09 -070057 <step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True" requires="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070058 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/>
59
Ray Milkey685e34d2016-09-01 12:01:09 -070060 <step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS" requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True"
Madan Jampani145623d2016-07-22 14:55:57 -070061 exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/>
62
Ray Milkey685e34d2016-09-01 12:01:09 -070063 <step name="Distributed-Primitive-Counter.Test-Counter-Reset" requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS"
Madan Jampani145623d2016-07-22 14:55:57 -070064 exec="onos ${OCI} counter-test test-counter set 0"/>
65
Ray Milkey685e34d2016-09-01 12:01:09 -070066 <step name="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset" requires="Distributed-Primitive-Counter.Test-Counter-Reset"
Madan Jampani145623d2016-07-22 14:55:57 -070067 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070068
69 <!--Check with check logs-->
Ray Milkey685e34d2016-09-01 12:01:09 -070070 <step name="Distributed-Primitive-Counter.Check-Log-Exceptions" requires="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070071 exec="onos-check-logs ${OCI}"/>
72
Ray Milkey685e34d2016-09-01 12:01:09 -070073 <step name="Distributed-Primitive-Counter.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Counter.Check-Log-Exceptions"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070074 exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
75 </group>
76</scenario>
77