From 6e968e1d77c44c9d94bff59877d4ca34bac567f3 Mon Sep 17 00:00:00 2001 From: Ray Milkey Date: Fri, 18 Sep 2015 09:55:07 -0700 Subject: [PATCH] STC changes to make smoke test more reliable Change-Id: I8ecf2581b12e618bf3fe41baedf5c5decdd77221 --- tools/test/bin/onos-check-intent | 2 +- tools/test/scenarios/bin/curl-with-retry | 23 +++++++++++++++++++++++ tools/test/scenarios/net-link-down-up.xml | 14 ++++++++++---- tools/test/scenarios/net-pingall.xml | 4 ++-- tools/test/scenarios/net-rest.xml | 19 ++++++++++--------- tools/test/scenarios/net-smoke.xml | 3 ++- 6 files changed, 48 insertions(+), 17 deletions(-) create mode 100755 tools/test/scenarios/bin/curl-with-retry diff --git a/tools/test/bin/onos-check-intent b/tools/test/bin/onos-check-intent index e332dc5b61..760afafe2b 100755 --- a/tools/test/bin/onos-check-intent +++ b/tools/test/bin/onos-check-intent @@ -13,7 +13,7 @@ target=${1:-$OCI} echo onos-check-intent: $* set -x -for i in {1..10}; do +for i in {1..15}; do onos $target "onos:intents" | tee $aux ( cat $aux | grep "key=$2" | grep "state=$3" ) && cat $aux && exit 0 sleep 1 diff --git a/tools/test/scenarios/bin/curl-with-retry b/tools/test/scenarios/bin/curl-with-retry new file mode 100755 index 0000000000..c9546aea82 --- /dev/null +++ b/tools/test/scenarios/bin/curl-with-retry @@ -0,0 +1,23 @@ +#!/bin/bash + +aux=/tmp/stc-$$.log +trap "rm -f $aux 2>/dev/null" EXIT + +url=$1 + + +echo curl-with-retry: $* + +set -x +for i in {1..3}; do + curl -f -uonos:rocks ${url} >$aux + if [ $? = 0 ]; then + cat $aux + exit 0 + fi + sleep 1 +done + +cat $aux +exit 1 + diff --git a/tools/test/scenarios/net-link-down-up.xml b/tools/test/scenarios/net-link-down-up.xml index 8bcbfa7fcd..eb4727bdcf 100644 --- a/tools/test/scenarios/net-link-down-up.xml +++ b/tools/test/scenarios/net-link-down-up.xml @@ -20,7 +20,9 @@ exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> - + @@ -28,11 +30,15 @@ exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect 100% packet loss"/> - + - + - \ No newline at end of file + diff --git a/tools/test/scenarios/net-pingall.xml b/tools/test/scenarios/net-pingall.xml index 8968e0dc21..87c1322767 100644 --- a/tools/test/scenarios/net-pingall.xml +++ b/tools/test/scenarios/net-pingall.xml @@ -23,7 +23,7 @@ + exec="onos-mininet sendAndExpect py net.pingAll(1) --expect received"/> @@ -34,4 +34,4 @@ - \ No newline at end of file + diff --git a/tools/test/scenarios/net-rest.xml b/tools/test/scenarios/net-rest.xml index fc7b1d0868..ab7804dfe4 100644 --- a/tools/test/scenarios/net-rest.xml +++ b/tools/test/scenarios/net-rest.xml @@ -101,10 +101,10 @@ + exec="curl-with-retry ${xyLocation}"/> + exec="curl-with-retry ${yxLocation}"/> + exec="test ${dev4outFlowPort} -ge 1 -a ${dev4outFlowPort} -le 5"/> + - - - + exec="curl-with-retry ${xyLocation}" env="!"/> + exec="curl-with-retry ${yxLocation}" env="!"/> diff --git a/tools/test/scenarios/net-smoke.xml b/tools/test/scenarios/net-smoke.xml index 2aad75810c..91131c626a 100644 --- a/tools/test/scenarios/net-smoke.xml +++ b/tools/test/scenarios/net-smoke.xml @@ -42,6 +42,7 @@ + ~Net-Create-Flows, + ~Net-topo"/>