wiki:PGConfCall_20120111

Version 1 (modified by sedwards@bbn.com, 7 years ago) (diff)

--

Omni 1.5.1/1.5.2

Support for AM API v2 and GENI v3 RSpecs

The following should work with either gcf-1.5.1 or gcf-1.5.2 (to be released inside the next week).

getversion at ProtoGENI

Run getversion against the default ProtoGENI Aggregate Manager (AM):

$ ~/gcf/src/omni.py -a https://www.emulab.net:12369/protogeni/xmlrpc/am getversion
INFO:omni:Loading config file omni_config
INFO:omni:Using control framework pg-gpo 
INFO:omni:AM URN: unspecified_AM_URN (url: https://www.emulab.net:12369/protogeni/xmlrpc/am) has version:                                                                       
INFO:omni:{   'ad_rspec_versions': [   {   'extensions': [],                            
                                 'namespace': 'http://www.protogeni.net/resources/rspec/0.1',                                                                                   
                                 'schema': 'http://www.protogeni.net/resources/rspec/0.1/ad.xsd',                                                                               
                                 'type': 'ProtoGENI',                                   
                                 'version': '0.1'},                                     
                             {   'extensions': [],                                      
                                 'namespace': 'http://www.protogeni.net/resources/rspec/0.2',                                                                                   
                                 'schema': 'http://www.protogeni.net/resources/rspec/0.2/ad.xsd',                                                                               
                                 'type': 'ProtoGENI',                                   
                                 'version': '0.2'},                                     
                             {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],                                                                    
                                 'namespace': 'http://www.protogeni.net/resources/rspec/2',                                                                                     
                                 'schema': 'http://www.protogeni.net/resources/rspec/2/ad.xsd',                                                                                 
                                 'type': 'ProtoGENI',                                   
                                 'version': '2'},                                       
                             {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],                                                                    
                                 'namespace': 'http://www.geni.net/resources/rspec/3',  
                                 'schema': 'http://www.geni.net/resources/rspec/3/ad.xsd',                                                                                      
                                 'type': 'GENI',                                        
                                 'version': '3'}],                                      
    'code_tag': '2adb42b80c36b375042ec7cb2453016b195e9596',                             
    'default_ad_rspec': {   'type': 'ProtoGENI', 'version': '2'},                       
    'geni_api': 1,                                                                      
    'geni_api_versions': {   '1': 'https://www.emulab.net:12369/protogeni/xmlrpc/am/1.0',                                                                                       
                             '2': 'https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0'},                                                                                      
    'hostname': 'boss.emulab.net',                                                      
    'hrn': 'utahemulab.cm',                                                             
    'interface': 'aggregate',                                                           
    'peers': {   'urn:publicid:IDN+ansp.br+authority+cm': 'https://pg-boss.ansp.br/protogeni/xmlrpc/am',                                                                        
                 'urn:publicid:IDN+attcm.net+authority+cm': 'https://localhost.localdomain/protogeni/xmlrpc/am',                                                                
                 'urn:publicid:IDN+chi.itesm.mx+authority+cm': 'https://boss.chi.itesm.mx/protogeni/xmlrpc/am',                                                                 
                 'urn:publicid:IDN+cis.fiu.edu+authority+cm': 'https://pg-boss.cis.fiu.edu:12369/protogeni/xmlrpc/am',                                                          
                 'urn:publicid:IDN+cmcl.cs.cmu.edu+authority+cm': 'https://boss.cmcl.cs.cmu.edu/protogeni/xmlrpc/am',                                                           
                 'urn:publicid:IDN+cron.loni.org+authority+cm': 'https://www.cron.loni.org/protogeni/xmlrpc/am',                                                                
                 'urn:publicid:IDN+elabinelab.geni.emulab.net+authority+cm': 'https://myboss.elabinelab.geni.emulab.net/protogeni/xmlrpc/am',                                   
                 'urn:publicid:IDN+emulab.net+authority+cm': 'https://www.emulab.net:12369/protogeni/xmlrpc/am',                                                                
                 'urn:publicid:IDN+etri-cm1.kreonet.net+authority+cm': 'https://etri-cm1.kreonet.net/protogeni/xmlrpc/am',                                                      
                 'urn:publicid:IDN+etri-cm2.kreonet.net+authority+cm': 'https://etri-cm2.kreonet.net/protogeni/xmlrpc/am',                                                      
                 'urn:publicid:IDN+example.org+authority+cm': 'https://host.linux.geni.emulab.net/protogeni/xmlrpc/am',                                                         
                 'urn:publicid:IDN+geelab.geni.emulab.net+authority+cm': 'https://myboss.geelab.geni.emulab.net:12369/protogeni/xmlrpc/am',                                     
                 'urn:publicid:IDN+gims.wail.wisc.edu+authority+cm': 'https://gims.wail.wisc.edu/protogeni/xmlrpc/am',                                                          
                 'urn:publicid:IDN+host.protogeni-abac.geni.emulab.net+authority+cm': 'https://host.protogeni-abac.geni.emulab.net/protogeni/xmlrpc/am',                        
                 'urn:publicid:IDN+ionpl+authority+sa': 'http://alpha.east.isi.edu:12346',                                                                                      
                 'urn:publicid:IDN+jonlab.tbres.emulab.net+authority+cm': 'https://myboss.jonlab.tbres.emulab.net:12369/protogeni/xmlrpc/am',                                   
                 'urn:publicid:IDN+maxpl+authority+sa': 'http://max-myplc.dragon.maxgigapop.net:12346',                                                                         
                 'urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm': 'https://www.myelab.testbed.emulab.net:12369/protogeni/xmlrpc/am',                                  
                 'urn:publicid:IDN+pgeni.gpolab.bbn.com+authority+cm': 'https://www.pgeni.gpolab.bbn.com/protogeni/xmlrpc/am',                                                  
                 'urn:publicid:IDN+pgeni1.gpolab.bbn.com+authority+cm': 'https://www.pgeni1.gpolab.bbn.com/protogeni/xmlrpc/am',                                                
                 'urn:publicid:IDN+pgeni3.gpolab.bbn.com+authority+cm': 'https://www.pgeni3.gpolab.bbn.com/protogeni/xmlrpc/am',                                                
                 'urn:publicid:IDN+plc+authority+sa': 'https://planet-lab.org:12346',   
                 'urn:publicid:IDN+ple+authority+sa': 'https://www.planet-lab.eu:12346/',                                                                                       
                 'urn:publicid:IDN+pni.uml.edu+authority+cm': 'https://pni.uml.edu/protogeni/xmlrpc/am',                                                                        
                 'urn:publicid:IDN+schooner.wail.wisc.edu+authority+cm': 'https://www.schooner.wail.wisc.edu/protogeni/xmlrpc/am',                                              
                 'urn:publicid:IDN+shadownet.uky.emulab.net+authority+cm': 'https://shadownet.uky.emulab.net/protogeni/xmlrpc/am',                                              
                 'urn:publicid:IDN+sparta.com+authority+cm': 'https://host.referencecm.amp.emulab.net/protogeni/xmlrpc/am',                                                     
                 'urn:publicid:IDN+uky.emulab.net+authority+cm': 'https://www.uky.emulab.net:12369/protogeni/xmlrpc/am',                                                        
                 'urn:publicid:IDN+uml.emulab.net+authority+cm': 'https://boss.uml.emulab.net/protogeni/xmlrpc/am'},                                                            
    'request_rspec_versions': [   {   'extensions': [],                                 
                                      'namespace': 'http://www.protogeni.net/resources/rspec/0.1',                                                                              
                                      'schema': 'http://www.protogeni.net/resources/rspec/0.1/request.xsd',
                                      'type': 'ProtoGENI',
                                      'version': '0.1'},
                                  {   'extensions': [],
                                      'namespace': 'http://www.protogeni.net/resources/rspec/0.2',
                                      'schema': 'http://www.protogeni.net/resources/rspec/0.2/request.xsd',
                                      'type': 'ProtoGENI',
                                      'version': '0.2'},
                                  {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],
                                      'namespace': 'http://www.protogeni.net/resources/rspec/2',
                                      'schema': 'http://www.protogeni.net/resources/rspec/2/request.xsd',
                                      'type': 'ProtoGENI',
                                      'version': '2'},
                                  {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],
                                      'namespace': 'http://www.geni.net/resources/rspec/3',
                                      'schema': 'http://www.geni.net/resources/rspec/3/request.xsd',
                                      'type': 'GENI',
                                      'version': '3'}],
    'url': 'https://www.emulab.net:12369/protogeni/xmlrpc/am',
    'urn': 'urn:publicid:IDN+emulab.net+authority+cm'}
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed getversion:

  Options as run:
                aggregate: https://www.emulab.net:12369/protogeni/xmlrpc/am
                framework: pg-gpo
                native: True

  Args: getversion

  Result Summary:
