Adding support for topology recipes and cleaning up topologies.
Cleaned-up a few STC scenarios. Change-Id: I4ffa61953d8cf289406fa572ab7603d996e26a85
Showing
19 changed files
with
132 additions
and
242 deletions
... | @@ -97,6 +97,47 @@ alias sshctl='onos-ssh' | ... | @@ -97,6 +97,47 @@ alias sshctl='onos-ssh' |
97 | alias sshnet='onos-ssh $OCN' | 97 | alias sshnet='onos-ssh $OCN' |
98 | 98 | ||
99 | 99 | ||
100 | + | ||
101 | +# Applies the settings in the specified topology recipe file or lists current | ||
102 | +# topo recipe definition if no topo recipe file is given. | ||
103 | +function topo { | ||
104 | + topo=${1:-""} | ||
105 | + case "$topo" in | ||
106 | + "") | ||
107 | + env | egrep "ONOS_TOPO" | ||
108 | + env | egrep "(OTD|OTL|OTH)=" | ||
109 | + ;; | ||
110 | + | ||
111 | + *) | ||
112 | + [ ! -f $ONOS_ROOT/tools/test/topos/$1.recipe ] && echo "No such topo recipe: $1" >&2 && return 1 | ||
113 | + unset ONOS_TOPO OTD OTL OTH ONOS_DEVICES ONOS_HOSTS | ||
114 | + unset $(env | sed -n 's:\(^OT[DLH][0-9]\{1,\}\)=.*:\1 :g p') | ||
115 | + export ONOS_TOPO=$1 | ||
116 | + . $ONOS_ROOT/tools/test/topos/$1.recipe | ||
117 | + let d=1; while [ $d -le $OTD ]; do | ||
118 | + dev="$(printf 'of:%016x' $d)" | ||
119 | + export OTD$d=$dev; export ONOS_DEVICES="$ONOS_DEVICES $dev" | ||
120 | + let d=d+1; | ||
121 | + done | ||
122 | + let h=1; while [ $h -le $OTH ]; do | ||
123 | + host="$(printf '00:00:00:00:00:%02x/-1' $h)" | ||
124 | + export OTH$h=$host; export ONOS_HOSTS="$ONOS_HOSTS $host" | ||
125 | + let h=h+1 | ||
126 | + done | ||
127 | + topo | ||
128 | + esac | ||
129 | +} | ||
130 | + | ||
131 | +# Lists available topo recipes | ||
132 | +function topos { | ||
133 | + for topo in $(ls -1 $ONOS_ROOT/tools/test/topos/*.recipe); do | ||
134 | + name=$(basename $topo .recipe) | ||
135 | + printf "%-16s %s\n" \ | ||
136 | + "$([ $name = $ONOS_TOPO ] && echo $name '*' || echo $name)" \ | ||
137 | + "$(grep '^#' $topo | head -n 1)" | ||
138 | + done | ||
139 | +} | ||
140 | + | ||
100 | # Sets the primary instance to the specified instance number. | 141 | # Sets the primary instance to the specified instance number. |
101 | function setPrimaryInstance { | 142 | function setPrimaryInstance { |
102 | export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2) | 143 | export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2) |
... | @@ -132,6 +173,7 @@ function cell { | ... | @@ -132,6 +173,7 @@ function cell { |
132 | rm -f $aux | 173 | rm -f $aux |
133 | setPrimaryInstance 1 >/dev/null | 174 | setPrimaryInstance 1 >/dev/null |
134 | onos-verify-cell | 175 | onos-verify-cell |
176 | + topo default >/dev/null | ||
135 | ;; | 177 | ;; |
136 | "return") | 178 | "return") |
137 | curl -sS -X DELETE "http://$CELL_WARDEN:4321/?user=${2:-$(id -un)}" | 179 | curl -sS -X DELETE "http://$CELL_WARDEN:4321/?user=${2:-$(id -un)}" |
... | @@ -147,7 +189,7 @@ function cell { | ... | @@ -147,7 +189,7 @@ function cell { |
147 | env | egrep "OCI" | 189 | env | egrep "OCI" |
148 | env | egrep "OC[0-9]+" | sort | 190 | env | egrep "OC[0-9]+" | sort |
149 | env | egrep "OC[NT]" | 191 | env | egrep "OC[NT]" |
150 | - env | egrep "ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES' | sort | 192 | + env | egrep "ONOS_" | egrep -v 'ONOS_ROOT|ONOS_CELL|ONOS_INSTANCES|ONOS_DEVICES|ONOS_HOSTS' | sort |
151 | ;; | 193 | ;; |
152 | 194 | ||
153 | *) | 195 | *) |
... | @@ -161,6 +203,7 @@ function cell { | ... | @@ -161,6 +203,7 @@ function cell { |
161 | . $ONOS_ROOT/tools/test/cells/$1 | 203 | . $ONOS_ROOT/tools/test/cells/$1 |
162 | setPrimaryInstance 1 >/dev/null | 204 | setPrimaryInstance 1 >/dev/null |
163 | cell | 205 | cell |
206 | + topo default >/dev/null | ||
164 | esac | 207 | esac |
165 | } | 208 | } |
166 | 209 | ... | ... |
... | @@ -46,6 +46,16 @@ function _cell-opts () { | ... | @@ -46,6 +46,16 @@ function _cell-opts () { |
46 | 46 | ||
47 | complete -F _cell-opts cell vicell | 47 | complete -F _cell-opts cell vicell |
48 | 48 | ||
49 | +# Tab completion settings for topo recipes | ||
50 | +function _topo-opts () { | ||
51 | + local cur=${COMP_WORDS[COMP_CWORD]} | ||
52 | + if [ $COMP_CWORD -eq 1 ]; then | ||
53 | + COMPREPLY=( $( compgen -W "$(cd $ONOS_ROOT/tools/test/topos && ls -1 *.recipe | sed 's/\.recipe//g')" -- $cur ) ) | ||
54 | + fi | ||
55 | +} | ||
56 | + | ||
57 | +complete -F _topo-opts topo | ||
58 | + | ||
49 | 59 | ||
50 | # Tab completion settings for onos-create-app. | 60 | # Tab completion settings for onos-create-app. |
51 | function _ocapp-opts () { | 61 | function _ocapp-opts () { | ... | ... |
... | @@ -15,62 +15,14 @@ | ... | @@ -15,62 +15,14 @@ |
15 | --> | 15 | --> |
16 | <scenario name="net-activate-fwd" description="Activate forwarding apps"> | 16 | <scenario name="net-activate-fwd" description="Activate forwarding apps"> |
17 | <group name="Net-Activate-Fwd"> | 17 | <group name="Net-Activate-Fwd"> |
18 | - <!-- TODO: parametrize this via recipes --> | 18 | + <step name="Activate-Fwd-Apps" |
19 | - | ||
20 | - <step name="Install-Fwd-Apps" | ||
21 | exec="onos ${OC1} app activate org.onosproject.openflow org.onosproject.proxyarp org.onosproject.fwd"/> | 19 | exec="onos ${OC1} app activate org.onosproject.openflow org.onosproject.proxyarp org.onosproject.fwd"/> |
22 | - <step name="Check-Fwd-Apps" requires="Install-Fwd-Apps" | 20 | + <step name="Check-Fwd-Apps-Activated" requires="Activate-Fwd-Apps" |
23 | exec="onos-check-apps ${OC1} drivers,openflow,proxyarp,fwd includes"/> | 21 | exec="onos-check-apps ${OC1} drivers,openflow,proxyarp,fwd includes"/> |
24 | 22 | ||
25 | - <step name="Check-Fwd-Flows1" requires="Check-Fwd-Apps" | 23 | + <parallel var="${OTD#}"> |
26 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000001 present"/> | 24 | + <step name="Check-Fwd-Flows-${#}" requires="Check-Fwd-Apps-Activated" |
27 | - <step name="Check-Fwd-Flows2" requires="Check-Fwd-Apps" | 25 | + exec="onos-check-ipv4-flows ${OC1} ${OTD#} present"/> |
28 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000002 present"/> | 26 | + </parallel> |
29 | - <step name="Check-Fwd-Flows3" requires="Check-Fwd-Apps" | ||
30 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000003 present"/> | ||
31 | - <step name="Check-Fwd-Flows4" requires="Check-Fwd-Apps" | ||
32 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000004 present"/> | ||
33 | - <step name="Check-Fwd-Flows5" requires="Check-Fwd-Apps" | ||
34 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000005 present"/> | ||
35 | - <step name="Check-Fwd-Flows6" requires="Check-Fwd-Apps" | ||
36 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000006 present"/> | ||
37 | - <step name="Check-Fwd-Flows7" requires="Check-Fwd-Apps" | ||
38 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000007 present"/> | ||
39 | - <step name="Check-Fwd-Flows8" requires="Check-Fwd-Apps" | ||
40 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000008 present"/> | ||
41 | - <step name="Check-Fwd-Flows9" requires="Check-Fwd-Apps" | ||
42 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000009 present"/> | ||
43 | - <step name="Check-Fwd-Flowsa" requires="Check-Fwd-Apps" | ||
44 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000a present"/> | ||
45 | - <step name="Check-Fwd-Flowsb" requires="Check-Fwd-Apps" | ||
46 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000b present"/> | ||
47 | - <step name="Check-Fwd-Flowsc" requires="Check-Fwd-Apps" | ||
48 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000c present"/> | ||
49 | - <step name="Check-Fwd-Flowsd" requires="Check-Fwd-Apps" | ||
50 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000d present"/> | ||
51 | - <step name="Check-Fwd-Flowse" requires="Check-Fwd-Apps" | ||
52 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000e present"/> | ||
53 | - <step name="Check-Fwd-Flowsf" requires="Check-Fwd-Apps" | ||
54 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000f present"/> | ||
55 | - <step name="Check-Fwd-Flows10" requires="Check-Fwd-Apps" | ||
56 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000010 present"/> | ||
57 | - <step name="Check-Fwd-Flows11" requires="Check-Fwd-Apps" | ||
58 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000011 present"/> | ||
59 | - <step name="Check-Fwd-Flows12" requires="Check-Fwd-Apps" | ||
60 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000012 present"/> | ||
61 | - <step name="Check-Fwd-Flows13" requires="Check-Fwd-Apps" | ||
62 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000013 present"/> | ||
63 | - <step name="Check-Fwd-Flows14" requires="Check-Fwd-Apps" | ||
64 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000014 present"/> | ||
65 | - <step name="Check-Fwd-Flows15" requires="Check-Fwd-Apps" | ||
66 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000015 present"/> | ||
67 | - <step name="Check-Fwd-Flows16" requires="Check-Fwd-Apps" | ||
68 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000016 present"/> | ||
69 | - <step name="Check-Fwd-Flows17" requires="Check-Fwd-Apps" | ||
70 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000017 present"/> | ||
71 | - <step name="Check-Fwd-Flows18" requires="Check-Fwd-Apps" | ||
72 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000018 present"/> | ||
73 | - <step name="Check-Fwd-Flows19" requires="Check-Fwd-Apps" | ||
74 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000019 present"/> | ||
75 | </group> | 27 | </group> |
76 | </scenario> | 28 | </scenario> | ... | ... |
... | @@ -15,61 +15,14 @@ | ... | @@ -15,61 +15,14 @@ |
15 | --> | 15 | --> |
16 | <scenario name="net-deactivate-fwd" description="Deactivate forwarding apps"> | 16 | <scenario name="net-deactivate-fwd" description="Deactivate forwarding apps"> |
17 | <group name="Net-Deactivate-Fwd"> | 17 | <group name="Net-Deactivate-Fwd"> |
18 | - <!-- TODO: parametrize this via recipes --> | 18 | + <step name="Deactivate-Fwd-Apps" |
19 | - <step name="Net-Deactivate-Fwd.Uninstall-Reactive-Forwarding" | ||
20 | exec="onos ${OC1} app deactivate org.onosproject.fwd org.onosproject.ifwd"/> | 19 | exec="onos ${OC1} app deactivate org.onosproject.fwd org.onosproject.ifwd"/> |
21 | - <step name="Net-Deactivate-Fwd.Check-Apps" requires="Net-Deactivate-Fwd.Uninstall-Reactive-Forwarding" | 20 | + <step name="Check-Fwd-Apps-Deactivated" requires="Deactivate-Fwd-Apps" |
22 | exec="onos-check-apps ${OC1} fwd,ifwd excludes"/> | 21 | exec="onos-check-apps ${OC1} fwd,ifwd excludes"/> |
23 | 22 | ||
24 | - <step name="Check-DFwd-Flows1" requires="Net-Deactivate-Fwd.Check-Apps" | 23 | + <parallel var="${OTD#}"> |
25 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000001 not-present"/> | 24 | + <step name="Check-DFwd-Flows-${#}" requires="Check-Fwd-Apps-Deactivated" |
26 | - <step name="Check-DFwd-Flows2" requires="Net-Deactivate-Fwd.Check-Apps" | 25 | + exec="onos-check-ipv4-flows ${OC1} ${OTD#} not-present"/> |
27 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000002 not-present"/> | 26 | + </parallel> |
28 | - <step name="Check-DFwd-Flows3" requires="Net-Deactivate-Fwd.Check-Apps" | ||
29 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000003 not-present"/> | ||
30 | - <step name="Check-DFwd-Flows4" requires="Net-Deactivate-Fwd.Check-Apps" | ||
31 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000004 not-present"/> | ||
32 | - <step name="Check-DFwd-Flows5" requires="Net-Deactivate-Fwd.Check-Apps" | ||
33 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000005 not-present"/> | ||
34 | - <step name="Check-DFwd-Flows6" requires="Net-Deactivate-Fwd.Check-Apps" | ||
35 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000006 not-present"/> | ||
36 | - <step name="Check-DFwd-Flows7" requires="Net-Deactivate-Fwd.Check-Apps" | ||
37 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000007 not-present"/> | ||
38 | - <step name="Check-DFwd-Flows8" requires="Net-Deactivate-Fwd.Check-Apps" | ||
39 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000008 not-present"/> | ||
40 | - <step name="Check-DFwd-Flows9" requires="Net-Deactivate-Fwd.Check-Apps" | ||
41 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000009 not-present"/> | ||
42 | - <step name="Check-DFwd-Flowsa" requires="Net-Deactivate-Fwd.Check-Apps" | ||
43 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000a not-present"/> | ||
44 | - <step name="Check-DFwd-Flowsb" requires="Net-Deactivate-Fwd.Check-Apps" | ||
45 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000b not-present"/> | ||
46 | - <step name="Check-DFwd-Flowsc" requires="Net-Deactivate-Fwd.Check-Apps" | ||
47 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000c not-present"/> | ||
48 | - <step name="Check-DFwd-Flowsd" requires="Net-Deactivate-Fwd.Check-Apps" | ||
49 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000d not-present"/> | ||
50 | - <step name="Check-DFwd-Flowse" requires="Net-Deactivate-Fwd.Check-Apps" | ||
51 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000e not-present"/> | ||
52 | - <step name="Check-DFwd-Flowsf" requires="Net-Deactivate-Fwd.Check-Apps" | ||
53 | - exec="onos-check-ipv4-flows ${OC1} of:000000000000000f not-present"/> | ||
54 | - <step name="Check-DFwd-Flows10" requires="Net-Deactivate-Fwd.Check-Apps" | ||
55 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000010 not-present"/> | ||
56 | - <step name="Check-DFwd-Flows11" requires="Net-Deactivate-Fwd.Check-Apps" | ||
57 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000011 not-present"/> | ||
58 | - <step name="Check-DFwd-Flows12" requires="Net-Deactivate-Fwd.Check-Apps" | ||
59 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000012 not-present"/> | ||
60 | - <step name="Check-DFwd-Flows13" requires="Net-Deactivate-Fwd.Check-Apps" | ||
61 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000013 not-present"/> | ||
62 | - <step name="Check-DFwd-Flows14" requires="Net-Deactivate-Fwd.Check-Apps" | ||
63 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000014 not-present"/> | ||
64 | - <step name="Check-DFwd-Flows15" requires="Net-Deactivate-Fwd.Check-Apps" | ||
65 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000015 not-present"/> | ||
66 | - <step name="Check-DFwd-Flows16" requires="Net-Deactivate-Fwd.Check-Apps" | ||
67 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000016 not-present"/> | ||
68 | - <step name="Check-DFwd-Flows17" requires="Net-Deactivate-Fwd.Check-Apps" | ||
69 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000017 not-present"/> | ||
70 | - <step name="Check-DFwd-Flows18" requires="Net-Deactivate-Fwd.Check-Apps" | ||
71 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000018 not-present"/> | ||
72 | - <step name="Check-DFwd-Flows19" requires="Net-Deactivate-Fwd.Check-Apps" | ||
73 | - exec="onos-check-ipv4-flows ${OC1} of:0000000000000019 not-present"/> | ||
74 | </group> | 27 | </group> |
75 | </scenario> | 28 | </scenario> | ... | ... |
... | @@ -14,31 +14,31 @@ | ... | @@ -14,31 +14,31 @@ |
14 | ~ limitations under the License. | 14 | ~ limitations under the License. |
15 | --> | 15 | --> |
16 | <scenario name="net-link-down-up" description="Network link up-down test"> | 16 | <scenario name="net-link-down-up" description="Network link up-down test"> |
17 | - <!-- TODO: parametrize this via recipes --> | 17 | + <!-- Note: This scenario is tailored using 'topo' recipe mechanism; see topos/*.recipe files --> |
18 | <group name="Net-Link-Down-Up"> | 18 | <group name="Net-Link-Down-Up"> |
19 | <step name="Ping-1" | 19 | <step name="Ping-1" |
20 | - exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 20 | + exec="onos-mininet sendAndExpect ${OPS} ping -c1 ${OPD} --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 ${OPL1} down --expect ."/> |
23 | <step name="Ping-2-Prep" requires="~Link-1-Down" | 23 | <step name="Ping-2-Prep" requires="~Link-1-Down" |
24 | - exec="onos-mininet sendAndExpect h1 ping -c5 h4 --expect ."/> | 24 | + exec="onos-mininet sendAndExpect ${OPS} ping -c5 ${OPD} --expect ."/> |
25 | <step name="Ping-2" requires="~Ping-2-Prep" | 25 | <step name="Ping-2" requires="~Ping-2-Prep" |
26 | - exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 26 | + exec="onos-mininet sendAndExpect ${OPS} ping -c1 ${OPD} --expect \ 0% packet loss"/> |
27 | <step name="Link-2-Down" requires="~Ping-2" | 27 | <step name="Link-2-Down" requires="~Ping-2" |
28 | - exec="onos-mininet sendAndExpect link s4 s5 down --expect ."/> | 28 | + exec="onos-mininet sendAndExpect link ${OPL2} down --expect ."/> |
29 | <step name="Ping-3" requires="~Link-2-Down" | 29 | <step name="Ping-3" requires="~Link-2-Down" |
30 | - exec="onos-mininet sendAndExpect h1 ping -c1 -w1 h4 --expect 100% packet loss"/> | 30 | + exec="onos-mininet sendAndExpect ${OPS} ping -c1 -w1 ${OPD} --expect 100% packet loss"/> |
31 | <step name="Link-1-Up" requires="~Ping-3" | 31 | <step name="Link-1-Up" requires="~Ping-3" |
32 | - exec="onos-mininet sendAndExpect link s4 s7 up --expect ."/> | 32 | + exec="onos-mininet sendAndExpect link ${OPL1} up --expect ."/> |
33 | <step name="Ping-4-Prep" requires="~Link-1-Up" | 33 | <step name="Ping-4-Prep" requires="~Link-1-Up" |
34 | - exec="onos-mininet sendAndExpect h1 ping -c5 h4 --expect ."/> | 34 | + exec="onos-mininet sendAndExpect ${OPS} ping -c5 ${OPD} --expect ."/> |
35 | <step name="Ping-4" requires="~Ping-4-Prep" | 35 | <step name="Ping-4" requires="~Ping-4-Prep" |
36 | - exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 36 | + exec="onos-mininet sendAndExpect ${OPS} ping -c1 ${OPD} --expect \ 0% packet loss"/> |
37 | <step name="Link-2-Up" requires="~Ping-4" | 37 | <step name="Link-2-Up" requires="~Ping-4" |
38 | - exec="onos-mininet sendAndExpect link s4 s5 up --expect ."/> | 38 | + exec="onos-mininet sendAndExpect link ${OPL2} up --expect ."/> |
39 | <step name="Ping-5-Prep" requires="~Link-2-Up" | 39 | <step name="Ping-5-Prep" requires="~Link-2-Up" |
40 | - exec="onos-mininet sendAndExpect h1 ping -c5 h4 --expect ."/> | 40 | + exec="onos-mininet sendAndExpect ${OPS} ping -c5 ${OPD} --expect ."/> |
41 | <step name="Ping-5" requires="~Ping-5-Prep" | 41 | <step name="Ping-5" requires="~Ping-5-Prep" |
42 | - exec="onos-mininet sendAndExpect h1 ping -c1 h4 --expect \ 0% packet loss"/> | 42 | + exec="onos-mininet sendAndExpect ${OPS} ping -c1 ${OPD} --expect \ 0% packet loss"/> |
43 | </group> | 43 | </group> |
44 | </scenario> | 44 | </scenario> | ... | ... |
... | @@ -14,14 +14,13 @@ | ... | @@ -14,14 +14,13 @@ |
14 | ~ limitations under the License. | 14 | ~ limitations under the License. |
15 | --> | 15 | --> |
16 | <scenario name="net-pingall" description="Network pingall test"> | 16 | <scenario name="net-pingall" description="Network pingall test"> |
17 | - <!-- TODO: parametrize this via recipes --> | 17 | + <!-- Note: This scenario is tailored using 'topo' recipe mechanism; see topos/*.recipe files --> |
18 | <group name="Net-Pingall"> | 18 | <group name="Net-Pingall"> |
19 | 19 | ||
20 | <step name="Ping-All" requires="Check-Apps" | 20 | <step name="Ping-All" requires="Check-Apps" |
21 | - exec="onos-mininet sendAndExpect pingall --expect 600/600 received"/> | 21 | + exec="onos-mininet sendAndExpect pingall --expect ${OPALL}/${OPALL} received"/> |
22 | 22 | ||
23 | <step name="Check-Summary-For-Hosts" requires="~Ping-All" | 23 | <step name="Check-Summary-For-Hosts" requires="~Ping-All" |
24 | - exec="onos-check-summary ${OC1} [0-9]* 25 140 25"/> | 24 | + exec="onos-check-summary ${OC1} [0-9]* ${OTD} ${OTL} ${OTH}"/> |
25 | - | ||
26 | </group> | 25 | </group> |
27 | </scenario> | 26 | </scenario> | ... | ... |
... | @@ -14,18 +14,16 @@ | ... | @@ -14,18 +14,16 @@ |
14 | ~ limitations under the License. | 14 | ~ limitations under the License. |
15 | --> | 15 | --> |
16 | <scenario name="net-reactive-fwd" description="Network reactive forwarding test"> | 16 | <scenario name="net-reactive-fwd" description="Network reactive forwarding test"> |
17 | - <!-- TODO: parametrize this via recipes --> | ||
18 | <group name="Net-Reactive-Fwd"> | 17 | <group name="Net-Reactive-Fwd"> |
19 | <import file="${ONOS_SCENARIOS}/net-activate-fwd.xml" namespace="Net-Reactive-Fwd"/> | 18 | <import file="${ONOS_SCENARIOS}/net-activate-fwd.xml" namespace="Net-Reactive-Fwd"/> |
20 | - <dependency name="Net-Reactive-Fwd.Net-Activate-Fwd" requires="Net-Setup"/> | ||
21 | 19 | ||
22 | <import file="${ONOS_SCENARIOS}/net-pingall.xml" namespace="Net-Reactive-Fwd"/> | 20 | <import file="${ONOS_SCENARIOS}/net-pingall.xml" namespace="Net-Reactive-Fwd"/> |
23 | <dependency name="Net-Reactive-Fwd.Net-Pingall" requires="Net-Reactive-Fwd.Net-Activate-Fwd"/> | 21 | <dependency name="Net-Reactive-Fwd.Net-Pingall" requires="Net-Reactive-Fwd.Net-Activate-Fwd"/> |
24 | 22 | ||
25 | <import file="${ONOS_SCENARIOS}/net-link-down-up.xml" namespace="Net-Reactive-Fwd"/> | 23 | <import file="${ONOS_SCENARIOS}/net-link-down-up.xml" namespace="Net-Reactive-Fwd"/> |
26 | - <dependency name="Net-Reactive-Fwd.Net-Link-Down-Up" requires="Net-Setup,~Net-Reactive-Fwd.Net-Pingall"/> | 24 | + <dependency name="Net-Reactive-Fwd.Net-Link-Down-Up" requires="~Net-Reactive-Fwd.Net-Pingall"/> |
27 | 25 | ||
28 | <import file="${ONOS_SCENARIOS}/net-deactivate-fwd.xml" namespace="Net-Reactive-Fwd"/> | 26 | <import file="${ONOS_SCENARIOS}/net-deactivate-fwd.xml" namespace="Net-Reactive-Fwd"/> |
29 | - <dependency name="Net-Reactive-Fwd.Net-Deactivate-Fwd" requires="Net-Reactive-Fwd.Net-Link-Down-Up"/> | 27 | + <dependency name="Net-Reactive-Fwd.Net-Deactivate-Fwd" requires="~Net-Reactive-Fwd.Net-Link-Down-Up"/> |
30 | </group> | 28 | </group> |
31 | </scenario> | 29 | </scenario> | ... | ... |
1 | -<!-- | ||
2 | - ~ Copyright 2016-present Open Networking Laboratory | ||
3 | - ~ | ||
4 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | - ~ you may not use this file except in compliance with the License. | ||
6 | - ~ You may obtain a copy of the License at | ||
7 | - ~ | ||
8 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - ~ | ||
10 | - ~ Unless required by applicable law or agreed to in writing, software | ||
11 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | - ~ See the License for the specific language governing permissions and | ||
14 | - ~ limitations under the License. | ||
15 | - --> | ||
16 | -<scenario name="net-setup-geant" description="Network setup steps"> | ||
17 | - <!-- TODO: parametrize this via recipes --> | ||
18 | - <group name="Net-Setup"> | ||
19 | - <step name="Push-Topos" exec="onos-push-topos ${OCN}"/> | ||
20 | - | ||
21 | - <step name="Stop-Mininet-If-Needed" env="~" exec="onos-mininet stop"/> | ||
22 | - <step name="Wipe-Out-Data-Before" exec="onos-wipe-out" requires="^"/> | ||
23 | - | ||
24 | - <step name="Initial-Summary-Check" requires="~Wipe-Out-Data-Before" | ||
25 | - exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/> | ||
26 | - | ||
27 | - <step name="Config-Topo" requires="~Initial-Summary-Check" | ||
28 | - exec="onos-netcfg ${OC1} ${ONOS_ROOT}/tools/test/topos/geantmpls-cfg.json"/> | ||
29 | - | ||
30 | - <step name="Start-Mininet" | ||
31 | - requires="Install-Apps,Config-Topo,Push-Topos,Stop-Mininet-If-Needed" | ||
32 | - exec="onos-mininet start topos/topo geantmpls.py ${ONOS_INSTANCES}"/> | ||
33 | - | ||
34 | - <step name="Wait-For-Mininet" requires="Start-Mininet" | ||
35 | - exec="onos-mininet wait 10"/> | ||
36 | - | ||
37 | - <step name="ARP-Hosts" requires="~Wait-For-Mininet" | ||
38 | - exec="onos-mininet sendAndExpect gratuitousArp --expect ."/> | ||
39 | - | ||
40 | - <step name="Check-Summary" requires="ARP-Hosts" | ||
41 | - exec="onos-check-summary ${OC1} [0-9]* 31 108 31"/> | ||
42 | - | ||
43 | - <step name="Balance-Masters" requires="~Check-Summary" if="${OC2}" | ||
44 | - exec="onos ${OC1} balance-masters"/> | ||
45 | - | ||
46 | - <step name="Check-Flows" requires="~Balance-Masters,~Check-Summary" delay="5" | ||
47 | - exec="onos-check-flows ${OC1}"/> | ||
48 | - </group> | ||
49 | -</scenario> |
1 | -<!-- | ||
2 | - ~ Copyright 2016-present Open Networking Laboratory | ||
3 | - ~ | ||
4 | - ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | - ~ you may not use this file except in compliance with the License. | ||
6 | - ~ You may obtain a copy of the License at | ||
7 | - ~ | ||
8 | - ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - ~ | ||
10 | - ~ Unless required by applicable law or agreed to in writing, software | ||
11 | - ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | - ~ See the License for the specific language governing permissions and | ||
14 | - ~ limitations under the License. | ||
15 | - --> | ||
16 | -<scenario name="net-setup-uk" description="Network setup steps"> | ||
17 | - <!-- TODO: parametrize this via recipes --> | ||
18 | - <!-- Customized for the UK topology --> | ||
19 | - <group name="Net-Setup-UK"> | ||
20 | - | ||
21 | - <step name="Push-Topos" exec="onos-push-topos ${OCN}"/> | ||
22 | - | ||
23 | - <step name="Stop-Mininet-If-Needed" env="~" exec="onos-mininet stop"/> | ||
24 | - <step name="Wipe-Out-Data-Before" exec="onos-wipe-out" requires="^"/> | ||
25 | - | ||
26 | - <step name="Initial-Summary-Check" requires="~Wipe-Out-Data-Before" | ||
27 | - exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/> | ||
28 | - | ||
29 | - <step name="Config-Topo" requires="~Initial-Summary-Check" | ||
30 | - exec="onos-netcfg ${OC1} ${ONOS_ROOT}/tools/test/topos/uk-cfg.json"/> | ||
31 | - | ||
32 | - <step name="Start-Mininet" | ||
33 | - requires="Install-Apps,Config-Topo,Push-Topos,Stop-Mininet-If-Needed" | ||
34 | - exec="onos-mininet start topos/topo uk-onos.py ${ONOS_INSTANCES}"/> | ||
35 | - | ||
36 | - <step name="Wait-For-Mininet" requires="Start-Mininet" | ||
37 | - exec="onos-mininet wait 10"/> | ||
38 | - | ||
39 | - <step name="Check-Summary" requires="~Wait-For-Mininet" | ||
40 | - exec="onos-check-summary ${OC1} [0-9]* 12 46 12"/> | ||
41 | - | ||
42 | - <step name="Balance-Masters" requires="~Check-Summary" if="${OC2}" | ||
43 | - exec="onos ${OC1} balance-masters"/> | ||
44 | - | ||
45 | - <step name="Check-Flows" requires="~Balance-Masters,~Check-Summary" delay="5" | ||
46 | - exec="onos-check-flows ${OC1}"/> | ||
47 | - </group> | ||
48 | -</scenario> |
... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
14 | ~ limitations under the License. | 14 | ~ limitations under the License. |
15 | --> | 15 | --> |
16 | <scenario name="net-setup" description="Network setup steps"> | 16 | <scenario name="net-setup" description="Network setup steps"> |
17 | - <!-- TODO: parametrize this via recipes --> | 17 | + <!-- Note: This scenario is tailored using 'topo' recipe mechanism; see topos/*.recipe files --> |
18 | <group name="Net-Setup"> | 18 | <group name="Net-Setup"> |
19 | <step name="Push-Topos" exec="onos-push-topos ${OCN}"/> | 19 | <step name="Push-Topos" exec="onos-push-topos ${OCN}"/> |
20 | 20 | ||
... | @@ -25,11 +25,11 @@ | ... | @@ -25,11 +25,11 @@ |
25 | exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/> | 25 | exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/> |
26 | 26 | ||
27 | <step name="Config-Topo" requires="~Initial-Summary-Check" | 27 | <step name="Config-Topo" requires="~Initial-Summary-Check" |
28 | - exec="onos-netcfg ${OC1} ${ONOS_ROOT}/tools/test/topos/attmpls-cfg.json"/> | 28 | + exec="onos-netcfg ${OC1} ${ONOS_ROOT}/tools/test/topos/${ONOS_TOPO}.json"/> |
29 | 29 | ||
30 | <step name="Start-Mininet" | 30 | <step name="Start-Mininet" |
31 | requires="Install-Apps,Config-Topo,Push-Topos,Stop-Mininet-If-Needed" | 31 | requires="Install-Apps,Config-Topo,Push-Topos,Stop-Mininet-If-Needed" |
32 | - exec="onos-mininet start topos/topo attmplsfast.py ${ONOS_INSTANCES}"/> | 32 | + exec="onos-mininet start topos/topo ${ONOS_TOPO}.py ${ONOS_INSTANCES}"/> |
33 | 33 | ||
34 | <step name="Wait-For-Mininet" requires="Start-Mininet" | 34 | <step name="Wait-For-Mininet" requires="Start-Mininet" |
35 | exec="onos-mininet wait 10"/> | 35 | exec="onos-mininet wait 10"/> |
... | @@ -38,7 +38,7 @@ | ... | @@ -38,7 +38,7 @@ |
38 | exec="onos-mininet sendAndExpect gratuitousArp --expect ."/> | 38 | exec="onos-mininet sendAndExpect gratuitousArp --expect ."/> |
39 | 39 | ||
40 | <step name="Check-Summary" requires="ARP-Hosts" | 40 | <step name="Check-Summary" requires="ARP-Hosts" |
41 | - exec="onos-check-summary ${OC1} [0-9]* 25 140 25"/> | 41 | + exec="onos-check-summary ${OC1} [0-9]* ${OTD} ${OTL} ${OTH}"/> |
42 | 42 | ||
43 | <step name="Balance-Masters" requires="~Check-Summary" if="${OC2}" | 43 | <step name="Balance-Masters" requires="~Check-Summary" if="${OC2}" |
44 | exec="onos ${OC1} balance-masters"/> | 44 | exec="onos ${OC1} balance-masters"/> | ... | ... |
... | @@ -3,14 +3,6 @@ | ... | @@ -3,14 +3,6 @@ |
3 | """ | 3 | """ |
4 | """ | 4 | """ |
5 | from mininet.topo import Topo | 5 | from mininet.topo import Topo |
6 | -from mininet.net import Mininet | ||
7 | -from mininet.node import RemoteController | ||
8 | -from mininet.node import Node | ||
9 | -from mininet.node import CPULimitedHost | ||
10 | -from mininet.link import TCLink | ||
11 | -from mininet.cli import CLI | ||
12 | -from mininet.log import setLogLevel | ||
13 | -from mininet.util import dumpNodeConnections | ||
14 | 6 | ||
15 | class AttMplsTopo( Topo ): | 7 | class AttMplsTopo( Topo ): |
16 | "Internet Topology Zoo Specimen." | 8 | "Internet Topology Zoo Specimen." | ... | ... |
tools/test/topos/default.recipe
0 → 100644
1 | +# Default US MPLS topology recipe | ||
2 | +export OTD=25 | ||
3 | +export OTL=140 | ||
4 | +export OTH=25 | ||
5 | + | ||
6 | + | ||
7 | +# Variables for the pingall scenario. | ||
8 | +export OPALL=600 | ||
9 | + | ||
10 | +# Variables for link-up-down-up scenario. | ||
11 | +export OPS=h1 | ||
12 | +export OPD=h4 | ||
13 | +export OPL1="s4 s7" | ||
14 | +export OPL2="s4 s5" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -118,8 +118,8 @@ class GeantMplsTopo( Topo ): | ... | @@ -118,8 +118,8 @@ class GeantMplsTopo( Topo ): |
118 | self.addLink( HAM , HAM_host ) | 118 | self.addLink( HAM , HAM_host ) |
119 | self.addLink( AMS , AMS_host ) | 119 | self.addLink( AMS , AMS_host ) |
120 | self.addLink( STO , STO_host ) | 120 | self.addLink( STO , STO_host ) |
121 | - self.addLink( HEL , HEL_host ) | ||
122 | self.addLink( OSL , OSL_host ) | 121 | self.addLink( OSL , OSL_host ) |
122 | + self.addLink( HEL , HEL_host ) | ||
123 | 123 | ||
124 | # add edges between switches | 124 | # add edges between switches |
125 | self.addLink( ATH , MIL, bw=10 ) | 125 | self.addLink( ATH , MIL, bw=10 ) | ... | ... |
tools/test/topos/geant.recipe
0 → 100644
1 | +# GEANT & Nordnet topology recipe | ||
2 | +export OTD=31 | ||
3 | +export OTL=108 | ||
4 | +export OTH=31 | ||
5 | + | ||
6 | +# Variables for the pingall scenario. | ||
7 | +export OPALL=930 | ||
8 | + | ||
9 | +# Variables for link-up-down-up scenario. | ||
10 | +export OPS=h3 | ||
11 | +export OPD=h31 | ||
12 | +export OPL1="s31 s14" | ||
13 | +export OPL2="s31 s30" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
tools/test/topos/uk.recipe
0 → 100644
1 | +# Simple UK topology recipe | ||
2 | +export OTD=12 | ||
3 | +export OTL=46 | ||
4 | +export OTH=12 | ||
5 | + | ||
6 | +# Variables for the pingall scenario. | ||
7 | +export OPALL=132 | ||
8 | + | ||
9 | +# Variables for link-up-down-up scenario. | ||
10 | +export OPS=h6 | ||
11 | +export OPD=h11 | ||
12 | +export OPL1="s11 s7" | ||
13 | +export OPL2="s11 s9" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -172,11 +172,11 @@ public class UiExtensionManager | ... | @@ -172,11 +172,11 @@ public class UiExtensionManager |
172 | new UiTopoMap("americas", "North, Central and South America", "*americas", 0.7), | 172 | new UiTopoMap("americas", "North, Central and South America", "*americas", 0.7), |
173 | new UiTopoMap("n_america", "North America", "*n_america", 0.9), | 173 | new UiTopoMap("n_america", "North America", "*n_america", 0.9), |
174 | new UiTopoMap("s_america", "South America", "*s_america", 0.9), | 174 | new UiTopoMap("s_america", "South America", "*s_america", 0.9), |
175 | - new UiTopoMap("usa", "United States", "*continental_us", 1.0), | 175 | + new UiTopoMap("usa", "United States", "*continental_us", 1.3), |
176 | new UiTopoMap("bayareaGEO", "Bay Area, California", "*bayarea", 1.0), | 176 | new UiTopoMap("bayareaGEO", "Bay Area, California", "*bayarea", 1.0), |
177 | - new UiTopoMap("europe", "Europe", "*europe", 9.0), | 177 | + new UiTopoMap("europe", "Europe", "*europe", 10.0), |
178 | new UiTopoMap("italy", "Italy", "*italy", 0.8), | 178 | new UiTopoMap("italy", "Italy", "*italy", 0.8), |
179 | - new UiTopoMap("uk", "United Kingdom and Ireland", "*uk", 0.6), | 179 | + new UiTopoMap("uk", "United Kingdom and Ireland", "*uk", 2.0), |
180 | new UiTopoMap("japan", "Japan", "*japan", 0.8), | 180 | new UiTopoMap("japan", "Japan", "*japan", 0.8), |
181 | new UiTopoMap("s_korea", "South Korea", "*s_korea", 0.75), | 181 | new UiTopoMap("s_korea", "South Korea", "*s_korea", 0.75), |
182 | new UiTopoMap("taiwan", "Taiwan", "*taiwan", 0.7), | 182 | new UiTopoMap("taiwan", "Taiwan", "*taiwan", 0.7), | ... | ... |
-
Please register or login to post a comment