Adding more patience to onos-check-summary and changing sequencing of smoke.xml scenario.
Change-Id: I1db9084524daa8c5494d0066be30d801e78d0fc3
diff --git a/tools/test/bin/onos-check-summary b/tools/test/bin/onos-check-summary
index ab7c22d..c1139c3 100755
--- a/tools/test/bin/onos-check-summary
+++ b/tools/test/bin/onos-check-summary
@@ -6,15 +6,22 @@
aux=/tmp/stc-$$.log
trap "rm -f $aux 2>/dev/null" EXIT
-onos ${1:-$OCI} "onos:summary" > $aux
-cat $aux
+for i in {1..10}; do
+ onos ${1:-$OCI} "onos:summary" > $aux
+ cat $aux
-let status=0
-grep -q "nodes=${2:-.*}" $aux || let status=status+1
-grep -q "devices=${3:-.*}" $aux || let status=status+1
-grep -q "links=${4:-.*}" $aux || let status=status+1
-grep -q "hosts=${5:-.*}" $aux || let status=status+1
-grep -q "flows=${6:-.*}" $aux || let status=status+1
-grep -q "intents=${7:-.*}" $aux || let status=status+1
+ let status=0
+ grep -q "nodes=${2:-.*}" $aux || let status=status+1
+ grep -q "devices=${3:-.*}" $aux || let status=status+1
+ grep -q "links=${4:-.*}" $aux || let status=status+1
+ grep -q "hosts=${5:-.*}" $aux || let status=status+1
+ grep -q "flows=${6:-.*}" $aux || let status=status+1
+ grep -q "intents=${7:-.*}" $aux || let status=status+1
+
+ if [ $status -eq 0 ]; then
+ exit 0;
+ fi
+ sleep 1
+done
exit $status
\ No newline at end of file
diff --git a/tools/test/scenarios/meta-apps-test.xml b/tools/test/scenarios/meta-apps-test.xml
index 91624f1..4338dd3 100644
--- a/tools/test/scenarios/meta-apps-test.xml
+++ b/tools/test/scenarios/meta-apps-test.xml
@@ -15,89 +15,90 @@
-->
<scenario name="meta-apps"
description="Openflow provider activate/deactivate test">
+ <group name="Meta-App">
+ <!-- Check initial state of openflow apps -->
+ <group name="MetaAppInitialVerification">
+ <parallel 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'"/>
- <!-- 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.FindHostProviderInitial-${#}"
+ exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderInitial" />
+ <step name="MetaAppTest.CheckHostProviderInitial-${#}" requires="MetaAppTest.FindHostProviderInitial-${#}"
+ exec="test '${hostProviderInitialState}' == '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.FindLldpProviderInitial-${#}"
+ exec="onos-find-app ${OC#} org.onosproject.lldpprovider lldpProviderInitial" />
+ <step name="MetaAppTest.CheckLldpProviderInitial-${#}" requires="MetaAppTest.FindLldpProviderInitial-${#}"
+ exec="test '${lldpProviderInitialState}' == 'active'"/>
+ </parallel>
+ </group>
- <step name="MetaAppTest.FindHostProviderInitial-${#}"
- exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderInitial" />
- <step name="MetaAppTest.CheckHostProviderInitial-${#}" requires="MetaAppTest.FindHostProviderInitial-${#}"
- exec="test '${hostProviderInitialState}' == 'active'"/>
+ <!-- Deactivate openflow meta app -->
+ <step name="MetaAppTest.DeactivateOpenflowMetaApp" requires="MetaAppInitialVerification"
+ exec="onos ${OCI} onos:app deactivate org.onosproject.openflow"/>
- <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>
+ <!-- Check that openflow apps are no longer active -->
+ <group name="MetaAppInactive" requires="MetaAppTest.DeactivateOpenflowMetaApp,MetaAppInitialVerification">
+ <parallel 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'"/>
- <!-- Deactivate openflow meta app -->
- <step name="MetaAppTest.DeactivateOpenflowMetaApp" requires="MetaAppInitialVerification"
- exec="onos ${OCI} onos:app deactivate org.onosproject.openflow"/>
+ <step name="MetaAppTest.FindOpenflowBaseInactive-${#}" requires="^"
+ exec="onos-find-app ${OC#} org.onosproject.openflow-base openflowBaseInactive" />
+ <step name="MetaAppTest.CheckOpenflowBaseInactive-${#}" requires="^"
+ exec="test '${openflowBaseInactiveState}' == 'inactive'"/>
- <!-- 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.FindHostProviderInactive-${#}" requires="^"
+ exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderInactive" />
+ <step name="MetaAppTest.CheckHostProviderInactive-${#}" requires="^"
+ exec="test '${hostProviderInactiveState}' == '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.FindLldpProviderInactive-${#}" requires="^"
+ exec="onos-find-app ${OC#} org.onosproject.lldpprovider lldpProviderInactive" />
+ <step name="MetaAppTest.CheckLldpProviderInactive-${#}" requires="^"
+ exec="test '${lldpProviderInactiveState}' == 'inactive'"/>
+ </parallel>
+ </group>
- <step name="MetaAppTest.FindHostProviderInactive-${#}" requires="^"
- exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderInactive" />
- <step name="MetaAppTest.CheckHostProviderInactive-${#}" requires="^"
- exec="test '${hostProviderInactiveState}' == 'inactive'"/>
+ <!-- Reactivate openflow meta app -->
+ <step name="MetaAppTest.ReactivateOpenflowMetaApp" requires="MetaAppInactive"
+ exec="onos ${OCI} onos:app activate org.onosproject.openflow"/>
- <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>
+ <!-- Check that openflow apps are now active again -->
+ <group name="MetaAppReactivated" requires="MetaAppTest.ReactivateOpenflowMetaApp,MetaAppInactive,MetaAppInitialVerification">
+ <parallel 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'"/>
- <!-- Reactivate openflow meta app -->
- <step name="MetaAppTest.ReactivateOpenflowMetaApp" requires="MetaAppInactive"
- exec="onos ${OCI} onos:app activate org.onosproject.openflow"/>
+ <step name="MetaAppTest.FindOpenflowBaseReactivated-${#}" requires="^"
+ exec="onos-find-app ${OC#} org.onosproject.openflow-base openflowBaseReactivated" />
+ <step name="MetaAppTest.CheckOpenflowBaseReactivated-${#}" requires="^"
+ exec="test '${openflowBaseReactivatedState}' == 'active'"/>
- <!-- 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.FindHostProviderReactivated-${#}" requires="^"
+ exec="onos-find-app ${OC#} org.onosproject.hostprovider hostProviderReactivated" />
+ <step name="MetaAppTest.CheckHostProviderReactivated-${#}" requires="^"
+ exec="test '${hostProviderReactivatedState}' == '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.FindLldpProviderReactivated-${#}" requires="^"
+ exec="onos-find-app ${OC#} org.onosproject.lldpprovider lldpProviderReactivated" />
+ <step name="MetaAppTest.CheckLldpProviderReactivated-${#}" requires="^"
+ exec="test '${lldpProviderReactivatedState}' == 'active'"/>
+ </parallel>
+ </group>
- <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>
diff --git a/tools/test/scenarios/smoke.xml b/tools/test/scenarios/smoke.xml
index 0c82bd4..70cd1ce 100644
--- a/tools/test/scenarios/smoke.xml
+++ b/tools/test/scenarios/smoke.xml
@@ -20,23 +20,21 @@
<import file="${ONOS_SCENARIOS}/setup.xml"/>
<dependency name="Setup" requires="Prerequisites,Net-Prerequisites"/>
- <import file="${ONOS_SCENARIOS}/meta-apps-test.xml"/>
- <dependency name="MetaAppReactivated" requires="Setup"/>
- <dependency name="MetaAppInactive" requires="Setup"/>
- <dependency name="MetaAppInitialVerification" requires="Setup"/>
-
<import file="${ONOS_SCENARIOS}/net-smoke.xml"/>
<dependency name="Net-Smoke" requires="Setup"/>
- <import file="${ONOS_SCENARIOS}/archetypes.xml"/>
- <dependency name="Archetypes" requires="Setup"/>
+ <import file="${ONOS_SCENARIOS}/meta-apps-test.xml"/>
+ <dependency name="Meta-App" requires="Setup,~Net-Smoke"/>
- <import file="${ONOS_SCENARIOS}/drivers-test.xml"/>
- <dependency name="Drivers-Test" requires="Setup,Net-Smoke,Archetypes"/>
+ <import file="${ONOS_SCENARIOS}/archetypes.xml"/>
+ <dependency name="Archetypes" requires="Setup,~Net-Smoke"/>
<import file="${ONOS_SCENARIOS}/netcfg.xml"/>
- <dependency name="Netcfg" requires="Setup"/>
+ <dependency name="Netcfg" requires="Setup,~Meta-App"/>
+
+ <import file="${ONOS_SCENARIOS}/drivers-test.xml"/>
+ <dependency name="Drivers-Test" requires="Setup,~Net-Smoke,~Archetypes"/>
<import file="${ONOS_SCENARIOS}/wrapup.xml"/>
- <dependency name="Wrapup" requires="~Archetypes,~Setup,~Net-Smoke,~Drivers-Test,~MetaAppReactivated,~Netcfg"/>
+ <dependency name="Wrapup" requires="~Archetypes,~Setup,~Net-Smoke,~Drivers-Test,~Meta-App,~Netcfg"/>
</scenario>