Got version for 1 out of 1 aggregates

INFO:omni: ============================================================

Notice:

    'geni_api': 1,                                                                      
    'geni_api_versions': {   '1': 'https://www.emulab.net:12369/protogeni/xmlrpc/am/1.0',                                                                                       
                             '2': 'https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0'},                     

This says this aggregate runs AM API v1 ('geni_api': 1) and indicates that the AM supports both AM API v1 or v2 accessible via different urls.

getversion with AM API v2 URL

So let's try the same things using the v2 url (https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0)

$ ~/gcf/src/omni.py -a https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 getversion
INFO:omni:Loading config file omni_config
INFO:omni:Using control framework pg-gpo 
INFO:omni:AM URN: unspecified_AM_URN (url: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0) has version:                                                                   
INFO:omni:{   'code': {   'am_code': 0, 'am_type': 'protogeni', 'geni_code': 0},        
    'geni_api': 2,                                                                      
    'output': '',                                                                       
    'value': {   'code_tag': '2adb42b80c36b375042ec7cb2453016b195e9596',                
                 'geni_ad_rspec_versions': [   {   'extensions': [],                    
                                                   'namespace': 'http://www.protogeni.net/resources/rspec/0.1',                                                                 
                                                   'schema': 'http://www.protogeni.net/resources/rspec/0.1/ad.xsd',                                                             
                                                   'type': 'ProtoGENI',                 
                                                   'version': '0.1'},                   
                                               {   'extensions': [],                    
                                                   'namespace': 'http://www.protogeni.net/resources/rspec/0.2',                                                                 
                                                   'schema': 'http://www.protogeni.net/resources/rspec/0.2/ad.xsd',                                                             
                                                   'type': 'ProtoGENI',                 
                                                   'version': '0.2'},                   
                                               {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],                                                  
                                                   'namespace': 'http://www.protogeni.net/resources/rspec/2',                                                                   
                                                   'schema': 'http://www.protogeni.net/resources/rspec/2/ad.xsd',                                                               
                                                   'type': 'ProtoGENI',                 
                                                   'version': '2'},                     
                                               {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],                                                  
                                                   'namespace': 'http://www.geni.net/resources/rspec/3',                                                                        
                                                   'schema': 'http://www.geni.net/resources/rspec/3/ad.xsd',                                                                    
                                                   'type': 'GENI',                      
                                                   'version': '3'}],                    
                 'geni_api': 2,                                                         
                 'geni_api_versions': {   '1': 'https://www.emulab.net:12369/protogeni/xmlrpc/am/1.0',                                                                          
                                          '2': 'https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0'},                                                                         
                 'geni_request_rspec_versions': [   {   'extensions': [],               
                                                        'namespace': 'http://www.protogeni.net/resources/rspec/0.1',                                                            
                                                        'schema': 'http://www.protogeni.net/resources/rspec/0.1/request.xsd',                                                   
                                                        'type': 'ProtoGENI',            
                                                        'version': '0.1'},              
                                                    {   'extensions': [],               
                                                        'namespace': 'http://www.protogeni.net/resources/rspec/0.2',                                                            
                                                        'schema': 'http://www.protogeni.net/resources/rspec/0.2/request.xsd',                                                   
                                                        'type': 'ProtoGENI',            
                                                        'version': '0.2'},              
                                                    {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],                                             
                                                        'namespace': 'http://www.protogeni.net/resources/rspec/2',                                                              
                                                        'schema': 'http://www.protogeni.net/resources/rspec/2/request.xsd',                                                     
                                                        'type': 'ProtoGENI',            
                                                        'version': '2'},                
                                                    {   'extensions': [   'http://www.protogeni.net/resources/rspec/ext/emulab/1'],                                             
                                                        'namespace': 'http://www.geni.net/resources/rspec/3',                                                                   
                                                        'schema': 'http://www.geni.net/resources/rspec/3/request.xsd',                                                          
                                                        'type': 'GENI',                 
                                                        'version': '3'}],               
                 'hostname': 'boss.emulab.net',                                         
                 'hrn': 'utahemulab.cm',                                                
                 'interface': 'aggregate',                                              
                 'peers': {   'urn:publicid:IDN+ansp.br+authority+cm': 'https://pg-boss.ansp.br/protogeni/xmlrpc/am',                                                           
                              'urn:publicid:IDN+attcm.net+authority+cm': 'https://localhost.localdomain/protogeni/xmlrpc/am',                                                   
                              'urn:publicid:IDN+chi.itesm.mx+authority+cm': 'https://boss.chi.itesm.mx/protogeni/xmlrpc/am',                                                    
                              'urn:publicid:IDN+cis.fiu.edu+authority+cm': 'https://pg-boss.cis.fiu.edu:12369/protogeni/xmlrpc/am',                                             
                              'urn:publicid:IDN+cmcl.cs.cmu.edu+authority+cm': 'https://boss.cmcl.cs.cmu.edu/protogeni/xmlrpc/am',                                              
                              'urn:publicid:IDN+cron.loni.org+authority+cm': 'https://www.cron.loni.org/protogeni/xmlrpc/am',                                                   
                              'urn:publicid:IDN+elabinelab.geni.emulab.net+authority+cm': 'https://myboss.elabinelab.geni.emulab.net/protogeni/xmlrpc/am',                      
                              'urn:publicid:IDN+emulab.net+authority+cm': 'https://www.emulab.net:12369/protogeni/xmlrpc/am',                                                   
                              'urn:publicid:IDN+etri-cm1.kreonet.net+authority+cm': 'https://etri-cm1.kreonet.net/protogeni/xmlrpc/am',                                         
                              'urn:publicid:IDN+etri-cm2.kreonet.net+authority+cm': 'https://etri-cm2.kreonet.net/protogeni/xmlrpc/am',                                         
                              'urn:publicid:IDN+example.org+authority+cm': 'https://host.linux.geni.emulab.net/protogeni/xmlrpc/am',                                            
                              'urn:publicid:IDN+geelab.geni.emulab.net+authority+cm': 'https://myboss.geelab.geni.emulab.net:12369/protogeni/xmlrpc/am',                        
                              'urn:publicid:IDN+gims.wail.wisc.edu+authority+cm': 'https://gims.wail.wisc.edu/protogeni/xmlrpc/am',                                             
                              'urn:publicid:IDN+host.protogeni-abac.geni.emulab.net+authority+cm': 'https://host.protogeni-abac.geni.emulab.net/protogeni/xmlrpc/am',           
                              'urn:publicid:IDN+ionpl+authority+sa': 'http://alpha.east.isi.edu:12346',                                                                         
                              'urn:publicid:IDN+jonlab.tbres.emulab.net+authority+cm': 'https://myboss.jonlab.tbres.emulab.net:12369/protogeni/xmlrpc/am',                      
                              'urn:publicid:IDN+maxpl+authority+sa': 'http://max-myplc.dragon.maxgigapop.net:12346',
                              'urn:publicid:IDN+myelab.testbed.emulab.net+authority+cm': 'https://www.myelab.testbed.emulab.net:12369/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+pgeni.gpolab.bbn.com+authority+cm': 'https://www.pgeni.gpolab.bbn.com/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+pgeni1.gpolab.bbn.com+authority+cm': 'https://www.pgeni1.gpolab.bbn.com/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+pgeni3.gpolab.bbn.com+authority+cm': 'https://www.pgeni3.gpolab.bbn.com/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+plc+authority+sa': 'https://planet-lab.org:12346',
                              'urn:publicid:IDN+ple+authority+sa': 'https://www.planet-lab.eu:12346/',
                              'urn:publicid:IDN+pni.uml.edu+authority+cm': 'https://pni.uml.edu/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+schooner.wail.wisc.edu+authority+cm': 'https://www.schooner.wail.wisc.edu/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+shadownet.uky.emulab.net+authority+cm': 'https://shadownet.uky.emulab.net/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+sparta.com+authority+cm': 'https://host.referencecm.amp.emulab.net/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+uky.emulab.net+authority+cm': 'https://www.uky.emulab.net:12369/protogeni/xmlrpc/am',
                              'urn:publicid:IDN+uml.emulab.net+authority+cm': 'https://boss.uml.emulab.net/protogeni/xmlrpc/am'},
                 'url': 'https://www.emulab.net:12369/protogeni/xmlrpc/am',
                 'urn': 'urn:publicid:IDN+emulab.net+authority+cm'}}
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed getversion:

  Options as run:
                aggregate: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
                framework: pg-gpo
                native: True

  Args: getversion

  Result Summary:
