Ray Milkey
Committed by Gerrit Code Review

Add Distributed Primitives scenario to smoke test

Change-Id: I9ad43c5a5562e90a10579758c6ffa45a3509c0f5
......@@ -14,66 +14,63 @@
~ limitations under the License.
-->
<scenario name="distributed counter test"
<scenario name="distributed-counter-test"
description="ONOS AtomicCounter distributed primitive Test">
<group name="Distributed-Primitive-Counter">
<!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites"/>-->
<step name="Activate-Distributed-Primitives-App"
<step name="Distributed-Primitive-Counter.Activate-Distributed-Primitives-App"
exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
<step name="Test-Counter-Initial-Value" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Initial-Value" requires="Distributed-Primitive-Counter.Activate-Distributed-Primitives-App"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
<step name="Test-Counter-Set" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Set" requires="Distributed-Primitive-Counter.Test-Counter-Initial-Value"
exec="onos ${OCI} counter-test test-counter set 1"/>
<step name="Test-Counter-Get" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Get" requires="Distributed-Primitive-Counter.Test-Counter-Set"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 1"/>
<step name="Test-Counter-IncrementAndGet" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet" requires="Distributed-Primitive-Counter.Test-Counter-Get"
exec="onos-execute-expect ${OCI} counter-test test-counter incrementAndGet --expect 2"/>
<step name="Test-Counter-GetAndIncrement" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement" requires="Distributed-Primitive-Counter.Test-Counter-IncrementAndGet"
exec="onos-execute-expect ${OCI} counter-test test-counter getAndIncrement --expect 2"/>
<step name="Test-Counter-Incremented" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Incremented" requires="Distributed-Primitive-Counter.Test-Counter-GetAndIncrement"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 3"/>
<step name="Test-Counter-AddAndGet" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-AddAndGet" requires="Distributed-Primitive-Counter.Test-Counter-Incremented"
exec="onos-execute-expect ${OCI} counter-test test-counter addAndGet 10 --expect 13"/>
<step name="Test-Counter-GetAndAdd" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-GetAndAdd" requires="Distributed-Primitive-Counter.Test-Counter-AddAndGet"
exec="onos-execute-expect ${OCI} counter-test test-counter getAndAdd 10 --expect 13"/>
<step name="Test-Counter-Updated-After-GetAndAdd" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd" requires="Distributed-Primitive-Counter.Test-Counter-GetAndAdd"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
<step name="Test-Counter-CompareAndSet-False" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False" requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-GetAndAdd"
exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 1 2 --expect false"/>
<step name="Test-Counter-Not-Updated-After-CAS" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS" requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-False"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 23"/>
<step name="Test-Counter-CompareAndSet-True" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True" requires="Distributed-Primitive-Counter.Test-Counter-Not-Updated-After-CAS"
exec="onos-execute-expect ${OCI} counter-test test-counter compareAndSet 23 25 --expect true"/>
<step name="Test-Counter-Updated-After-CAS" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS" requires="Distributed-Primitive-Counter.Test-Counter-CompareAndSet-True"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 25"/>
<step name="Test-Counter-Reset" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Reset" requires="Distributed-Primitive-Counter.Test-Counter-Updated-After-CAS"
exec="onos ${OCI} counter-test test-counter set 0"/>
<step name="Test-Counter-Get-After-Reset" requires="^"
<step name="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset" requires="Distributed-Primitive-Counter.Test-Counter-Reset"
exec="onos-cluster-execute-expect counter-test test-counter get --expect 0"/>
<!--Check with check logs-->
<step name="Check-Log-Exceptions" requires="^"
<step name="Distributed-Primitive-Counter.Check-Log-Exceptions" requires="Distributed-Primitive-Counter.Test-Counter-Get-After-Reset"
exec="onos-check-logs ${OCI}"/>
<step name="Teardown-Distributed-Primitives-Test-App" requires="^"
<step name="Distributed-Primitive-Counter.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Counter.Check-Log-Exceptions"
exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
</group>
</scenario>
......
......@@ -14,33 +14,30 @@
~ limitations under the License.
-->
<scenario name="distributed leader elector test"
<scenario name="distributed-leader-elector-test"
description="ONOS LeaderElector distributed primitive Test">
<group name="Distributed-Primitive-Value">
<group name="Distributed-Primitive-Leader">
<!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites"/>-->
<step name="Activate-Distributed-Primitives-App"
<step name="Distributed-Primitive-Leader.Activate-Distributed-Primitives-App"
exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
<step name="Test-Initial-No-Leader" requires="^"
<step name="Distributed-Primitive-Leader.Test-Initial-No-Leader" requires="Distributed-Primitive-Leader.Activate-Distributed-Primitives-App"
exec="onos-cluster-execute-expect leader-test test-elector show foo --expect leader=none#candidates=none"/>
<step name="Test-Leader-Run" requires="^"
exec="onos-execute-expect ${OCI} leader-test test-elector run foo --expect leader=${OCI}#term=1#candidates=${OCI}"/>
<step name="Distributed-Primitive-Leader.Test-Leader-Run" requires="Distributed-Primitive-Leader.Test-Initial-No-Leader"
exec="onos-execute-expect ${OCI} leader-test test-elector run foo --expect leader=${OCI}#term=[0-9][0-9]*#candidates=${OCI}"/>
<step name="Test-Leader-Withdraw" requires="^"
<step name="Distributed-Primitive-Leader.Test-Leader-Withdraw" requires="Distributed-Primitive-Leader.Test-Leader-Run"
exec="onos ${OCI} leader-test test-elector withdraw foo"/>
<step name="Test-No-Leader-After-Withdraw" requires="^"
<step name="Distributed-Primitive-Leader.Test-No-Leader-After-Withdraw" requires="Distributed-Primitive-Leader.Test-Leader-Withdraw"
exec="onos-cluster-execute-expect leader-test test-elector show foo --expect leader=none#candidates=none"/>
<!--Check with check logs-->
<step name="Check-Log-Exceptions" requires="^"
<step name="Distributed-Primitive-Leader.Check-Log-Exceptions" requires="Distributed-Primitive-Leader.Test-No-Leader-After-Withdraw"
exec="onos-check-logs ${OCI}"/>
<step name="Teardown-Distributed-Primitives-Test-App" requires="^"
<step name="Distributed-Primitive-Leader.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Leader.Check-Log-Exceptions"
exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
</group>
</scenario>
......
......@@ -14,81 +14,78 @@
~ limitations under the License.
-->
<scenario name="Distributed consistent map test"
<scenario name="distributed-consistent-map-test"
description="ONOS ConsistentMap distributed primitive Test">
<group name="Distributed-Primitive-Map">
<!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites"/>-->
<step name="Activate-Distributed-Primitives-App"
<step name="Distributed-Primitive-Map.Activate-Distributed-Primitives-App"
exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
<step name="Test-Map-Get" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Get" requires="Distributed-Primitive-Map.Activate-Distributed-Primitives-App"
exec="onos-cluster-execute-expect map-test foo get a --expect null"/>
<step name="Test-Map-Put" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Put" requires="Distributed-Primitive-Map.Test-Map-Get"
exec="onos-execute-expect ${OCI} map-test foo put a b --expect null"/>
<step name="Test-Map-Updated-After-Put" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Updated-After-Put" requires="Distributed-Primitive-Map.Test-Map-Put"
exec="onos-cluster-execute-expect map-test foo get a --expect b"/>
<step name="Test-Map-PutIfAbsent-When-Key-Present" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Present" requires="Distributed-Primitive-Map.Test-Map-Updated-After-Put"
exec="onos-execute-expect ${OCI} map-test foo putIfAbsent a c --expect b"/>
<step name="Test-Map-PutIfAbsent-When-Key-Absent" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Absent" requires="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Present"
exec="onos-execute-expect ${OCI} map-test foo putIfAbsent b c --expect null"/>
<step name="Test-Map-Updated-After-PutIfAbsent" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Updated-After-PutIfAbsent" requires="Distributed-Primitive-Map.Test-Map-PutIfAbsent-When-Key-Absent"
exec="onos-cluster-execute-expect map-test foo get b --expect c"/>
<step name="Test-Map-Updated-After-PutAndGet" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Updated-After-PutAndGet" requires="Distributed-Primitive-Map.Test-Map-Updated-After-PutIfAbsent"
exec="onos-execute-expect ${OCI} map-test foo putAndGet b d --expect d"/>
<step name="Test-Map-Replace-When-Key-Absent" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Absent" requires="Distributed-Primitive-Map.Test-Map-Updated-After-PutAndGet"
exec="onos-execute-expect ${OCI} map-test foo replace c e --expect null"/>
<step name="Test-Map-Replace-When-Key-Present" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Present" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Absent"
exec="onos-execute-expect ${OCI} map-test foo replace b e --expect d"/>
<step name="Test-Map-Replace-When-Value-Does-Not-Match" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Not-Match" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Key-Present"
exec="onos-execute-expect ${OCI} map-test foo replace b x f --expect false"/>
<step name="Test-Map-Replace-When-Value-Does-Match" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Match" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Not-Match"
exec="onos-execute-expect ${OCI} map-test foo replace b e f --expect true"/>
<step name="Test-Map-ContainsValue-False-Case" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-ContainsValue-False-Case" requires="Distributed-Primitive-Map.Test-Map-Replace-When-Value-Does-Match"
exec="onos-cluster-execute-expect map-test foo containsValue x --expect false"/>
<step name="Test-Map-ContainsValue-True-Case" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-ContainsValue-True-Case" requires="Distributed-Primitive-Map.Test-Map-ContainsValue-False-Case"
exec="onos-cluster-execute-expect map-test foo containsValue f --expect true"/>
<step name="Test-Map-Size" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Size" requires="Distributed-Primitive-Map.Test-Map-ContainsValue-True-Case"
exec="onos-cluster-execute-expect map-test foo size --expect 2"/>
<step name="Test-Map-IsEmpty" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-IsEmpty" requires="Distributed-Primitive-Map.Test-Map-Size"
exec="onos-cluster-execute-expect map-test foo isEmpty --expect false"/>
<step name="Test-Map-Remove" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Remove" requires="Distributed-Primitive-Map.Test-Map-IsEmpty"
exec="onos-execute-expect ${OCI} map-test foo remove b --expect f"/>
<step name="Test-Map-Remove-Key-Value-Does-Not-Match" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Not-Match" requires="Distributed-Primitive-Map.Test-Map-Remove"
exec="onos-execute-expect ${OCI} map-test foo remove a c --expect false"/>
<step name="Test-Map-Remove-Key-Value-Does-Match" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Match" requires="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Not-Match"
exec="onos-execute-expect ${OCI} map-test foo remove a b --expect true"/>
<step name="Test-Map-Clear" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Clear" requires="Distributed-Primitive-Map.Test-Map-Remove-Key-Value-Does-Match"
exec="onos ${OCI} map-test foo clear"/>
<step name="Test-Map-Cleared" requires="^"
<step name="Distributed-Primitive-Map.Test-Map-Cleared" requires="Distributed-Primitive-Map.Test-Map-Clear"
exec="onos-execute-expect ${OCI} map-test foo isEmpty --expect true"/>
<!--Check with check logs-->
<step name="Check-Log-Exceptions" requires="^"
<step name="Distributed-Primitive-Map.Check-Log-Exceptions" requires="Distributed-Primitive-Map.Test-Map-Cleared"
exec="onos-check-logs ${OCI}"/>
<step name="Teardown-Distributed-Primitives-Test-App" requires="^"
<step name="Distributed-Primitive-Map.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Map.Check-Log-Exceptions"
exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
</group>
</scenario>
......
......@@ -18,53 +18,18 @@
description="ONOS distributed primitives setup">
<group name="Distributed-Primitives">
<!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites"/>-->
<import file="${ONOS_SCENARIOS}/dist-map.xml"/>
<dependency name="Distributed-Primitive-Map" requires="Setup"/>
<step name="Distributed-App"
requires="Setup"
exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
<import file="${ONOS_SCENARIOS}/dist-value.xml"/>
<dependency name="Distributed-Primitive-Value" requires="Distributed-Primitive-Map"/>
<step name="Test-Counter-Increment"
requires="Distributed-App"
exec="onos-execute-expect ${OCI} counter-test-increment fooCounter 5 --expect updated"/>
<import file="${ONOS_SCENARIOS}/dist-counter.xml"/>
<dependency name="Distributed-Primitive-Counter" requires="Distributed-Primitive-Value"/>
<step name="Test-Add"
requires="Distributed-App"
exec="onos-execute-expect ${OCI} set-test-add fooSet foo --expect added"/>
<import file="${ONOS_SCENARIOS}/dist-leader.xml"/>
<dependency name="Distributed-Primitive-Leader" requires="Distributed-Primitive-Counter"/>
<step name="Test-Get"
requires="Test-Add"
exec="onos-execute-expect ${OCI} set-test-get fooSet foo --expect contains"/>
<step name="Test-Remove"
requires="Test-Get"
exec="onos-execute-expect ${OCI} set-test-remove fooSet foo --expect removed"/>
<step name="Test-Add-Multiple"
requires="Test-Remove"
exec="onos-execute-expect ${OCI} set-test-add fooSet foo foo2 foo3 --expect added"/>
<step name="Test-Get-Multiple"
requires="Test-Add-Multiple"
exec="onos-execute-expect ${OCI} set-test-get fooSet foo foo2 foo3 --expect contains"/>
<step name="Test-Remove-Multiple"
requires="Test-Get-Multiple"
exec="onos-execute-expect ${OCI} set-test-remove fooSet foo foo2 foo3 --expect removed"/>
<step name="Test-Map-Put"
requires="Distributed-App"
exec="onos-execute-expect ${OCI} transactional-map-test-put 1 foo --expect Created"/>
<step name="Test-Map-Get"
requires="Test-Map-Put"
exec="onos-execute-expect ${OCI} transactional-map-test-get Key1 --expect Key-value"/>
<!--Check with check logs-->
<step name="Check-Distributed-Exceptions"
exec="onos-check-logs ${OCI}"
requires="Test-Map-Get"/>
</group>
</scenario>
......
......@@ -14,42 +14,45 @@
~ limitations under the License.
-->
<scenario name="distributed value test"
<scenario name="distributed-value-test"
description="ONOS AtomicValue distributed primitive Test">
<group name="Distributed-Primitive-Value">
<!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites"/>-->
<step name="Activate-Distributed-Primitives-App"
<step name="Distributed-Primitive-Value.Activate-Distributed-Primitives-App"
exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>
<step name="Test-Value-Initial-Value" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-Initial-Value" requires="Distributed-Primitive-Value.Activate-Distributed-Primitives-App"
exec="onos-cluster-execute-expect value-test test-value get --expect null"/>
<step name="Test-Value-Set" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-Set" requires="Distributed-Primitive-Value.Test-Value-Initial-Value"
exec="onos ${OCI} value-test test-value set v0"/>
<step name="Test-Value-Get" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-Get" requires="Distributed-Primitive-Value.Test-Value-Set"
exec="onos-cluster-execute-expect value-test test-value get --expect v0"/>
<step name="Test-Value-CompareAndSet-False" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-CompareAndSet-False" requires="Distributed-Primitive-Value.Test-Value-Get"
exec="onos-execute-expect ${OCI} value-test test-value compareAndSet v1 v2 --expect false"/>
<step name="Test-Value-Not-Updated-After-CAS" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-Not-Updated-After-CAS" requires="Distributed-Primitive-Value.Test-Value-CompareAndSet-False"
exec="onos-cluster-execute-expect value-test test-value get --expect v0"/>
<step name="Test-Value-CompareAndSet-True" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-CompareAndSet-True" requires="Distributed-Primitive-Value.Test-Value-Not-Updated-After-CAS"
exec="onos-execute-expect ${OCI} value-test test-value compareAndSet v0 v1 --expect true"/>
<step name="Test-Value-Updated-After-CAS" requires="^"
<step name="Distributed-Primitive-Value.Test-Value-Updated-After-CAS" requires="Distributed-Primitive-Value.Test-Value-CompareAndSet-True"
exec="onos-cluster-execute-expect value-test test-value get --expect v1"/>
<step name="Distributed-Primitive-Value.Destroy-Value" requires="Distributed-Primitive-Value.Test-Value-Updated-After-CAS"
exec="onos ${OCI} value-test test-value set null"/>
<!--Check with check logs-->
<step name="Check-Log-Exceptions" requires="^"
<step name="Distributed-Primitive-Value.Check-Log-Exceptions" requires="Distributed-Primitive-Value.Destroy-Value"
exec="onos-check-logs ${OCI}"/>
<step name="Teardown-Distributed-Primitives-Test-App" requires="^"
<step name="Distributed-Primitive-Value.Teardown-Distributed-Primitives-Test-App" requires="Distributed-Primitive-Value.Check-Log-Exceptions"
exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
</group>
</scenario>
......
......@@ -16,16 +16,17 @@
<scenario name="smoke" description="ONOS smoke test">
<import file="${ONOS_SCENARIOS}/prerequisites.xml"/>
<import file="${ONOS_SCENARIOS}/net-prerequisites.xml"/>
<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites,Net-Prerequisites"/>
<import file="${ONOS_SCENARIOS}/dist-test.xml"/>
<import file="${ONOS_SCENARIOS}/smoke-internal.xml"/>
<dependency name="Setup" requires="Prerequisites,Net-Prerequisites"/>
<dependency name="Net-Smoke" requires="Setup"/>
<dependency name="Archetypes" requires="Setup"/>
<dependency name="Drivers-Test" requires="Setup"/>
<dependency name="Meta-App" requires="Setup"/>
<dependency name="Netcfg" requires="Setup"/>
<dependency name="Distributed-Primitives" requires="Setup"/>
<import file="${ONOS_SCENARIOS}/wrapup.xml"/>
<dependency name="Wrapup" requires="~Setup,~Net-Smoke,~Archetypes,~Drivers-Test,~Meta-App,~Netcfg"/>
......