STC changes to make smoke test more reliable
Change-Id: I8ecf2581b12e618bf3fe41baedf5c5decdd77221
Showing
6 changed files
with
48 additions
and
17 deletions
... | @@ -13,7 +13,7 @@ target=${1:-$OCI} | ... | @@ -13,7 +13,7 @@ target=${1:-$OCI} |
13 | echo onos-check-intent: $* | 13 | echo onos-check-intent: $* |
14 | 14 | ||
15 | set -x | 15 | set -x |
16 | -for i in {1..10}; do | 16 | +for i in {1..15}; do |
17 | onos $target "onos:intents" | tee $aux | 17 | onos $target "onos:intents" | tee $aux |
18 | ( cat $aux | grep "key=$2" | grep "state=$3" ) && cat $aux && exit 0 | 18 | ( cat $aux | grep "key=$2" | grep "state=$3" ) && cat $aux && exit 0 |
19 | sleep 1 | 19 | sleep 1 | ... | ... |
tools/test/scenarios/bin/curl-with-retry
0 → 100755
1 | +#!/bin/bash | ||
2 | + | ||
3 | +aux=/tmp/stc-$$.log | ||
4 | +trap "rm -f $aux 2>/dev/null" EXIT | ||
5 | + | ||
6 | +url=$1 | ||
7 | + | ||
8 | + | ||
9 | +echo curl-with-retry: $* | ||
10 | + | ||
11 | +set -x | ||
12 | +for i in {1..3}; do | ||
13 | + curl -f -uonos:rocks ${url} >$aux | ||
14 | + if [ $? = 0 ]; then | ||
15 | + cat $aux | ||
16 | + exit 0 | ||
17 | + fi | ||
18 | + sleep 1 | ||
19 | +done | ||
20 | + | ||
21 | +cat $aux | ||
22 | +exit 1 | ||
23 | + |
... | @@ -20,7 +20,9 @@ | ... | @@ -20,7 +20,9 @@ |
20 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 20 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> |
21 | <step name="Link-1-Down" requires="~Ping-1" | 21 | <step name="Link-1-Down" requires="~Ping-1" |
22 | exec="onos-mininet sendAndExpect link s4 s7 down --expect ."/> | 22 | exec="onos-mininet sendAndExpect link s4 s7 down --expect ."/> |
23 | - <step name="Ping-2" requires="~Link-1-Down" | 23 | + <step name="Ping-2-Prep" requires="~Link-1-Down" |
24 | + exec="onos-mininet sendAndExpect h1 ping -c5 h4 --expect ."/> | ||
25 | + <step name="Ping-2" requires="~Ping-2-Prep" | ||
24 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 26 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> |
25 | <step name="Link-2-Down" requires="~Ping-2" | 27 | <step name="Link-2-Down" requires="~Ping-2" |
26 | exec="onos-mininet sendAndExpect link s4 s5 down --expect ."/> | 28 | exec="onos-mininet sendAndExpect link s4 s5 down --expect ."/> |
... | @@ -28,11 +30,15 @@ | ... | @@ -28,11 +30,15 @@ |
28 | exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect 100% packet loss"/> | 30 | exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect 100% packet loss"/> |
29 | <step name="Link-1-Up" requires="~Ping-3" | 31 | <step name="Link-1-Up" requires="~Ping-3" |
30 | exec="onos-mininet sendAndExpect link s4 s7 up --expect ."/> | 32 | exec="onos-mininet sendAndExpect link s4 s7 up --expect ."/> |
31 | - <step name="Ping-4" requires="~Link-1-Up" | 33 | + <step name="Ping-4-Prep" requires="~Link-1-Up" |
34 | + exec="onos-mininet sendAndExpect h1 ping -c5 h4 --expect ."/> | ||
35 | + <step name="Ping-4" requires="~Ping-4-Prep" | ||
32 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 36 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> |
33 | <step name="Link-2-Up" requires="~Ping-4" | 37 | <step name="Link-2-Up" requires="~Ping-4" |
34 | exec="onos-mininet sendAndExpect link s4 s5 up --expect ."/> | 38 | exec="onos-mininet sendAndExpect link s4 s5 up --expect ."/> |
35 | - <step name="Ping-5" requires="~Link-2-Up" | 39 | + <step name="Ping-5-Prep" requires="~Link-2-Up" |
40 | + exec="onos-mininet sendAndExpect h1 ping -c5 h4 --expect ."/> | ||
41 | + <step name="Ping-5" requires="~Ping-5-Prep" | ||
36 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 42 | exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> |
37 | </group> | 43 | </group> |
38 | -</scenario> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
44 | +</scenario> | ... | ... |
... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
23 | 23 | ||
24 | <!-- TODO: take this out when initial pingall sweep is 100% --> | 24 | <!-- TODO: take this out when initial pingall sweep is 100% --> |
25 | <step name="Initial-Ping-All" requires="Check-Apps" | 25 | <step name="Initial-Ping-All" requires="Check-Apps" |
26 | - exec="onos-mininet sendAndExpect py net.pingAll(1) --expect 600 received"/> | 26 | + exec="onos-mininet sendAndExpect py net.pingAll(1) --expect received"/> |
27 | 27 | ||
28 | <step name="Ping-All-And-Verify" requires="Check-Apps,Initial-Ping-All" | 28 | <step name="Ping-All-And-Verify" requires="Check-Apps,Initial-Ping-All" |
29 | exec="onos-mininet sendAndExpect py net.pingAll(1) --expect 600/600 received"/> | 29 | exec="onos-mininet sendAndExpect py net.pingAll(1) --expect 600/600 received"/> |
... | @@ -34,4 +34,4 @@ | ... | @@ -34,4 +34,4 @@ |
34 | <step name="Config-Topo" requires="~Check-Summary-For-Hosts" | 34 | <step name="Config-Topo" requires="~Check-Summary-For-Hosts" |
35 | exec="onos-topo-cfg ${OC1} ${ONOS_ROOT}/tools/test/topos/attmpls.json"/> | 35 | exec="onos-topo-cfg ${OC1} ${ONOS_ROOT}/tools/test/topos/attmpls.json"/> |
36 | </group> | 36 | </group> |
37 | -</scenario> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
37 | +</scenario> | ... | ... |
... | @@ -101,10 +101,10 @@ | ... | @@ -101,10 +101,10 @@ |
101 | <!-- Check that the intents can be fetched via the REST API --> | 101 | <!-- Check that the intents can be fetched via the REST API --> |
102 | <step name="Net-REST.Validate-Intent-XY-Installed" | 102 | <step name="Net-REST.Validate-Intent-XY-Installed" |
103 | requires="Net-REST.Create-Intent-YX" | 103 | requires="Net-REST.Create-Intent-YX" |
104 | - exec="curl -f -uonos:rocks ${xyLocation}"/> | 104 | + exec="curl-with-retry ${xyLocation}"/> |
105 | <step name="Net-REST.Validate-Intent-YX-Installed" | 105 | <step name="Net-REST.Validate-Intent-YX-Installed" |
106 | requires="^" | 106 | requires="^" |
107 | - exec="curl -f -uonos:rocks ${yxLocation}"/> | 107 | + exec="curl-with-retry ${yxLocation}"/> |
108 | 108 | ||
109 | <!-- Use REST API to query flows created by the intents --> | 109 | <!-- Use REST API to query flows created by the intents --> |
110 | <step name="Net-REST.Validate-Intent-XY-Flow-Installed" | 110 | <step name="Net-REST.Validate-Intent-XY-Flow-Installed" |
... | @@ -120,7 +120,7 @@ | ... | @@ -120,7 +120,7 @@ |
120 | <step name="Net-REST.Validate-YX-Flow-State" requires="^" | 120 | <step name="Net-REST.Validate-YX-Flow-State" requires="^" |
121 | exec="test '${dev4outFlowState}' == 'ADDED' -o '${dev4outFlowState}' == 'PENDING_ADD'"/> | 121 | exec="test '${dev4outFlowState}' == 'ADDED' -o '${dev4outFlowState}' == 'PENDING_ADD'"/> |
122 | <step name="Net-REST.Validate-YX-Flow-Port" requires="^" | 122 | <step name="Net-REST.Validate-YX-Flow-Port" requires="^" |
123 | - exec="test '${dev4outFlowPort}' == '3'"/> | 123 | + exec="test ${dev4outFlowPort} -ge 1 -a ${dev4outFlowPort} -le 5"/> |
124 | 124 | ||
125 | <!-- Check that connectivity was established --> | 125 | <!-- Check that connectivity was established --> |
126 | <step name="Net-REST.Ping-XY" requires="Net-REST.Create-Intent-XY,Net-REST.Create-Intent-YX" | 126 | <step name="Net-REST.Ping-XY" requires="Net-REST.Create-Intent-XY,Net-REST.Create-Intent-YX" |
... | @@ -139,22 +139,23 @@ | ... | @@ -139,22 +139,23 @@ |
139 | exec="curl -f -X DELETE -uonos:rocks ${xyLocation}"/> | 139 | exec="curl -f -X DELETE -uonos:rocks ${xyLocation}"/> |
140 | <step name="Net-REST.Delete-Intent-YX" requires="^" | 140 | <step name="Net-REST.Delete-Intent-YX" requires="^" |
141 | exec="curl -f -X DELETE -uonos:rocks ${yxLocation}"/> | 141 | exec="curl -f -X DELETE -uonos:rocks ${yxLocation}"/> |
142 | + <step name="Net-REST.Allow-Intents-To-Purge" | ||
143 | + exec="onos-check-intent ${OC1} xy INSTALLED" env="!" | ||
144 | + requires="Net-REST.Delete-Intent-XY,Net-REST.Delete-Intent-YX"/> | ||
142 | 145 | ||
143 | <!-- Use REST API to be sure that flows are no longer installed --> | 146 | <!-- Use REST API to be sure that flows are no longer installed --> |
144 | - <step name="Net-REST.Validate-XY-Flows-Removed" requires="Net-REST.Delete-Intent-XY" | 147 | + <step name="Net-REST.Validate-XY-Flows-Removed" requires="Net-REST.Allow-Intents-To-Purge" |
145 | exec="find-flow.py ${OC1} dev1out of:0000000000000001" | 148 | exec="find-flow.py ${OC1} dev1out of:0000000000000001" |
146 | env="!"/> | 149 | env="!"/> |
147 | - <step name="Net-REST.Validate-YX-Flows-Removed" requires="Net-REST.Delete-Intent-YX" | 150 | + <step name="Net-REST.Validate-YX-Flows-Removed" requires="Net-REST.Allow-Intents-To-Purge" |
148 | exec="find-flow.py ${OC1} dev4out of:0000000000000004" | 151 | exec="find-flow.py ${OC1} dev4out of:0000000000000004" |
149 | env="!"/> | 152 | env="!"/> |
150 | 153 | ||
151 | <!-- Check that the deleted intents no longer appear in the REST API --> | 154 | <!-- Check that the deleted intents no longer appear in the REST API --> |
152 | - <step name="Net-REST.Allow-Intents-To-Purge" requires="Net-REST.Delete-Intent-XY" | ||
153 | - exec="sleep 1"/> | ||
154 | <step name="Net-REST.Validate-Intent-XY-Removed" requires="Net-REST.Allow-Intents-To-Purge" | 155 | <step name="Net-REST.Validate-Intent-XY-Removed" requires="Net-REST.Allow-Intents-To-Purge" |
155 | - exec="curl -f -uonos:rocks ${xyLocation}" env="!"/> | 156 | + exec="curl-with-retry ${xyLocation}" env="!"/> |
156 | <step name="Net-REST.Validate-Intent-YX-Removed" requires="Net-REST.Allow-Intents-To-Purge" | 157 | <step name="Net-REST.Validate-Intent-YX-Removed" requires="Net-REST.Allow-Intents-To-Purge" |
157 | - exec="curl -f -uonos:rocks ${yxLocation}" env="!"/> | 158 | + exec="curl-with-retry ${yxLocation}" env="!"/> |
158 | 159 | ||
159 | </group> | 160 | </group> |
160 | </scenario> | 161 | </scenario> | ... | ... |
... | @@ -42,6 +42,7 @@ | ... | @@ -42,6 +42,7 @@ |
42 | <dependency name="Net-Teardown" requires="~Host-Intent-Connectivity, | 42 | <dependency name="Net-Teardown" requires="~Host-Intent-Connectivity, |
43 | ~P2P-Intent-Connectivity, | 43 | ~P2P-Intent-Connectivity, |
44 | ~Net-REST, | 44 | ~Net-REST, |
45 | - ~Net-Create-Flows"/> | 45 | + ~Net-Create-Flows, |
46 | + ~Net-topo"/> | ||
46 | </group> | 47 | </group> |
47 | </scenario> | 48 | </scenario> | ... | ... |
-
Please register or login to post a comment