Got version for 1 out of 1 aggregates

INFO:omni: ============================================================


It now says 'geni_api': 2. Great!

listresources with AM API v2 URL

Now let's try listresources.

$ ~/gcf/src/omni.py -a https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 listresources
INFO:omni:Loading config file omni_config
INFO:omni:Using control framework pg-gpo
INFO:omni:Listed resources on 0 out of 1 possible aggregates.
INFO:omni:Got no resources. No resources from AM https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0: Malformed arguments: Missing arguments
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed listresources:

  Options as run:
                aggregate: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
                framework: pg-gpo
                native: True

  Args: listresources

  Result Summary: Got no resources. No resources from AM https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0: Malformed arguments: Missing arguments
INFO:omni: ============================================================


Why didn't this work?

Because you haven't told omni to use AM API v2 yet.

Why does a similar things work with getversion? Because getversion is special and is backwards compatible to allow clients that support AM API v1 to tell that the AM they are talking to doesn't support them.

listresources --api-version 2

To get AM API v2 support in listresources let's add --api-version 2 and do it again.

$ ~/gcf/src/omni.py -a https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 listresources --api-version 2
INFO:omni:Loading config file omni_config
INFO:omni:Using control framework pg-gpo
WARNING:omni:Please use the -t option to specify the desired RSpec type for AM https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 as one of [('ProtoGENI', '0.1'), ('ProtoGENI', '0.2'), ('ProtoGENI', '2'), ('GENI', '3')]
INFO:omni:Listed resources on 0 out of 1 possible aggregates.
INFO:omni:Got no resources. AM https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 supports multiple RSpec versions: [('ProtoGENI', '0.1'), ('ProtoGENI', '0.2'), ('ProtoGENI', '2'), ('GENI', '3')]
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed listresources:

  Options as run:
                aggregate: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
                api_version: 2
                framework: pg-gpo
                native: True

  Args: listresources

  Result Summary: Got no resources. AM https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 supports multiple RSpec versions: [('ProtoGENI', '0.1'), ('ProtoGENI', '0.2'), ('ProtoGENI', '2'), ('GENI', '3')]
