blob: 62f8c51ff43904fa4934b7e5608617e64904d596 [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-consistent-map-test"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070018 description="ONOS ConsistentMap distributed primitive Test">
19 <group name="Distributed-Primitive-Map">
20
Ray Milkey685e34d2016-09-01 12:01:09 -070021 <step name="Distributed-Primitive-Map.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-Map.Test-Map-Get" requires="Distributed-Primitive-Map.Activate-Distributed-Primitives-App"
Madan Jampani145623d2016-07-22 14:55:57 -070025 exec="onos-cluster-execute-expect map-test foo get a --expect null"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070026
Ray Milkey685e34d2016-09-01 12:01:09 -070027 <step name="Distributed-Primitive-Map.Test-Map-Put" requires="Distributed-Primitive-Map.Test-Map-Get"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070028 exec="onos-execute-expect ${OCI} map-test foo put a b --expect null"/>
29
Ray Milkey685e34d2016-09-01 12:01:09 -070030 <step name="Distributed-Primitive-Map.Test-Map-Updated-After-Put" requires="Distributed-Primitive-Map.Test-Map-Put"
Madan Jampani145623d2016-07-22 14:55:57 -070031 exec="onos-cluster-execute-expect map-test foo get a --expect b"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070032
Ray Milkey685e34d2016-09-01 12:01:09 -070033 <step name="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Present" requires="Distributed-Primitive-Map.Test-Map-Updated-After-Put"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070034 exec="onos-execute-expect ${OCI} map-test foo putIfAbsent a c --expect b"/>
35
Ray Milkey685e34d2016-09-01 12:01:09 -070036 <step name="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Absent" requires="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Present"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070037 exec="onos-execute-expect ${OCI} map-test foo putIfAbsent b c --expect null"/>
38
Ray Milkey685e34d2016-09-01 12:01:09 -070039 <step name="Distributed-Primitive-Map.Test-Map-Updated-After-PutIfAbsent" requires="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Absent"
Madan Jampani145623d2016-07-22 14:55:57 -070040 exec="onos-cluster-execute-expect map-test foo get b --expect c"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070041
Ray Milkey685e34d2016-09-01 12:01:09 -070042 <step name="Distributed-Primitive-Map.Test-Map-Updated-After-PutAndGet" requires="Distributed-Primitive-Map.Test-Map-Updated-After-PutIfAbsent"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070043 exec="onos-execute-expect ${OCI} map-test foo putAndGet b d --expect d"/>
44
Ray Milkey685e34d2016-09-01 12:01:09 -070045 <step name="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Absent" requires="Distributed-Primitive-Map.Test-Map-Updated-After-PutAndGet"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070046 exec="onos-execute-expect ${OCI} map-test foo replace c e --expect null"/>
47
Ray Milkey685e34d2016-09-01 12:01:09 -070048 <step name="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Present" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Absent"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070049 exec="onos-execute-expect ${OCI} map-test foo replace b e --expect d"/>
50
Ray Milkey685e34d2016-09-01 12:01:09 -070051 <step name="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Not-Match" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Present"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070052 exec="onos-execute-expect ${OCI} map-test foo replace b x f --expect false"/>
53
Ray Milkey685e34d2016-09-01 12:01:09 -070054 <step name="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Match" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Not-Match"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070055 exec="onos-execute-expect ${OCI} map-test foo replace b e f --expect true"/>
56
Ray Milkey685e34d2016-09-01 12:01:09 -070057 <step name="Distributed-Primitive-Map.Test-Map-ContainsValue-False-Case" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Match"
Madan Jampani145623d2016-07-22 14:55:57 -070058 exec="onos-cluster-execute-expect map-test foo containsValue x --expect false"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070059
Ray Milkey685e34d2016-09-01 12:01:09 -070060 <step name="Distributed-Primitive-Map.Test-Map-ContainsValue-True-Case" requires="Distributed-Primitive-Map.Test-Map-ContainsValue-False-Case"
Madan Jampani145623d2016-07-22 14:55:57 -070061 exec="onos-cluster-execute-expect map-test foo containsValue f --expect true"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070062
Ray Milkey685e34d2016-09-01 12:01:09 -070063 <step name="Distributed-Primitive-Map.Test-Map-Size" requires="Distributed-Primitive-Map.Test-Map-ContainsValue-True-Case"
Madan Jampani145623d2016-07-22 14:55:57 -070064 exec="onos-cluster-execute-expect map-test foo size --expect 2"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070065
Ray Milkey685e34d2016-09-01 12:01:09 -070066 <step name="Distributed-Primitive-Map.Test-Map-IsEmpty" requires="Distributed-Primitive-Map.Test-Map-Size"
Madan Jampani145623d2016-07-22 14:55:57 -070067 exec="onos-cluster-execute-expect map-test foo isEmpty --expect false"/>
Madan Jampani9e1a8c12016-06-27 11:19:10 -070068
Ray Milkey685e34d2016-09-01 12:01:09 -070069 <step name="Distributed-Primitive-Map.Test-Map-Remove" requires="Distributed-Primitive-Map.Test-Map-IsEmpty"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070070 exec="onos-execute-expect ${OCI} map-test foo remove b --expect f"/>
71
Ray Milkey685e34d2016-09-01 12:01:09 -070072 <step name="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Not-Match" requires="Distributed-Primitive-Map.Test-Map-Remove"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070073 exec="onos-execute-expect ${OCI} map-test foo remove a c --expect false"/>
74
Ray Milkey685e34d2016-09-01 12:01:09 -070075 <step name="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Match" requires="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Not-Match"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070076 exec="onos-execute-expect ${OCI} map-test foo remove a b --expect true"/>
77
Ray Milkey685e34d2016-09-01 12:01:09 -070078 <step name="Distributed-Primitive-Map.Test-Map-Clear" requires="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Match"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070079 exec="onos ${OCI} map-test foo clear"/>
80
Ray Milkey685e34d2016-09-01 12:01:09 -070081 <step name="Distributed-Primitive-Map.Test-Map-Cleared" requires="Distributed-Primitive-Map.Test-Map-Clear"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070082 exec="onos-execute-expect ${OCI} map-test foo isEmpty --expect true"/>
83
84 <!--Check with check logs-->
Ray Milkey685e34d2016-09-01 12:01:09 -070085 <step name="Distributed-Primitive-Map.Check-Log-Exceptions" requires="Distributed-Primitive-Map.Test-Map-Cleared"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070086 exec="onos-check-logs ${OCI}"/>
87
Ray Milkey685e34d2016-09-01 12:01:09 -070088 <step name="Distributed-Primitive-Map.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Map.Check-Log-Exceptions"
Madan Jampani9e1a8c12016-06-27 11:19:10 -070089 exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
90 </group>
91</scenario>
92