Changes between Version 13 and Version 14 of OpenFlow/FOAM/Testing


Ignore:
Timestamp:
05/09/12 14:14:58 (7 years ago)
Author:
Josh Smift
Comment:

Added tests of approve-on-creation stuff

Legend:

Unmodified
Added
Removed
Modified
  • OpenFlow/FOAM/Testing

    v13 v14  
    33= Testing FOAM =
    44
    5 NOTE that all the foamctl commands on this page now use the new 0.7 syntax.
     5NOTE 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.
    66
    77This page describes a couple of ways to test FOAM:
     
    1111   * More complex tests for other sliver management operations.
    1212   * Tests for sliver expiration.
     13 * Testing auto-approval, in the various approve-on-creation modes.
    1314 * Testing that the software complies with the GENI AM API, using the test suite that comes with GCF.
    1415
     
    482483}}}
    483484
     485= Auto-approval =
     486
     487This section contains multiple tests, and includes a "General setup" subsection to set some variables, and then additional subsections to do various tests.
     488
     489Each of the subsections corresponds to one of the approve-on-creation modes; you should run the tests in the section that corresponds to the approve-on-creation mode of the FOAM server that you're testing. (The "General setup" subsection includes a step for determining this, each subsection includes a step to double-check it.)
     490
     491You only need to do the "General setup" subsection once.
     492
     493Pre-requisites/assumptions:
     494
     495 * 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).
     496 * You have a set of valid request rspec files to test with. We plan to make some sample rspecs available.
     497 * 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 (/opt/foam/etc/passwd and /etc/flowvisor/fvpasswd). (This generally can't be used as-is to test FOAM at other sites.)
     498 * 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.)
     499 * On the FOAM server you're testing, you have the foam-confirm-sliver, flowvisor-confirm-fvslice-exists, and flowvisor-confirm-flowspace-rule-count scripts.
     500 * On the system where you're running commands, you have the foam-create-and-verify-sliver script.
     501
     502Note that the scripts mentioned in the last two items are currently GPO-only. (GPO folks, they're in the syseng repo, under gposw.)
     503
     504You can run these tests wherever you usually use Omni; as written, they use SSH to run remote commands on the FOAM/FV server.
     505
     506== General setup ==
     507
     508Set the FOAM server name (modify this to use the DNS name of the server that you want to test):
     509
     510{{{
     511foamserver=foam.example.edu
     512}}}
     513
     514Set the name of the FlowVisor server to be the same (if it's the same, or something else if it isn't):
     515
     516{{{
     517fvserver=$foamserver
     518}}}
     519
     520Set the AM API URL:
     521
     522{{{
     523am=https://${foamserver}:3626/foam/gapi/1
     524}}}
     525
     526Identify the rspecs you plan to use (modify this if you want to use different rspecs), in several categories:
     527
     528 * Four that specify subnets: The first two don't overlap, the third overlaps with one of the first two, the fourth overlaps with all of the first three.
     529 * Four that specify MAC addresses: The first two don't overlap, the third overlaps with one of the first two, the fourth overlaps with all of the first three.
     530 * Four that specify ethertypes: The first two don't overlap, the third overlaps with one of the first two, the fourth overlaps with all of the first three.
     531 * One that specifies a subnet, a MAC address, and an ethertype, each of which overlaps with one of the rspecs in the corresponding one of the three groups above.
     532 * One that includes a more complex flowspace: A subnet that doesn't overlap with anything else, but also an entire VLAN (which should not be auto-approved).
     533 * One that includes two ports that are in a you-can-only-have-one-of-these port group. (FIXME: What does FOAM actually call this? And for that matter, how do you set it?)
     534
     535{{{
     536rspec_10_3_5_0_24=~/rspecs/request/misc/openflow-any-10-3-5-0-24.rspec
     537rspec_10_7_9_0_24=~/rspecs/request/misc/openflow-any-10-7-9-0-24.rspec
     538rspec_10_3_0_0_16=~/rspecs/request/misc/openflow-any-10-3-0-0-16.rspec
     539rspec_10_0_0_0_12=~/rspecs/request/misc/openflow-any-10-0-0-0-12.rspec
     540
     541rspec_cafebeefface=~/rspecs/request/misc/openflow-any-cafebeefface.rspec
     542rspec_deadbeadfeed=~/rspecs/request/misc/openflow-any-deadbeadfeed.rspec
     543rspec_aced_and_cafe=~/rspecs/request/misc/openflow-any-aced-and-cafe.rspec
     544rspec_aced_and_cafe_and_dead=~/rspecs/request/misc/openflow-any-aced-and-cafe-and-dead.rspec
     545
     546rspec_ethertype_3171=~/rspecs/request/misc/openflow-any-ethertype-3171.rspec
     547rspec_ethertype_3172=~/rspecs/request/misc/openflow-any-ethertype-3172.rspec
     548rspec_ethertype_3173_and_3171=~/rspecs/request/misc/openflow-any-ethertype-3173-and-3171.rspec
     549rspec_ethertype_3173_and_3172_and_3171=~/rspecs/request/misc/openflow-any-ethertype-3173-and-3172-and-3171.rspec
     550
     551rspec_one_of_each=~/rspecs/request/misc/openflow-any-one-each-subnet-mac-ethertype.rspec
     552
     553rspec_subnet_and_vlan=~/rspecs/request/misc/openflow-any-subnet-and-vlan.rspec
     554}}}
     555
     556Set four slicenames, using something with your username and "foamtest":
     557
     558{{{
     559slicename1=${USER}foamtest1
     560slicename2=${USER}foamtest2
     561slicename3=${USER}foamtest3
     562slicename4=${USER}foamtest4
     563}}}
     564
     565Make sure FOAM is listening at all:
     566
     567{{{
     568omni -a $am getversion
     569omni -a $am listresources
     570}}}
     571
     572Check which approve-on-creation mode FOAM is currently set to use:
     573
     574{{{
     575ssh $foamserver foamctl config:get-value --key="geni.approval.approve-on-creation" --passwd-file=/opt/foam/etc/foampasswd
     576}}}
     577
     578The possible values are 2 for "analysis", 1 for "always", and 0 for "never". (You can change this if you want to test a different value, but you may not want to do that, e.g. if it's a server that anyone else is using.)
     579
     580OPTIONALLY, turn off e-mail notification for creation, approval, and deletion:
     581
     582{{{
     583ssh $foamserver foamctl config:set-value --key="email.event.createsliver.admin" --value="false" --passwd-file=/opt/foam/etc/foampasswd
     584ssh $foamserver foamctl config:set-value --key="email.event.approvesliver.admin" --value="false" --passwd-file=/opt/foam/etc/foampasswd
     585ssh $foamserver foamctl config:set-value --key="email.event.gapi-deletesliver.admin" --value="false" --passwd-file=/opt/foam/etc/foampasswd
     586}}}
     587
     588If you do that, you may want to turn notification back on when you're done testing:
     589
     590{{{
     591ssh $foamserver foamctl config:set-value --key="email.event.createsliver.admin" --value="true" --passwd-file=/opt/foam/etc/foampasswd
     592ssh $foamserver foamctl config:set-value --key="email.event.approvesliver.admin" --value="true" --passwd-file=/opt/foam/etc/foampasswd
     593ssh $foamserver foamctl config:set-value --key="email.event.gapi-deletesliver.admin" --value="true" --passwd-file=/opt/foam/etc/foampasswd
     594}}}
     595
     596Now you're ready to run the tests in one or more of the following subections.
     597
     598== Approval mode 2 ("analysis") ==
     599
     600This subsection tests the behavior of FOAM when new slivers are created and geni.approval.approve-on-creation is set to 2 (analysis). The expected behavior is that slivers will be automatically approved if they pass all of the checks in the analysis engine, i.e. they don't overlap with any existing slivers; and don't contain any flowspace that can't be handled by the analysis engine.
     601
     602Double-check the FOAM server's current configuration:
     603
     604{{{
     605ssh $foamserver foamctl config:get-value --key="geni.approval.approve-on-creation" --passwd-file=/opt/foam/etc/foampasswd
     606}}}
     607
     608If the value isn't "2", then you shouldn't run this section on this FOAM server. (You can first change the configuration of this FOAM server, but you may not want to do that, e.g. if it's a server that anyone else is using.)
     609
     610You can go through all of these tests in sequence; they're further divided into sets of tests for convenience.
     611
     612=== Four slivers ===
     613
     614This set of tests uses four rspecs that specify a single feature (IP subnet, MAC address, or ethertype). In each set of four rspecs, the first two (A and B) don't overlap, the third (C) overlaps with one of the first two (A), and the fourth (D) overlaps with all of the first three.
     615
     616Each test (one per block below) creates the slivers in a different order, to confirm that the anlysis engine detects overlap regardless of whether a more specific or less specific sliver is created first. Each test deletes any lingering slivers before running, just to make sure the slate is clean. Each test should generate four "sliver created" e-mail messages, plus one "sliver approved" message per sliver that's expected to be automatically approved; and also four "sliver deleted" messages if any slivers were there to be deleted.
     617
     618These tests attempt to verify these principles:
     619
     620 * Whichever of A and C gets created first should be approved, and will then block the other.
     621 * B should always be approved as long as it's created before D, since it isn't blocked by either A or C.
     622 * D should only be approved if it's created first, because otherwise it's blocked by any of A, B, or C; and if it's created first, it blocks all of them.
     623 * If something would block other things if it was approved, it doesn't block those things if it's pending.
     624
     625There's a "Four-sliver setup" section to set the A/B/C/D variables, and then a tests section to run the tests. You can re-run the "Four-sliver setup" section, and then re-run the tests section, e.g. to test each of the three features.
     626
     627==== Four-sliver setup ====
     628
     629Do ONE of these, depending on whether you want to test IP, MAC, or ethertype, to define which rspecs to use, and how many FlowVisor flowspace rules to expect if that rspec is approved.
     630
     631IP:
     632
     633{{{
     634rspec_A=$rspec_10_3_5_0_24
     635rspec_B=$rspec_10_7_9_0_24
     636rspec_C=$rspec_10_3_0_0_16
     637rspec_D=$rspec_10_0_0_0_12
     638
     639rules_A=2
     640rules_B=2
     641rules_C=2
     642rules_D=2
     643}}}
     644
     645MAC:
     646
     647{{{
     648rspec_A=$rspec_cafebeefface
     649rspec_B=$rspec_deadbeadfeed
     650rspec_C=$rspec_aced_and_cafe
     651rspec_D=$rspec_aced_and_cafe_and_dead
     652
     653rules_A=2
     654rules_B=2
     655rules_C=4
     656rules_D=6
     657}}}
     658
     659Ethertype:
     660
     661{{{
     662rspec_A=$rspec_ethertype_3171
     663rspec_B=$rspec_ethertype_3172
     664rspec_C=$rspec_ethertype_3173_and_3171
     665rspec_D=$rspec_ethertype_3173_and_3172_and_3171
     666
     667rules_A=1
     668rules_B=1
     669rules_C=2
     670rules_D=3
     671}}}
     672
     673Now you're ready to run the four-sliver tests.
     674
     675==== Four-sliver tests ====
     676
     677ABCD - A and B should be approved, C and D should be pending:
     678
     679{{{
     680for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     681foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_A approved true $rules_A
     682foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_B approved true $rules_B
     683foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_C pending false 0
     684foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_D pending false 0
     685}}}
     686
     687ACBD - A should be approved, C pending, B approved, and D pending:
     688
     689{{{
     690for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     691foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_A approved true $rules_A
     692foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_C pending false 0
     693foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_B approved true $rules_B
     694foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_D pending false 0
     695}}}
     696
     697BACD - B and A should be approved, C and D pending should be pending:
     698
     699{{{
     700for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     701foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_B approved true $rules_B
     702foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_A approved true $rules_A
     703foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_C pending false 0
     704foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_D pending false 0
     705}}}
     706
     707BCAD - B and C should be approved, A and D should be pending:
     708
     709{{{
     710for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     711foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_B approved true $rules_B
     712foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_C approved true $rules_C
     713foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_A pending false 0
     714foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_D pending false 0
     715}}}
     716
     717CABD - C should be approved, A pending, B approved, and D pending:
     718
     719{{{
     720for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     721foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_C approved true $rules_C
     722foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_A pending false 0
     723foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_B approved true $rules_B
     724foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_D pending false 0
     725}}}
     726
     727CBAD - C and B should be approved, A and D should be pending:
     728
     729{{{
     730for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     731foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_C approved true $rules_C
     732foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_B approved true $rules_B
     733foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_A pending false 0
     734foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_D pending false 0
     735}}}
     736
     737DABC - D should be approved, A and B and C should be pending:
     738
     739{{{
     740for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     741foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_D approved true $rules_D
     742foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_A pending false 0
     743foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_B pending false 0
     744foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_C pending false 0
     745}}}
     746
     747ADBC - A should be approved, D pending, B approved, and C pending:
     748
     749{{{
     750for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     751foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_A approved true $rules_A
     752foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_D pending false 0
     753foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_B approved true $rules_B
     754foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_C pending false 0
     755}}}
     756
     757ADCB - A should be approved, D pending, C pending, and B approved:
     758
     759{{{
     760for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     761foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_A approved true $rules_A
     762foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_D pending false 0
     763foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_C pending false 0
     764foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_B approved true $rules_B
     765}}}
     766
     767Delete any remaining slivers:
     768
     769{{{
     770for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     771}}}
     772
     773=== Three-feature slivers ===
     774
     775This set of tests uses an rspec that reserves all three features (an IP subnet, a MAC address, and an Ethertype), and tests situations where the three-way rspec does and doesn't overlap with other rspecs that only reserve one of those three things.
     776
     777Each test (one per block below) creates the slivers in a different order, to confirm that the anlysis engine detects overlap regardless of whether a more specific or less specific sliver is created first. Each test deletes any lingering slivers before running, just to make sure the slate is clean. Each test should generate four "sliver created" e-mail messages, plus one "sliver approved" message per sliver that's expected to be automatically approved; and also four "sliver deleted" messages if any slivers were there to be deleted.
     778
     779These tests attempt to verify these principles:
     780
     781 * If the three-way sliver doesn't overlap with any of the one-way slivers, they all get approved.
     782 * If the three-way sliver overlaps with the others:
     783   * It should be approved if it's created first, and the others should be pending.
     784   * It should be pending if it's created last, and the others should be approved.
     785   * If any one-way sliver is created first, and the three-way sliver is created second, the three-way sliver should be pending, and the others should all be approved.
     786
     787This set of tests doesn't need any additional setup.
     788
     789No overlap, three-way first:
     790
     791{{{
     792for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     793foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each approved true 5
     794foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 approved true 2
     795foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed approved true 2
     796foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3172 approved true 1
     797}}}
     798
     799No overlap, three-way last:
     800
     801{{{
     802for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     803foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each approved true 5
     804foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 approved true 2
     805foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed approved true 2
     806foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3172 approved true 1
     807}}}
     808
     809Overlap, three-way first:
     810
     811{{{
     812for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     813foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each approved true 5
     814foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_3_5_0_24 pending false 0
     815foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_cafebeefface pending false 0
     816foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3171 pending false 0
     817}}}
     818
     819Overlap three-way last:
     820
     821{{{
     822for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     823foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_3_5_0_24 approved true 2
     824foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_cafebeefface approved true 2
     825foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3171 approved true 1
     826foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_one_of_each pending false 0
     827}}}
     828
     829Overlap, three-way second, IP first:
     830
     831{{{
     832for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     833foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_3_5_0_24 approved true 2
     834foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_one_of_each pending false 0
     835foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_cafebeefface approved true 2
     836foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3171 approved true 1
     837}}}
     838
     839Overlap, three-way second, MAC first:
     840
     841{{{
     842for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     843foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_cafebeefface approved true 2
     844foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_one_of_each pending false 0
     845foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_10_3_5_0_24 approved true 2
     846foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3171 approved true 1
     847}}}
     848
     849Overlap, three-way second, ethertype first:
     850
     851{{{
     852for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     853foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_ethertype_3171 approved true 1
     854foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_one_of_each pending false 0
     855foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_10_3_5_0_24 approved true 2
     856foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_cafebeefface approved true 2
     857}}}
     858
     859Delete any remaining slivers:
     860
     861{{{
     862for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     863}}}
     864
     865=== Forbidden slivers ===
     866
     867This set of tests uses rspecs containing things that should never be auto-approved. (Currently, only one of them, an rspec containing an entire VLAN.)
     868
     869Create and verify the sliver:
     870
     871{{{
     872foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_subnet_and_vlan pending false 0
     873}}}
     874
     875(That should generate one "sliver created" and no "sliver approved" e-mail messages, one set to the experimenter and one set to the FOAM admin.)
     876
     877Delete the sliver:
     878
     879{{{
     880for slicename in $slicename1 ; do omni -a $am deletesliver $slicename ; done
     881}}}
     882
     883== Approval mode 1 ("always") ==
     884
     885This subsection tests the behavior of FOAM when new slivers are created and geni.approval.approve-on-creation is set to 1 (always). The expected behavior is that all slivers will automatically be approved after they're created.
     886
     887Double-check the FOAM server's current configuration:
     888
     889{{{
     890ssh $foamserver foamctl config:get-value --key="geni.approval.approve-on-creation" --passwd-file=/opt/foam/etc/foampasswd
     891}}}
     892
     893If the value isn't "1", then you shouldn't run this section on this FOAM server. (You can first change the configuration of this FOAM server, but you may not want to do that, e.g. if it's a server that anyone else is using.)
     894
     895You can go through all of these tests in sequence; they're divided into blocks of four because we only try creating four slivers at a time.
     896
     897IP subnets, smaller subnets first:
     898
     899{{{
     900for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     901foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_3_5_0_24 approved true 2
     902foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 approved true 2
     903foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_10_3_0_0_16 approved true 2
     904foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_10_0_0_0_12 approved true 2
     905}}}
     906
     907IP subnets, larger subnets first:
     908
     909{{{
     910for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     911foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_0_0_0_12 approved true 2
     912foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_3_5_0_24 approved true 2
     913foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_10_7_9_0_24 approved true 2
     914foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_10_3_0_0_16 approved true 2
     915}}}
     916
     917MAC addresses, single addresses first:
     918
     919{{{
     920for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     921foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_cafebeefface approved true 2
     922foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_deadbeadfeed approved true 2
     923foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_aced_and_cafe approved true 4
     924foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_aced_and_cafe_and_dead approved true 6
     925}}}
     926
     927MAC addresses, multiple addresses first:
     928
     929{{{
     930for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     931foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_aced_and_cafe_and_dead approved true 6
     932foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_cafebeefface approved true 2
     933foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed approved true 2
     934foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_aced_and_cafe approved true 4
     935}}}
     936
     937Ethertypes, single ethertypes first:
     938
     939{{{
     940for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     941foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_ethertype_3171 approved true 1
     942foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_ethertype_3172 approved true 1
     943foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3173_and_3171 approved true 2
     944foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3173_and_3172_and_3171 approved true 3
     945}}}
     946
     947Ethertypes, single ethertypes last:
     948
     949{{{
     950for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     951foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_ethertype_3173_and_3172_and_3171 approved true 3
     952foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_ethertype_3171 approved true 1
     953foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3172 approved true 1
     954foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3173_and_3171 approved true 2
     955}}}
     956
     957Three-feature slivers with no overlap, three-way first:
     958
     959{{{
     960for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     961foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each approved true 5
     962foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 approved true 2
     963foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed approved true 2
     964foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3172 approved true 1
     965}}}
     966
     967Three-feature slivers with no overlap, three-way last:
     968
     969{{{
     970for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     971foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each approved true 5
     972foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 approved true 2
     973foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed approved true 2
     974foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3172 approved true 1
     975}}}
     976
     977Three-feature slivers with overlap, three-way first:
     978
     979{{{
     980for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     981foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each approved true 5
     982foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_3_5_0_24 approved true 2
     983foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_cafebeefface approved true 2
     984foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3171 approved true 1
     985}}}
     986
     987Three-feature slivers with overlap, three-way last:
     988
     989{{{
     990for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     991foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_3_5_0_24 approved true 2
     992foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_cafebeefface approved true 2
     993foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3171 approved true 1
     994foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_one_of_each approved true 5
     995}}}
     996
     997Forbidden slivers:
     998
     999{{{
     1000for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1001foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_subnet_and_vlan approved true 3
     1002}}}
     1003
     1004Delete any remaining slivers:
     1005
     1006{{{
     1007for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1008}}}
     1009
     1010== Approval mode 0 ("never") ==
     1011
     1012This subsection tests the behavior of FOAM when new slivers are created and geni.approval.approve-on-creation is set to 0 (never). The expected behavior is that all slivers will automatically be pending after they're created.
     1013
     1014Double-check the FOAM server's current configuration:
     1015
     1016{{{
     1017ssh $foamserver foamctl config:get-value --key="geni.approval.approve-on-creation" --passwd-file=/opt/foam/etc/foampasswd
     1018}}}
     1019
     1020If the value isn't "0", then you shouldn't run this section on this FOAM server. (You can first change the configuration of this FOAM server, but you may not want to do that, e.g. if it's a server that anyone else is using.)
     1021
     1022You can go through all of these tests in sequence; they're divided into blocks of four because we only try creating four slivers at a time.
     1023
     1024IP subnets, smaller subnets first:
     1025
     1026{{{
     1027for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1028foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_3_5_0_24 pending false 0
     1029foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 pending false 0
     1030foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_10_3_0_0_16 pending false 0
     1031foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_10_0_0_0_12 pending false 0
     1032}}}
     1033
     1034IP subnets, larger subnets first:
     1035
     1036{{{
     1037for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1038foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_0_0_0_12 pending false 0
     1039foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_3_5_0_24 pending false 0
     1040foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_10_7_9_0_24 pending false 0
     1041foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_10_3_0_0_16 pending false 0
     1042}}}
     1043
     1044MAC addresses, single addresses first:
     1045
     1046{{{
     1047for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1048foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_cafebeefface pending false 0
     1049foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_deadbeadfeed pending false 0
     1050foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_aced_and_cafe pending false 0
     1051foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_aced_and_cafe_and_dead pending false 0
     1052}}}
     1053
     1054MAC addresses, multiple addresses first:
     1055
     1056{{{
     1057for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1058foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_aced_and_cafe_and_dead pending false 0
     1059foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_cafebeefface pending false 0
     1060foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed pending false 0
     1061foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_aced_and_cafe pending false 0
     1062}}}
     1063
     1064Ethertypes, single ethertypes first:
     1065
     1066{{{
     1067for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1068foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_ethertype_3171 pending false 0
     1069foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_ethertype_3172 pending false 0
     1070foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3173_and_3171 pending false 0
     1071foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3173_and_3172_and_3171 pending false 0
     1072}}}
     1073
     1074Ethertypes, single ethertypes last:
     1075
     1076{{{
     1077for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1078foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_ethertype_3173_and_3172_and_3171 pending false 0
     1079foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_ethertype_3171 pending false 0
     1080foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3172 pending false 0
     1081foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3173_and_3171 pending false 0
     1082}}}
     1083
     1084Three-feature slivers with no overlap, three-way first:
     1085
     1086{{{
     1087for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1088foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each pending false 0
     1089foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 pending false 0
     1090foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed pending false 0
     1091foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3172 pending false 0
     1092}}}
     1093
     1094Three-feature slivers with no overlap, three-way last:
     1095
     1096{{{
     1097for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1098foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each pending false 0
     1099foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_7_9_0_24 pending false 0
     1100foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_deadbeadfeed pending false 0
     1101foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3172 pending false 0
     1102}}}
     1103
     1104Three-feature slivers with overlap, three-way first:
     1105
     1106{{{
     1107for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1108foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_one_of_each pending false 0
     1109foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_10_3_5_0_24 pending false 0
     1110foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_cafebeefface pending false 0
     1111foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_ethertype_3171 pending false 0
     1112}}}
     1113
     1114Three-feature slivers with overlap, three-way last:
     1115
     1116{{{
     1117for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1118foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_10_3_5_0_24 pending false 0
     1119foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename2 $rspec_cafebeefface pending false 0
     1120foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename3 $rspec_ethertype_3171 pending false 0
     1121foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename4 $rspec_one_of_each pending false 0
     1122}}}
     1123
     1124Forbidden slivers:
     1125
     1126{{{
     1127for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1128foam-create-and-verify-sliver -q $foamserver $fvserver $am $slicename1 $rspec_subnet_and_vlan pending false 0
     1129}}}
     1130
     1131Delete any remaining slivers:
     1132
     1133{{{
     1134for slicename in $slicename1 $slicename2 $slicename3 $slicename4 ; do omni -a $am deletesliver $slicename ; done
     1135}}}
     1136
    4841137= GENI AM API =
    4851138