INFO:omni: ============================================================

So why doesn't it work yet?

We need to specify the RSpec version we want using -t. For example, -t GENI 3 requests GENI v3 RSpecs.

listresources --api-version 2 -t GENI 3

Let's try that:

$ ~/gcf/src/omni.py -a https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0 listresources --api-version 2 -t GENI 3 -o
INFO:omni:Loading config file omni_config
INFO:omni:Using control framework pg-gpo
INFO:omni:Saving output to a file.
INFO:omni:Listed resources on 1 out of 1 possible aggregates.
INFO:omni:Writing to 'rspec-www-emulab-net-12369-protogeni-xmlrpc-am-2-0.xml'
INFO:omni: ------------------------------------------------------------
INFO:omni: Completed listresources:

  Options as run:
                aggregate: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
                api_version: 2
                framework: pg-gpo
                native: True
                output: True
                rspectype: ('GENI', '3')

  Args: listresources

  Result Summary: Retrieved resources from 1 aggregates.
Wrote rspecs from 1 aggregates to 1 files
Saved listResources RSpec at unspecified_AM_URN to file rspec-www-emulab-net-12369-protogeni-xmlrpc-am-2-0.xml.
INFO:omni: ============================================================

It works!

And the contents of the file are correct:

<?xml version="1.0" ?>
<!-- Resources at AM:
        URN: unspecified_AM_URN
        URL: https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0
 -->

