STC scenario for testing meta app behavior

Change-Id: I1b047624dd96383baee8f93e9f94052a4c5ff10a
diff --git a/tools/test/scenarios/meta-apps-test.xml b/tools/test/scenarios/meta-apps-test.xml
new file mode 100644
index 0000000..91624f1
--- /dev/null
+++ b/tools/test/scenarios/meta-apps-test.xml
@@ -0,0 +1,103 @@
+<!--
+  ~ Copyright 2016-present Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<scenario name="meta-apps"
+          description="Openflow provider activate/deactivate test">
+
+
+    <!-- Check initial state of openflow apps -->
+    <group name="MetaAppInitialVerification">
+        <sequential var="${OC#}" starts="MetaAppTest.FindOpenflowInitial-${#}" ends="MetaAppTest.CheckLldpProviderInitial-${#-1}">
+            <step name="MetaAppTest.FindOpenflowInitial-${#}"
+                  exec="onos-find-app ${OC#} org.onosproject.openflow openflowAppInitial" />
+            <step name="MetaAppTest.CheckOpenflowInitial-${#}" requires="MetaAppTest.FindOpenflowInitial-${#}"
+                  exec="test '${openflowAppInitialState}' == 'active'"/>
+
+            <step name="MetaAppTest.FindOpenflowBaseInitial-${#}"
+                  exec="onos-find-app ${OC#} org.onosproject.openflow-base openflowBaseInitial" />
+            <step name="MetaAppTest.CheckOpenflowBaseInitial-${#}" requires="MetaAppTest.FindOpenflowBaseInitial-${#}"
+                  exec="test '${openflowBaseInitialState}' == 'active'"/>
+
+            <step name="MetaAppTest.FindHostProviderInitial-${#}"
+                  exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderInitial" />
+            <step name="MetaAppTest.CheckHostProviderInitial-${#}" requires="MetaAppTest.FindHostProviderInitial-${#}"
+                  exec="test '${hostProviderInitialState}' == 'active'"/>
+
+            <step name="MetaAppTest.FindLldpProviderInitial-${#}"
+                  exec="onos-find-app ${OC#} org.onosproject.lldpprovider lldpProviderInitial" />
+            <step name="MetaAppTest.CheckLldpProviderInitial-${#}" requires="MetaAppTest.FindLldpProviderInitial-${#}"
+                  exec="test '${lldpProviderInitialState}' == 'active'"/>
+        </sequential>
+    </group>
+
+    <!-- Deactivate openflow meta app -->
+    <step name="MetaAppTest.DeactivateOpenflowMetaApp" requires="MetaAppInitialVerification"
+          exec="onos ${OCI} onos:app deactivate org.onosproject.openflow"/>
+
+    <!-- Check that openflow apps are no longer active -->
+    <group name="MetaAppInactive" requires="MetaAppTest.DeactivateOpenflowMetaApp,MetaAppInitialVerification">
+        <sequential var="${OC#}" starts="MetaAppTest.FindOpenflowInactive-${#}" ends="MetaAppTest.CheckLldpProviderInactive-${#-1}">
+            <step name="MetaAppTest.FindOpenflowInactive-${#}"
+                  exec="onos-find-app ${OC#} org.onosproject.openflow openflowAppInactive" />
+            <step name="MetaAppTest.CheckOpenflowInactive-${#}" requires="^"
+                  exec="test '${openflowAppInactiveState}' == 'inactive'"/>
+
+            <step name="MetaAppTest.FindOpenflowBaseInactive-${#}" requires="^"
+                  exec="onos-find-app ${OC#} org.onosproject.openflow-base openflowBaseInactive" />
+            <step name="MetaAppTest.CheckOpenflowBaseInactive-${#}" requires="^"
+                  exec="test '${openflowBaseInactiveState}' == 'inactive'"/>
+
+            <step name="MetaAppTest.FindHostProviderInactive-${#}" requires="^"
+                  exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderInactive" />
+            <step name="MetaAppTest.CheckHostProviderInactive-${#}" requires="^"
+                  exec="test '${hostProviderInactiveState}' == 'inactive'"/>
+
+            <step name="MetaAppTest.FindLldpProviderInactive-${#}" requires="^"
+                  exec="onos-find-app ${OC#} org.onosproject.lldpprovider lldpProviderInactive" />
+            <step name="MetaAppTest.CheckLldpProviderInactive-${#}" requires="^"
+                  exec="test '${lldpProviderInactiveState}' == 'inactive'"/>
+        </sequential>
+    </group>
+
+    <!-- Reactivate openflow meta app -->
+    <step name="MetaAppTest.ReactivateOpenflowMetaApp" requires="MetaAppInactive"
+          exec="onos ${OCI} onos:app activate org.onosproject.openflow"/>
+
+    <!-- Check that openflow apps are now active again -->
+    <group name="MetaAppReactivated" requires="MetaAppTest.ReactivateOpenflowMetaApp,MetaAppInactive,MetaAppInitialVerification">
+        <sequential var="${OC#}" starts="MetaAppTest.FindOpenflowReactivated-${#}" ends="MetaAppTest.CheckLldpProviderRectivated-${#-1}">
+            <step name="MetaAppTest.FindOpenflowReactivated-${#}"
+                  exec="onos-find-app ${OC#} org.onosproject.openflow openflowAppReactivated" />
+            <step name="MetaAppTest.CheckOpenflowReactivated-${#}" requires="^"
+                  exec="test '${openflowAppReactivatedState}' == 'active'"/>
+
+            <step name="MetaAppTest.FindOpenflowBaseReactivated-${#}" requires="^"
+                  exec="onos-find-app ${OC#} org.onosproject.openflow-base openflowBaseReactivated" />
+            <step name="MetaAppTest.CheckOpenflowBaseReactivated-${#}" requires="^"
+                  exec="test '${openflowBaseReactivatedState}' == 'active'"/>
+
+            <step name="MetaAppTest.FindHostProviderReactivated-${#}" requires="^"
+                  exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderReactivated" />
+            <step name="MetaAppTest.CheckHostProviderReactivated-${#}" requires="^"
+                  exec="test '${hostProviderReactivatedState}' == 'active'"/>
+
+            <step name="MetaAppTest.FindLldpProviderReactivated-${#}" requires="^"
+                  exec="onos-find-app ${OC#} org.onosproject.lldpprovider lldpProviderReactivated" />
+            <step name="MetaAppTest.CheckLldpProviderReactivated-${#}" requires="^"
+                  exec="test '${lldpProviderReactivatedState}' == 'active'"/>
+        </sequential>
+    </group>
+
+</scenario>