Committed by
Gerrit Code Review
Remove flow objectives after test completes
Change-Id: I62ec858803b7767d98ac24e3693834aa13c6ee06
Showing
2 changed files
with
62 additions
and
0 deletions
| 1 | +# /bin/sh | ||
| 2 | + | ||
| 3 | +if [ "$#" -ne 6 ] | ||
| 4 | +then | ||
| 5 | + echo usage: create-forward-objective.sh onos device src-mac dst-mac src-port dst-port | ||
| 6 | + exit 1 | ||
| 7 | +fi | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +onos=$1 | ||
| 11 | +device=$2 | ||
| 12 | +srcMac=$3 | ||
| 13 | +dstMac=$4 | ||
| 14 | +srcPort=$5 | ||
| 15 | +dstPort=$6 | ||
| 16 | + | ||
| 17 | +curl -u onos:rocks -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{ | ||
| 18 | + \"priority\": 100, | ||
| 19 | + \"isPermanent\": \"false\", | ||
| 20 | + \"timeout\": 100, | ||
| 21 | + \"flag\": \"VERSATILE\", | ||
| 22 | + \"operation\": \"REMOVE\", | ||
| 23 | + \"selector\": { | ||
| 24 | + \"criteria\": [ | ||
| 25 | + {\"type\": \"ETH_TYPE\", \"ethType\": 2048}, | ||
| 26 | + {\"type\": \"IN_PORT\", \"port\": \"$srcPort\"}, | ||
| 27 | + {\"type\": \"ETH_DST\", \"mac\": \"$dstMac\"}, | ||
| 28 | + {\"type\": \"ETH_SRC\", \"mac\": \"$srcMac\"} | ||
| 29 | + ] | ||
| 30 | + }, | ||
| 31 | + \"treatment\": | ||
| 32 | + { | ||
| 33 | + \"instructions\": | ||
| 34 | + [ | ||
| 35 | + {\"type\":\"OUTPUT\",\"port\":$dstPort} | ||
| 36 | + ], | ||
| 37 | + \"deferred\":[] | ||
| 38 | + } | ||
| 39 | +}" http://${onos}:8181/onos/v1/flowobjectives/$device/forward | ||
| 40 | + | ||
| 41 | +echo |
| ... | @@ -78,5 +78,26 @@ | ... | @@ -78,5 +78,26 @@ |
| 78 | <step name="Net-Flow-Objectives.Ping-YX" requires="^" | 78 | <step name="Net-Flow-Objectives.Ping-YX" requires="^" |
| 79 | exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 0% packet loss"/> | 79 | exec="onos-mininet sendAndExpect h4 ping -c1 h1 --expect \ 0% packet loss"/> |
| 80 | 80 | ||
| 81 | + <!-- Use REST API to remove flow objectives --> | ||
| 82 | + <step name="Net-Flow-Objectives.Objective-R1F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 83 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:01 00:00:00:00:00:04 1 2"/> | ||
| 84 | + <step name="Net-Flow-Objectives.Objective-R1R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 85 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000001 00:00:00:00:00:04 00:00:00:00:00:01 2 1"/> | ||
| 86 | + | ||
| 87 | + <step name="Net-Flow-Objectives.Objective-R19F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 88 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:01 00:00:00:00:00:04 2 8"/> | ||
| 89 | + <step name="Net-Flow-Objectives.Objective-R19R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 90 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000019 00:00:00:00:00:04 00:00:00:00:00:01 8 2"/> | ||
| 91 | + | ||
| 92 | + <step name="Net-Flow-Objectives.Objective-R7F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 93 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:01 00:00:00:00:00:04 2 3"/> | ||
| 94 | + <step name="Net-Flow-Objectives.Objective-R7R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 95 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000007 00:00:00:00:00:04 00:00:00:00:00:01 3 2"/> | ||
| 96 | + | ||
| 97 | + <step name="Net-Flow-Objectives.Objective-R4F" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 98 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:01 00:00:00:00:00:04 3 1"/> | ||
| 99 | + <step name="Net-Flow-Objectives.Objective-R4R" requires="Net-Flow-Objectives.Ping-YX, Net-Flow-Objectives.Ping-XY" | ||
| 100 | + exec="remove-forward-objective.sh ${OC1} of:0000000000000004 00:00:00:00:00:04 00:00:00:00:00:01 1 3"/> | ||
| 101 | + | ||
| 81 | </group> | 102 | </group> |
| 82 | </scenario> | 103 | </scenario> | ... | ... |
-
Please register or login to post a comment