<rspec expires="2012-01-11T15:39:04Z" generated="2012-01-11T15:39:04Z" type="advertisement" xmlns="http://www.geni.net/resources/rspec/3" xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/ad.xsd http://www.protogeni.net/resources/rspec/ext/emulab/1 http://www.protogeni.net/resources/rspec/ext/emulab/1/ptop_extension.xsd http://company.com/rspec/ext/stitch/1 http://company.com/rspec/ext/stitch/1/ad.xsd ">
  <node component_id="urn:publicid:IDN+emulab.net+node+cisco3" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" component_name="cisco3" exclusive="true">
      <hardware_type name="switch">
          <emulab:node_type type_slots="1"/>
      </hardware_type>
      <hardware_type name="lan">
          <emulab:node_type static="true" type_slots="unlimited"/>
      </hardware_type>
      <available now="true"/>
      <location country="US" latitude="40.768652" longitude="-111.84581"/>
      <interface component_id="urn:publicid:IDN+emulab.net+interface+cisco3:(null)">    
          <emulab:interface name="(null)"/>
      </interface>
      <emulab:fd name="real-switch" weight="0"/>
  </node>

<snip>

Conclusions

Always use:

  • --api-version 2 on all calls to an AM API v2 aggregate (eventually v2 will become the default, but we aren't there yet)
  • -t GENI 3 (or -t ProtGENI 2) to specify the RSpec version on listresources and createsliver calls

AM API v1 Acceptance Tests

The following should work with either gcf-1.5.1 or gcf-1.5.2 (to be released inside the next week).

The examples are from gcf-1.5.2. gcf-1.5.1 output is similar but there are fewer tests and they are less picky about the content of RSpecs.

What are the AM API v1 Acceptance Tests?

Acceptance tests to verify the implementation of AM API v1 on the forthcoming GENI racks, but they are open to anyone.

They cover all of AM API v1 + Change Set A from AM API v2.

Where are the AM API v1 Acceptance Tests?

  1. Download gcf: http://www.gpolab.bbn.com/local-sw/
  2. Unpackage and install.
  3. Files are in gcf-1.52/acceptance_tests/AM_API_v1
  4. README-accept-AMAPIv1.txt has detailed instructions on what is needed and how to run the tests.

What is tested?

From the README for gcf-1.5.2:

Test verifies:
     - Sliver creation workflow
        * CreateSliver : checks that request and manifest match
        * SliverStatus
        * ListResources <slice name> : checks that request and manifest match
        * DeleteSliver
     - Sliver creation workflow works with multiple simultaneous slices
        * checks that you can't use a slice credential from one slice to do
          ListResources <slicename> on another slice
     - Sliver creation workflow fails when:
        * request RSpec is really a manifest RSpec
        * request RSpec is malformed (ie a tag is not closed)
        * request RSpec is an empty file
     - SliverStatus, ListResources <slice name>, and DeleteSliver fail when:
        * slice has been deleted
        * slice never existed
     - GetVersion return contains:
        * GENI AM API version 1
        * 'geni_ad_rspec_versions' (or 'ad_rspec_versions') which in turn
          contains a 'type' and 'version'
        * 'geni_request_rspec_versions' (or 'request_rspec_versions')
          which in turn contains a 'type' and 'version'
     - ListResources returns an advertisement RSpec (that is
       optionally validated with rspeclint)
     - ListResources FAILS when using a bad user credential
     - ListResources FAILS when using a valid but untrusted user
       credential
     - ListResources supports 'geni_compressed' and 'geni_available' options
     - SliverRenewal for 2 days and 5 days succeeds
     - Shutdown : WARNING, running this test (which is in a separate
       file) likely requires administrator assistance to recover from)

