Changes between Version 30 and Version 31 of OpenFlow/FOAM/Testing
- Timestamp:
- 06/29/12 11:40:34 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OpenFlow/FOAM/Testing
v30 v31 5 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 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 7 9 This page describes a couple of ways to test FOAM: 8 10 9 * Testing that slivers can be created, and then managed in various ways, including: 10 * Simple tests that slivers appear and disappear in FlowVisor. 11 * More complex tests for other sliver management operations. 11 * Testing sliver administration, including: 12 * Test for various sliver management operations. 12 13 * Tests for sliver expiration. 13 * Testing auto-approval, in the variousapprove-on-creation modes.14 * Testing auto-approval, in each of the three approve-on-creation modes. 14 15 * Testing that the software complies with the GENI AM API, using the test suite that comes with GCF. 15 16 16 = Sliver creation and management = 17 18 This section contains multiple tests, and includes a Setup subsection to set some variables, a Creation subsection to create a sliver, and then additional subsections to do various tests with it. 19 20 You only need to do the Setup subsection once. 21 22 You need to repeat the Creation subsection before doing any of the other subsections, because the Creation subsection sets some variables that you'll need for the other subsections, and each of the other subsections concludes by deleting the sliver. 17 = Sliver administration = 18 19 This section contains multiple tests, and includes a "General setup" subsection to set some variables, and then additional subsections to do various tests. 20 21 You only need to do the "General setup" subsection once. 23 22 24 23 Pre-requisites/assumptions: … … 32 31 * 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. 33 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.) 34 36 35 37 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. 36 38 37 == Setup ==39 == General setup == 38 40 39 41 Set the FOAM server name (modify this to use the DNS name of the server that you want to test): … … 81 83 }}} 82 84 83 Now you're ready to create a sliver. 84 85 Here's all of those commands in one block for easy of copy-and-paste: 85 Here's all of those commands in one block for ease of copy-and-paste: 86 86 87 87 {{{ … … 98 98 }}} 99 99 100 == Creation == 101 102 Create a slice: 103 104 {{{ 105 omni createslice $slicename 106 }}} 107 108 Create a sliver: 109 110 {{{ 111 omni -a $am createsliver $slicename $rspec 100 == Management == 101 102 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 104 Create and verify the sliver: 105 106 {{{ 107 foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename $rspec approved true 2 112 108 }}} 113 109 114 110 (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.) 115 116 Confirm that it looks right via Omni:117 118 {{{119 omni -a $am listresources $slicename120 omni -a $am sliverstatus $slicename121 }}}122 123 Confirm that it shows up in FOAM:124 125 {{{126 ssh $foamserver foamctl geni:list-slivers --passwd-file=/opt/foam/etc/foampasswd | egrep slice_urn.+$slice_urn_egrep127 }}}128 111 129 112 Get the sliver URN and FlowVisor slicename from FOAM, and put them into $sliver_urn and $fv_slicename: … … 134 117 }}} 135 118 136 Now you're ready to do additional tests with this sliver.137 138 == Simple management ==139 140 NOTE: Do the [wiki:OpenFlow/FOAM/Testing#Creation Creation] subsection immediately before starting this subsection.141 142 NOTE: This subsection needs to be revamped to match the new assumption that when you create a sliver, it will be automatically approved.143 144 The steps in this subsection look at a newly-created sliver, approve it, confirm that it shows up in the FlowVisor, delete it, and confirm that it vanishes from the FlowVisor.145 146 Show the sliver, and confirm that 'status' is "Pending":147 148 {{{149 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd150 }}}151 152 Confirm that the sliver doesn't yet show up in FlowVisor:153 154 {{{155 ssh $fvserver fvctl --passwd-file=/etc/flowvisor/fvpasswd getSliceInfo $fv_slicename156 }}}157 158 (Expect a "slice does not exist" error.)159 160 Show the sliver's rspec:161 162 {{{163 ssh $foamserver foamctl geni:show-sliver -r -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd164 }}}165 166 Show the sliver's flowspec:167 168 {{{169 ssh $foamserver foamctl geni:show-sliver -s -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd170 }}}171 172 Show the sliver's flowspace rules:173 174 {{{175 ssh $foamserver foamctl geni:show-sliver -f -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd176 }}}177 178 Approve the sliver, and confirm that 'status' is now "Approved":179 180 {{{181 ssh $foamserver foamctl geni:approve-sliver -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd182 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd183 }}}184 185 (That should generate a "sliver approved" e-mail message, one to the experimenter and one to the FOAM admin.)186 187 Confirm that the sliver now shows up in FlowVisor, with two flowspace rules:188 189 {{{190 ssh $fvserver fvctl --passwd-file=/etc/flowvisor/fvpasswd getSliceInfo $fv_slicename191 ssh $fvserver fvctl --passwd-file=/etc/flowvisor/fvpasswd listFlowSpace | grep $fv_slicename192 }}}193 194 (Don't worry about the ouptut saying that it can't connect to the controller; this is expected if your rspec didn't include a controller that's actually running, which the example one doesn't.)195 196 Delete the sliver:197 198 {{{199 omni -a $am deletesliver $slicename200 }}}201 202 (That should generate a "sliver deleted" e-mail message, one to the experimenter and one to the FOAM admin.)203 204 Confirm that Omni thinks it's gone:205 206 {{{207 omni -a $am listresources $slicename208 omni -a $am sliverstatus $slicename209 }}}210 211 (Expect an "unknown slice" error for each of those.)212 213 Confirm that the sliver no longer shows up in FOAM:214 215 {{{216 ssh $foamserver foamctl geni:show-sliver -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd217 ssh $foamserver foamctl geni:list-slivers --passwd-file=/opt/foam/etc/foampasswd | grep $slice_urn218 }}}219 220 (Expect 'deleted' to be "True" for the first, and no output for the second. For the first, note that 'status' will still be "Approved", which is fine, it's just tracking what the status was when it was deleted.)221 222 Confirm that the sliver no longer shows up in FlowVisor:223 224 {{{225 ssh $fvserver fvctl --passwd-file=/etc/flowvisor/fvpasswd getSliceInfo $fv_slicename226 ssh $fvserver fvctl --passwd-file=/etc/flowvisor/fvpasswd listFlowSpace | grep $fv_slicename227 }}}228 229 (Expect a "slice does not exist" error for the first, and no output for the second.)230 231 == Complex management ==232 233 NOTE: Do the [wiki:OpenFlow/FOAM/Testing#Creation Creation] subsection immediately before starting this subsection.234 235 The steps in this subsection look at a newly-created sliver, run through a sequence of approve/disable/reject actions to confirm that it can transition from any of those states to the others, and check the FlowVisor after each change; then delete the sliver, and confirm that it vanishes from the FlowVisor.236 237 Confirm that the sliver was approved at creation time: Check that 'status' is "Approved", and that the sliver shows up in FlowVisor, with two flowspace rules:238 239 {{{240 ssh $foamserver foam-confirm-sliver $sliver_urn status approved241 ssh $fvserver flowvisor-confirm-fvslice-exists $fv_slicename true242 ssh $fvserver flowvisor-confirm-flowspace-rule-count $fv_slicename 2243 }}}244 245 119 Add a temporary cron job to tell FOAM to generate e-mail with a list of pending slivers: 246 120 … … 249 123 }}} 250 124 251 (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 about pending slivers to the FOAM admin.)252 253 Disable the sliver , to put it back into the pending queue:125 (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.) 126 127 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: 254 128 255 129 {{{ 256 130 ssh $foamserver foamctl geni:disable-sliver -u $sliver_urn --passwd-file=/opt/foam/etc/foampasswd 257 }}}258 259 (That should generate a "sliver disabled" e-mail message, one to the experimenter and one to the FOAM admin.)260 261 Confirm that 'status' is now "Pending", and that the sliver now does not show up in FlowVisor, and has no flowspace rules:262 263 {{{264 131 ssh $foamserver foam-confirm-sliver $sliver_urn status pending 265 132 ssh $fvserver flowvisor-confirm-fvslice-exists $fv_slicename false 266 133 ssh $fvserver flowvisor-confirm-flowspace-rule-count $fv_slicename 0 267 134 }}} 135 136 (That should generate a "sliver disabled" e-mail message, one to the experimenter and one to the FOAM admin.) 268 137 269 138 Add a temporary cron job to tell FOAM to generate e-mail with a list of pending slivers: … … 292 161 }}} 293 162 294 Reject the sliver, confirm that 'status' is now "Rejected", and confirm that the sliver now does not show up in FlowVisor, and has no flowspace rules:163 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: 295 164 296 165 {{{ … … 301 170 }}} 302 171 303 Disable the sliver, confirm that 'status' is now "Pending", and confirm that the sliver now does not show up in FlowVisor, and has no flowspace rules:172 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: 304 173 305 174 {{{ … … 310 179 }}} 311 180 312 Reject the sliver, confirm that 'status' is now "Rejected", and confirm that the sliver now does not show up in FlowVisor, and has no flowspace rules:181 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: 313 182 314 183 {{{ … … 328 197 }}} 329 198 330 Delete the sliver, confirm that 'deleted' is now "True", and confirm that the sliver now does not show up in FlowVisor, and has no flowspace rules:199 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: 331 200 332 201 {{{ … … 337 206 }}} 338 207 339 That set of tests should generate six e-mail messages to the experimenter and six to the FOAM admin: There should be a "sliver approved" message, then "sliver rejected", then "sliver disabled", then rejected, approved, and deleted. Probably in that order, although e-mail is sometimes delivered out of sequence, so don't worry too much if they're not in order.208 That set of tests should generate six e-mail messages to the experimenter and six to the FOAM admin: There should be a "sliver approved" message, then "sliver rejected", then "sliver disabled", then "rejected", then "approved", and then "deleted". Probably in that order, although e-mail is sometimes delivered out of sequence, so don't worry too much if they're not in order. 340 209 341 210 == Expiration == 342 211 343 NOTE: Do the [wiki:OpenFlow/FOAM/Testing#Creation Creation] subsection immediately before starting this subsection. 344 345 The steps in this subsection look at a newly-created sliver, and test expiration in FOAM, by changing its expiration date and, then running the scripts that expire slivers and notify about soon-to-expire ones. 346 347 Confirm that the sliver was approved at creation time: Check that 'status' is "Approved", and that the sliver shows up in FlowVisor, with two flowspace rules: 348 349 {{{ 350 ssh $foamserver foam-confirm-sliver $sliver_urn status approved 351 ssh $fvserver flowvisor-confirm-fvslice-exists $fv_slicename true 352 ssh $fvserver flowvisor-confirm-flowspace-rule-count $fv_slicename 2 353 }}} 354 355 Now, do some tests to make sure FOAM notifies you about a sliver that will expire within a day, but only once. 212 This subsection runs creates a sliver, and tests the sliver expiration process in FOAM, by changing the sliver's expiration date, and then running the scripts that expire slivers and notify about soon-to-expire ones, for a variety of expiration dates. 213 214 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). 215 216 Create and verify the sliver: 217 218 {{{ 219 foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename $rspec approved true 2 220 }}} 221 222 (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.) 223 224 Get the sliver URN and FlowVisor slicename from FOAM, and put them into $sliver_urn and $fv_slicename: 225 226 {{{ 227 sliver_urn=$(ssh $foamserver foamctl geni:list-slivers --passwd-file=/opt/foam/etc/foampasswd | egrep sliver_urn.+$slice_urn_egrep | sed -e 's/ *"sliver_urn": "\(.*\)".*/\1/') 228 fv_slicename=$(echo $sliver_urn | awk -F : '{print $NF}') 229 }}} 230 231 First, test that FOAM notifies you about a sliver that will expire within a day, but only once. 356 232 357 233 Change the expiration date of your slice to be nine days away, since otherwise you can't extend the sliver expiration date very far: … … 364 240 365 241 {{{ 366 omni -a $am renewsliver $slicename "$(date -d 'now + 12 hours')" 367 omni -a $am sliverstatus $slicename 242 omni -a $am renewsliver $slicename "$(date -d 'now + 12 hours')" > /dev/null 2>&1 243 omni -a $am sliverstatus $slicename 2>&1 | grep foam_expires 368 244 }}} 369 245 370 246 (That should generate a "sliver renewed" e-mail message, one to the experimenter and one to the FOAM admin.) 371 247 372 Add a temporary cron job to tell FOAM to send mail about slivers that are expiring soonand remove any expired slivers:248 Add a temporary cron job to tell FOAM to send mail about slivers that are expiring in the near future, and remove any expired slivers: 373 249 374 250 {{{ … … 376 252 }}} 377 253 378 (Within a minute (when the cron job fires), that should generate a "sliver expiring shortly" e-mail message, one to the experimenter and one to the FOAM admin; no messages about expired slivers being deleted; and one message to www-data sayingthat the cron job ran.)254 (Within a minute (when the cron job fires), expected e-mail: 1 "sliver expiring shortly", 0 "sliver expired", and confirmation that the cron job ran.) 379 255 380 256 Add the cron job again, to confirm that it doesn't send a second notification: … … 384 260 }}} 385 261 386 (Within a minute (when the cron job fires), that should generate no messages about slivers expiring in the future; no messages about expired slivers being deleted; and one message to www-data sayingthat the cron job ran.)262 (Within a minute (when the cron job fires), expected e-mail: 0 "sliver expiring", 0 "sliver expired", only confirmation that the cron job ran.) 387 263 388 264 Next, test to make sure FOAM notifies you again if you change the expiration date. … … 391 267 392 268 {{{ 393 omni -a $am renewsliver $slicename "$(date -d 'now + 1 day')" 394 omni -a $am sliverstatus $slicename 269 omni -a $am renewsliver $slicename "$(date -d 'now + 1 day')" > /dev/null 2>&1 270 omni -a $am sliverstatus $slicename 2>&1 | grep foam_expires 395 271 }}} 396 272 … … 403 279 }}} 404 280 405 (Within a minute (when the cron job fires), that should generate a "sliver expiring shortly" e-mail message, one to the experimenter and one to the FOAM admin; no messages about expired slivers being deleted; and one message to www-data sayingthat the cron job ran.)281 (Within a minute (when the cron job fires), expected e-mail: 1 "sliver expiring shortly", 0 "sliver expired", and confirmation that the cron job ran.) 406 282 407 283 Next, do some tests to make sure that FOAM notifies you about a sliver that will expire within a week, but only once. … … 410 286 411 287 {{{ 412 omni -a $am renewsliver $slicename "$(date -d 'now + 2 days')" 413 omni -a $am sliverstatus $slicename 288 omni -a $am renewsliver $slicename "$(date -d 'now + 2 days')" > /dev/null 2>&1 289 omni -a $am sliverstatus $slicename 2>&1 | grep foam_expires 414 290 }}} 415 291 … … 422 298 }}} 423 299 424 (Within a minute (when the cron job fires), that should generate a "sliver expiring in about a week" e-mail message, one to the experimenter and one to the FOAM admin; no messages about expired slivers being deleted; and one message to www-data sayingthat the cron job ran.)300 (Within a minute (when the cron job fires), expected e-mail: 1 "sliver expiring within a week", 0 "sliver expired", and confirmation that the cron job ran.) 425 301 426 302 Add the cron job again, to confirm that it doesn't send a second notification: … … 430 306 }}} 431 307 432 (Within a minute (when the cron job fires), that should generate no messages about slivers expiring in the future; no messages about expired slivers being deleted; and one message to www-data sayingthat the cron job ran.)308 (Within a minute (when the cron job fires), expected e-mail: 0 "sliver expiring", 0 "sliver expired", only confirmation that the cron job ran.) 433 309 434 310 Next, test to make sure FOAM doesn't notify you at all if your sliver is expiring more than a week from now. … … 437 313 438 314 {{{ 439 omni -a $am renewsliver $slicename "$(date -d 'now + 8 days')" 440 omni -a $am sliverstatus $slicename 315 omni -a $am renewsliver $slicename "$(date -d 'now + 8 days')" > /dev/null 2>&1 316 omni -a $am sliverstatus $slicename 2>&1 | grep foam_expires 441 317 }}} 442 318 … … 449 325 }}} 450 326 451 (Within a minute (when the cron job fires), that should generate no messages about slivers expiring in the future; no messages about expired slivers being deleted; and one message to www-data sayingthat the cron job ran.)327 (Within a minute (when the cron job fires), expected e-mail: 0 "sliver expiring", 0 "sliver expired", only confirmation that the cron job ran.) 452 328 453 329 Finally, test to make sure FOAM deletes a sliver if its expiration date is in the past. … … 456 332 457 333 {{{ 458 omni -a $am renewsliver $slicename "$(date -d 'now')" 459 omni -a $am sliverstatus $slicename 334 omni -a $am renewsliver $slicename "$(date -d 'now')" > /dev/null 2>&1 335 omni -a $am sliverstatus $slicename 2>&1 | grep foam_expires 460 336 }}} 461 337 … … 468 344 }}} 469 345 470 (Within a minute (when the cron job fires), that should generate no messages about slivers expiring in the future; a "sliver expired" message, one to the experimenter and one to the FOAM admin; and one message to www-data sayingthat the cron job ran.)471 472 Confirm that the sliver was deleted, does not show up in FlowVisor, and has no flowspace rules::346 (Within a minute (when the cron job fires), expected e-mail: 0 "sliver expiring", 1 "sliver expired", and confirmation that the cron job ran.) 347 348 Confirm that the sliver was deleted, does not show up in FlowVisor, and has zero flowspace rules:: 473 349 474 350 {{{ … … 501 377 * On the system where you're running commands, you have the foam-create-and-verify-sliver script. 502 378 503 Note that the scripts mentioned in the last two items are currently GPO-only. (GPO folks, they're in the syseng repo, under gposw.) 379 Note that the scripts mentioned in the last two items are currently GPO-only. (GPO folks, they're in the syseng repo, under gposw.) We're working on making them public. 504 380 505 381 You can run these tests wherever you usually use Omni; as written, they use SSH to run remote commands on the FOAM/FV server. … … 878 754 NOTE that this assumes that you have datapaths and port groups defined in your FOAM server, which correspond to the datapaths and port groups in the rspec. FIXME: Need to document how to do this with fake datapaths. 879 755 756 This set of tests doesn't need any additional setup. 757 880 758 One port in a port group, and one that isn't - should be approved: 881 759 … … 916 794 917 795 This set of tests uses rspecs containing things that should never be auto-approved. (Currently, only one of them, an rspec containing an entire VLAN.) 796 797 This set of tests doesn't need any additional setup. 918 798 919 799 Create and verify the sliver: