Changes between Version 42 and Version 43 of OpenFlow/FOAM/Testing
- Timestamp:
- 06/22/13 01:41:30 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OpenFlow/FOAM/Testing
v42 v43 2 2 3 3 = Testing FOAM = 4 5 NOTE that all the foamctl commands on this page now use the new 0.8 syntax. If you want an older version, with the 0.6 syntax, try http://groups.geni.net/geni/wiki/OpenFlow/FOAM/Testing?version=6 instead.6 7 NOTE that we've steadily increased the extent to which these tests are automated, by scripts that are currently GPO-only. We're working on making them public, but in the meanwhile, this page may not be as useful for non-BBN sites.8 4 9 5 This page describes a couple of ways to test FOAM: … … 23 19 Pre-requisites/assumptions: 24 20 25 * You're set up to use Omni in general, and have it in your path as 'omni', i.e. you've successfully used Omni to reserve GENI resources (and have the latest version of the software, a user credential signed by a CA that's trusted by the FOAM server you intend to test, a working omni_config file, etc). 26 * You have a valid request rspec file to test with. We plan to make some sample rspecs available. 27 * You can log in non-interactively to the FOAM and FV servers, and have admin privs there, and have the FOAM and fvadmin password stored in files (/etc/foam.passwd and /etc/flowvisor.passwd). (This generally can't be used as-is to test FOAM at other sites.) 28 * You know what output to expect when common things succeed. (Expected output is described here only in cases where an error is the expected result, or where it otherwise might not be obvious; if you think the expected output isn't obvious for any given step, let us know.) 29 * The URL of the FOAM server is also a name that you can use to log in to it. (Very likely, but might be untrue with virtualhosts or some other odd thing.) 30 * On the FOAM server you're testing, when you create a sliver, it will be automatically approved. (More specifically, that geni.openflow.analysis-engine = True (analyze slivers for overlap), and geni.approval.approve-on-creation = 2 (approve slivers at creation time if they don't fail any overlap-analysis tests), and the test sliver's rspec describes a flowspace that will pass overlap analysis.) 21 * You're set up to use Omni in general, and have it in your path as 'omni', i.e. you've successfully used Omni to reserve GENI resources (and have the latest version of the software, a user credential signed by a CA that's trusted by the FOAM server you intend to test, a working omni_config file which sets a default project, etc). 22 * You have a valid request rspec file to test with, which will be auto-approved on your FOAM server, and result in two !FlowVisor flowspace rules. We plan to make some sample rspecs available. 23 * You can log in non-interactively to the FOAM and FV servers, and have admin privs there, and have the FOAM and fvadmin password stored in files (/etc/foam.passwd and /etc/flowvisor.passwd). (This requirement means that these tests generally can't be used as-is to test FOAM at sites other than your own.) 24 * You know what output to expect when common things succeed. (Expected output is described here only in cases where an error is the expected result, or where it otherwise might not be obvious; if you think the expected output isn't obvious for any given step, let us know so we can update the docs.) 25 * The hostname part of the URL of the FOAM server is also a name that you can use to log in to it. (Very likely, but might be untrue with virtualhosts or some other odd thing.) 31 26 * On the FOAM server you're testing, when the 'www-data' user runs a cron job that has output, it sends mail to 'www-data', and you can receive this mail. 32 * On the FOAM server you're testing, you have the foam-confirm-sliver, flowvisor-confirm-fvslice-exists, and flowvisor-confirm-flowspace-rule-count scripts. (These are currently GPO-only; GPO folks, they're in the syseng repo, under gposw.)33 * On the system where you're running commands, you have the foam-create-and-verify-sliver script.34 35 Note that the scripts mentioned in the last two items are currently GPO-only. (GPO folks, they're in the syseng repo, under gposw.)36 27 37 28 You can run most of these tests wherever you usually use Omni; they don't need to run on the FOAM/FV server, except as noted below. … … 60 51 61 52 {{{ 62 rspec=~/rspecs/request/foam-testing/rspecs/$foamserver/ openflow-mac-acedcodefood.rspec63 }}} 64 65 Set the slicename to something with your username and"foamtest":53 rspec=~/rspecs/request/foam-testing/rspecs/$foamserver/mac-acedcodefood-vlan-none.rspec 54 }}} 55 56 Set the slicename to be your username plus "foamtest": 66 57 67 58 {{{ … … 69 60 }}} 70 61 71 Set the full slice URN (modify this if you're not using pgeni.gpolab.bbn.com as your Slice Authority), and a version of it for handing off to egrep later: 72 73 {{{ 74 slice_urn=urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+$slicename 62 Set the full slice URN (modify this if you're not using ch.geni.net as your Slice Authority), and a version of it for handing off to egrep later: 63 64 {{{ 65 default_project=$(grep '^default_project' ~/.gcf/omni_config | head -1 | awk '{print $NF}') 66 slice_urn=urn:publicid:IDN+ch.geni.net:${default_project}+slice+$slicename 75 67 slice_urn_egrep=$(echo $slice_urn | sed -e 's/+/\\+'/g) 76 68 }}} … … 90 82 fvserver=$foamserver 91 83 am=https://${foamserver}:3626/foam/gapi/1 92 rspec=~/rspecs/request/foam-testing/rspecs/$foamserver/ openflow-mac-acedcodefood.rspec84 rspec=~/rspecs/request/foam-testing/rspecs/$foamserver/mac-acedcodefood-vlan-none.rspec 93 85 slicename=${USER}foamtest 94 slice_urn=urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+$slicename 86 default_project=$(grep '^default_project' ~/.gcf/omni_config | head -1 | awk '{print $NF}') 87 slice_urn=urn:publicid:IDN+ch.geni.net:${default_project}+slice+$slicename 95 88 slice_urn_egrep=$(echo $slice_urn | sed -e 's/+/\\+'/g) 96 89 omni -a $am getversion … … 102 95 This subsection runs creates a sliver, and runs through a sequence of approve/disable/reject/delete actions to confirm that it can transition from any of those states to the others, and checks the FlowVisor after each change to confirm that the sliver is or isn't enabled (as appropriate). 103 96 104 Create and verify the sliver: 105 106 {{{ 107 foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename $rspec approved true 2 97 Create the slice and sliver: 98 99 {{{ 100 omni createslice $slicename >& /dev/null 101 omni -a $am createsliver $slicename $rspec >& /dev/null 108 102 }}} 109 103 110 104 (That should generate a "sliver created" and a "sliver approved" e-mail message, one of each to the experimenter and one of each to the FOAM admin.) 111 105 112 Get the sliver URN from FOAM, and put it into $sliver_urn :106 Get the sliver URN from FOAM, and put it into $sliver_urn; and deduce the FV slicename from that: 113 107 114 108 {{{ 115 109 sliver_urn=$(ssh $foamserver foamctl geni:list-slivers --passwd-file=/etc/foam.passwd | egrep sliver_urn.+$slice_urn_egrep | sed -e 's/ *"sliver_urn": "\(.*\)".*/\1/') 110 fv_slicename=$(echo $sliver_urn | awk -F : '{print $NF}') 111 }}} 112 113 Confirm that the FOAM sliver's 'status' is now "approved", and confirm that the sliver shows up in !FlowVisor, and has two flowspace rules: 114 115 {{{ 116 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "approved"' || echo "ERROR: Wrong FOAM status" 117 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null || echo "ERROR: fvctl exited with non-zero status" 118 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "2" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 116 119 }}} 117 120 … … 124 127 (Within a minute (when the cron job fires), that should generate a message to www-data saying that the cron job ran, and one of two other things will happen: (a) If there are *other* pending slivers, it should generate a message to the FOAM admin listing only those slivers, and not your test sliver; OR (b) If there are no other pending slivers, it should not send any message to the FOAM admin about pending slivers.) 125 128 126 Disable the sliver (to put it back into the pending queue), confirm that 'status' is now "Pending", and confirm that the sliver now does not show up in FlowVisor, and has zero flowspace rules:129 Disable the sliver (to put it back into the pending queue), confirm that 'status' is now "Pending", and confirm that the sliver now does not show up in !FlowVisor, and has zero flowspace rules: 127 130 128 131 {{{ 129 132 ssh $foamserver foamctl geni:disable-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 130 foam-verify-sliver -q $foamserver $fvserver $sliver_urn status pending false 0 133 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "pending"' || echo "ERROR: Wrong FOAM status" 134 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null && echo "ERROR: fvctl exited with zero status" 135 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "0" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 131 136 }}} 132 137 … … 149 154 This next set of tests will generate a bunch of e-mail; check at the end that it all showed up as expected. 150 155 151 Approve the sliver, confirm that 'status' is now "Approved", and confirm that the sliver now shows up in FlowVisor, with two flowspace rules:156 Approve the sliver, confirm that 'status' is now "Approved", and confirm that the sliver now shows up in !FlowVisor, with two flowspace rules: 152 157 153 158 {{{ 154 159 ssh $foamserver foamctl geni:approve-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 155 foam-verify-sliver -q $foamserver $fvserver $sliver_urn status approved true 2 156 }}} 157 158 Reject the sliver, confirm that 'status' is now "Rejected", and confirm that the sliver now does not show up in FlowVisor, and has zero flowspace rules: 160 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "approved"' || echo "ERROR: Wrong FOAM status" 161 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null || echo "ERROR: fvctl exited with non-zero status" 162 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "2" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 163 }}} 164 165 Reject the sliver, confirm that 'status' is now "Rejected", and confirm that the sliver now does not show up in !FlowVisor, and has zero flowspace rules: 159 166 160 167 {{{ 161 168 ssh $foamserver foamctl geni:reject-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 162 foam-verify-sliver -q $foamserver $fvserver $sliver_urn status rejected false 0 163 }}} 164 165 Disable the sliver, confirm that 'status' is now "Pending", and confirm that the sliver now does not show up in FlowVisor, and has zero flowspace rules: 169 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "rejected"' || echo "ERROR: Wrong FOAM status" 170 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null && echo "ERROR: fvctl exited with zero status" 171 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "0" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 172 }}} 173 174 Disable the sliver, confirm that 'status' is now "Pending", and confirm that the sliver now does not show up in !FlowVisor, and has zero flowspace rules: 166 175 167 176 {{{ 168 177 ssh $foamserver foamctl geni:disable-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 169 foam-verify-sliver -q $foamserver $fvserver $sliver_urn status pending false 0 170 }}} 171 172 Reject the sliver, confirm that 'status' is now "Rejected", and confirm that the sliver now does not show up in FlowVisor, and has zero flowspace rules: 178 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "pending"' || echo "ERROR: Wrong FOAM status" 179 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null && echo "ERROR: fvctl exited with zero status" 180 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "0" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 181 }}} 182 183 Reject the sliver, confirm that 'status' is now "Rejected", and confirm that the sliver now does not show up in !FlowVisor, and has zero flowspace rules: 173 184 174 185 {{{ 175 186 ssh $foamserver foamctl geni:reject-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 176 foam-verify-sliver -q $foamserver $fvserver $sliver_urn status rejected false 0 177 }}} 178 179 Approve the sliver, confirm that 'status' is now "Approved", and confirm that the sliver now shows up in FlowVisor, with two flowspace rules: 187 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "rejected"' || echo "ERROR: Wrong FOAM status" 188 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null && echo "ERROR: fvctl exited with zero status" 189 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "0" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 190 }}} 191 192 Approve the sliver, confirm that 'status' is now "Approved", and confirm that the sliver now shows up in !FlowVisor, with two flowspace rules: 180 193 181 194 {{{ 182 195 ssh $foamserver foamctl geni:approve-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 183 foam-verify-sliver -q $foamserver $fvserver $sliver_urn status approved true 2 184 }}} 185 186 Delete the sliver, confirm that 'deleted' is now "True", and confirm that the sliver now does not show up in FlowVisor, and has zero flowspace rules: 196 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "approved"' || echo "ERROR: Wrong FOAM status" 197 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null || echo "ERROR: fvctl exited with non-zero status" 198 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "2" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 199 }}} 200 201 Delete the sliver, confirm that 'deleted' is now "true", and confirm that the sliver now does not show up in !FlowVisor, and has zero flowspace rules: 187 202 188 203 {{{ 189 204 ssh $foamserver foamctl geni:delete-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 190 foam-verify-sliver -q $foamserver $fvserver $sliver_urn deleted true false 0 205 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"deleted": "true"' || echo "ERROR: Wrong FOAM status" 206 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null && echo "ERROR: fvctl exited with zero status" 207 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "0" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 191 208 }}} 192 209 … … 199 216 In this subsection, we explicitly identify how many e-mail messages of each type we expect to receive after each run of the expiration scripts, since those notifications are what we're testing here, not just a side effect. The sliver-related ones from FOAM should be sent to the sliver owner and to the FOAM admin; the cron job confirmations should be sent to the user that the cron job runs as ('www-data' in these examples). 200 217 201 Create and verify the sliver: 202 203 {{{ 204 foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename $rspec approved true 2 218 Create the slice and sliver: 219 220 {{{ 221 omni createslice $slicename >& /dev/null 222 omni -a $am createsliver $slicename $rspec >& /dev/null 205 223 }}} 206 224 207 225 (That should generate a "sliver created" and a "sliver approved" e-mail message, one of each to the experimenter and one of each to the FOAM admin.) 208 226 209 Get the sliver URN from FOAM, and put it into $sliver_urn :227 Get the sliver URN from FOAM, and put it into $sliver_urn; and deduce the FV slicename from that: 210 228 211 229 {{{ 212 230 sliver_urn=$(ssh $foamserver foamctl geni:list-slivers --passwd-file=/etc/foam.passwd | egrep sliver_urn.+$slice_urn_egrep | sed -e 's/ *"sliver_urn": "\(.*\)".*/\1/') 231 fv_slicename=$(echo $sliver_urn | awk -F : '{print $NF}') 232 }}} 233 234 Confirm that the FOAM sliver's 'status' is now "approved", and confirm that the sliver shows up in !FlowVisor, and has two flowspace rules: 235 236 {{{ 237 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"status": "approved"' || echo "ERROR: Wrong FOAM status" 238 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null || echo "ERROR: fvctl exited with non-zero status" 239 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "2" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 213 240 }}} 214 241 … … 330 357 (Within a minute (when the cron job fires), expected e-mail: 0 "sliver expiring", 1 "sliver expired", and confirmation that the cron job ran.) 331 358 332 Confirm that the sliver was deleted, does not show up in FlowVisor, and has zero flowspace rules:: 333 334 {{{ 335 foam-verify-sliver -q $foamserver $fvserver $sliver_urn deleted true false 0 359 Confirm that the sliver was deleted, does not show up in !FlowVisor, and has zero flowspace rules:: 360 361 {{{ 362 ssh $foamserver foamctl geni:delete-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd 363 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/etc/foam.passwd | grep -q -i '"deleted": "true"' || echo "ERROR: Wrong FOAM status" 364 ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd getSliceInfo $fv_slicename >& /dev/null && echo "ERROR: fvctl exited with zero status" 365 [ $(ssh $fvserver fvctl --passwd-file=/etc/flowvisor.passwd listFlowSpace | grep $fv_slicename | wc -l) == "0" ] || echo "ERROR: Didn't get the expected number of FV flowspace rules" 336 366 }}} 337 367