What do I need to run them?

From the README for gcf-1.5.2:

==============================
Software Dependencies
=====================
Requires:
 * Omni 1.5.2 and the acceptance tests [3] which are distributed as part
   of the gcf1.5.2 package
 * (optional) rspeclint (Code [4] and documentation [5] is available from ProtoGENI.)
   (1) Install LibXML (which rspeclint relies on) from CPAN.
     -- On Ubuntu Linux this is the libxml-libxml-perl package
        $ sudo apt-get install libxml-libxml-perl
     -- On Fedora Linux this is the perl-XML-LibXML package
        $ sudo yum install perl-XML-LibXML
   (2) Download rspeclint from ProtoGENI and save the file as "rspeclint".
       'rspeclint' perl file is found here:
                 http://www.protogeni.net/trac/protogeni/wiki/RSpecDebugging
   (3) Add rspeclint to your path.

Credentials
===========
By policy, requires:
 * GENI credentials from the GPO ProtoGENI Slice Authority (SA) which
   is located at:
   https://boss.pgeni.gpolab.bbn.com:443/protogeni/xmlrpc/sa

What does the output of a run at ProtoGENI look like?

$ date;am_api_v1_accept.py -a am-undertest --vv; date                                                                            
Wed Jan 11 09:51:12 EST 2012                                                            
test_CreateSliver: Passes if the sliver creation workflow succeeds.  Use --rspec-file to replace the default request RSpec. ... FAIL                                            
test_CreateSliverWorkflow_fail_notexist:  Passes if the sliver creation workflow fails when the slice has never existed. ... ok                                                 
test_CreateSliverWorkflow_multiSlice: Do CreateSliver workflow with multiple slices and ensure can not do ListResources on slices with the wrong credential. ... FAIL           
test_CreateSliver_badrspec_emptyfile: Passes if the sliver creation workflow fails when the request RSpec is an empty file. ... ok                                              
test_CreateSliver_badrspec_malformed: Passes if the sliver creation workflow fails when the request RSpec is not well-formed XML. ... ok                                        
test_CreateSliver_badrspec_manifest: Passes if the sliver creation workflow fails when the request RSpec is a manifest RSpec.  --bad-rspec-file allows you to replace the RSpec with an alternative. ... FAIL                                                           
test_GetVersion: Passes if a 'GetVersion' returns an XMLRPC struct containing 'geni_api = 1' and other parameters defined in Change Set A. ... ok                               
test_ListResources: Passes if 'ListResources' returns an advertisement RSpec. ... ok    
test_ListResources_badCredential_alteredObject: Run ListResources with a User Credential that has been altered (so the signature doesn't match). ... ok                         
test_ListResources_badCredential_malformedXML: Run ListResources with a User Credential that is missing it's first character (so that it is invalid XML). ... ok                
test_ListResources_geni_available: Passes if 'ListResources' returns an advertisement RSpec. ... ok                                                                             
test_ListResources_geni_compressed: Passes if 'ListResources' returns an advertisement RSpec. ... ok                                                                            
test_ListResources_untrustedCredential: Passes if 'ListResources' FAILS to return an advertisement RSpec when using a credential from an untrusted Clearinghouse. ... ok

======================================================================
FAIL: test_CreateSliver: Passes if the sliver creation workflow succeeds.  Use --rspec-file to replace the default request RSpec.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_v1_accept.py", line 481, in test_CreateSliver
    self.subtest_CreateSliverWorkflow()
  File "./am_api_v1_accept.py", line 500, in subtest_CreateSliverWorkflow
    self.assertRspecType( manifest, 'manifest')
  File "/home/sedwards/gcf/src/omni_unittest.py", line 163, in assertRspecType
    raise WrongRspecType, msg
WrongRspecType: RSpec expected to have type 'manifest' but did not.

======================================================================
FAIL: test_CreateSliverWorkflow_multiSlice: Do CreateSliver workflow with multiple slices and ensure can not do ListResources on slices with the wrong credential.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_v1_accept.py", line 669, in test_CreateSliverWorkflow_multiSlice
    self.assertRspecType( "".join(manifest[i]), 'manifest')
  File "/home/sedwards/gcf/src/omni_unittest.py", line 163, in assertRspecType
    raise WrongRspecType, msg
WrongRspecType: RSpec expected to have type 'manifest' but did not.

======================================================================
FAIL: test_CreateSliver_badrspec_manifest: Passes if the sliver creation workflow fails when the request RSpec is a manifest RSpec.  --bad-rspec-file allows you to replace the RSpec with an alternative.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_v1_accept.py", line 945, in test_CreateSliver_badrspec_manifest
    self.subtest_MinCreateSliverWorkflow, slice_name)
