blob: 83c27422a61d5e1fda903fc4eb26c6f835ffc7f9 [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
17<scenario name="distributed counter test"
18 description="ONOS AtomicCounter distributed primitive Test">
19 <group name="Distributed-Primitive-Counter">
20
21 <!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
22 <dependency name="Setup" requires="Prerequisites"/>-->
23
24 <step name="Activate-Distributed-Primitives-App"
25 exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
26
27 <step name="Test-Counter-Initial-Value" requires="^"
Madan Jampani145623d2016-07-22 14:55:57 -070028 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070029
30 <step name="Test-Counter-Set" requires="^"
31 exec="onos ${OCI} counter-test test-counter set 1"/>
32
33 <step name="Test-Counter-Get" requires="^"
Madan Jampani145623d2016-07-22 14:55:57 -070034 exec="onos-cluster-execute-expect counter-test test-counter get --expect 1"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070035
36 <step name="Test-Counter-IncrementAndGet" requires="^"
37 exec="onos-execute-expect ${OCI} counter-test test-counter incrementAndGet --expect 2"/>
38
39 <step name="Test-Counter-GetAndIncrement" requires="^"
40 exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/>
41
42 <step name="Test-Counter-Incremented" requires="^"
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
45 <step name="Test-Counter-AddAndGet" requires="^"
46 exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/>
47
48 <step name="Test-Counter-GetAndAdd" requires="^"
49 exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/>
50
51 <step name="Test-Counter-Updated-After-GetAndAdd" requires="^"
Madan Jampani145623d2016-07-22 14:55:57 -070052 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070053
54 <step name="Test-Counter-CompareAndSet-False" requires="^"
55 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/>
56
57 <step name="Test-Counter-Not-Updated-After-CAS" requires="^"
Madan Jampani145623d2016-07-22 14:55:57 -070058 exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070059
60 <step name="Test-Counter-CompareAndSet-True" requires="^"
61 exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/>
62
63 <step name="Test-Counter-Updated-After-CAS" requires="^"
Madan Jampani145623d2016-07-22 14:55:57 -070064 exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/>
65
66 <step name="Test-Counter-Reset" requires="^"
67 exec="onos ${OCI} counter-test test-counter set 0"/>
68
69 <step name="Test-Counter-Get-After-Reset" requires="^"
70 exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070071
72 <!--Check with check logs-->
73 <step name="Check-Log-Exceptions" requires="^"
74 exec="onos-check-logs ${OCI}"/>
75
76 <step name="Teardown-Distributed-Primitives-Test-App" requires="^"
77 exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
78 </group>
79</scenario>
80