AssertionError: NotNoneAssertionError not raised

----------------------------------------------------------------------
Ran 13 tests in 444.584s

FAILED (failures=3)
Wed Jan 11 09:58:37 EST 2012

Why all of these errors?

There are three issues that the acceptance test is catching:

  1. (Deurig is working on this) manifest RSpecs returned by calls to ListResources and CreateSliver contain the request schema not the manifest schema
  2. (Deurig is working on this) Stitching extension includes company.com
  3. Passing in a ProtoGENIv2 manifest RSpec to CreateSliver works at ProtoGENI. Should it?

When items 1 and 2 are fixed, the output will look more like this:

$ am_api_v1_accept.py -a am-undertest --vv
test_CreateSliver: Passes if the sliver creation workflow succeeds.  Use --rspec-file to replace the default request RSpec. ... ok
test_CreateSliverWorkflow_fail_notexist:  Passes if the sliver creation workflow fails when the slice has never existed. ... ok
test_CreateSliverWorkflow_multiSlice (__main__.Test) ... ok
test_CreateSliver_badrspec_emptyfile: Passes if the sliver creation workflow fails when the request RSpec is an empty file. ... ok
test_CreateSliver_badrspec_malformed: Passes if the sliver creation workflow fails when the request RSpec is not well-formed XML. ... ok
test_CreateSliver_badrspec_manifest: Passes if the sliver creation workflow fails when the request RSpec is a manifest RSpec.  --bad-rspec-file allows you to replace the RSpec with an alternative. ... FAIL
test_GetVersion: Passes if a 'GetVersion' returns an XMLRPC struct containing 'geni_api = 1' and other parameters defined in Change Set A. ... ok
test_ListResources: Passes if 'ListResources' returns an advertisement RSpec. ... ok
Run ListResources with a User Credential that has been altered (so the signature doesn't match). ... ok
Run ListResources with a User Credential that is missing it's first character (so that it is invalid XML). ... ok
test_ListResources_geni_available: Passes if 'ListResources' returns an advertisement RSpec. ... ok
test_ListResources_geni_compressed: Passes if 'ListResources' returns an advertisement RSpec. ... ok
test_ListResources_untrustedCredential: Passes if 'ListResources' FAILS to return an advertisement RSpec when using a credential from an untrusted Clearinghouse. ... ok

======================================================================
FAIL: test_CreateSliver_badrspec_manifest: Passes if the sliver creation workflow fails when the request RSpec is a manifest RSpec.  --bad-rspec-file allows you to replace the RSpec with an alternative.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_v1_accept.py", line 939, in test_CreateSliver_badrspec_manifest
    self.assertRaises(NotNoneAssertionError,
AssertionError: NotNoneAssertionError not raised

----------------------------------------------------------------------
Ran 13 tests in 672.873s

FAILED (failures=1)

Shutdown test

There is also a Shutdown test which requires adminstrator help to clean up.

So don't run it unless you are ready. To facilitate this, the test is in a separate file.

$ am_api_v1_accept.py -a am-undertest Test.test_CreateSliverWorkflow_with_Shutdown

How do I comment on this?

Send email to gcf-dev@geni.net