GENI-NSF / geni-tools

Omni, stitcher, GCF sample aggregate manager, and other GENI tools.
Other
11 stars 15 forks source link

ensure geni_version is a string #516

Closed ahelsing closed 9 years ago

ahelsing commented 9 years ago

Make sure geni_version is a string on credential structs.

In particular, correct for chapi ticket #239.

Imported from trac ticket #516, created by ahelsing on 02-18-2014 at 14:43, last modified: 02-19-2014 at 14:47

luisanevers commented 9 years ago

lnevers (luisanevers) attached acceptance.log on 02-19-2014 at 14:20

luisanevers commented 9 years ago

Problem originally found by running AM API V3 acceptance tests with GPO IG, which reported this failure:

            AssertionError: Return from 'GetSliceCred' expected to have entry
           'geni_version' of type '<type 'str'>' but instead returned: 2

Re-ran the AM API V3 acceptance tests with GPO IG and ran into new failures:

$ ./am_api_accept.py -a am-undertest -V 3
F.F..F...E...
======================================================================
ERROR: test_ListResources_badCredential_malformedXML: Run ListResources with
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 393, in test_ListResources_badCredential_malformedXML
    self.subtest_ListResources_badCredential(self.removeFirstChar)
  File "./am_api_accept.py", line 502, in subtest_ListResources_badCredential
    usercred=broken_usercred)
  File "/usr/lib/python2.6/unittest.py", line 336, in failUnlessRaises
    callableObj(*args, **kwargs)
  File "./am_api_accept.py", line 620, in subtest_ListResources
    slicecredfile=slicecredfile, typeOnly=typeOnly )
  File "./am_api_accept.py", line 685, in subtest_query_rspec
    (text, ret_dict) = self.call(omniargs, self.options_copy)
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 172, in call
    ret_val = omni.call( cmd, options=options, verbose=True )
  File "/home/lnevers/gcf-2.5-021914/src/gcf/oscript.py", line 596, in call
    return API_call( framework, config, args, opts, verbose=verbose )
  File "/home/lnevers/gcf-2.5-021914/src/gcf/oscript.py", line 618, in API_call
    result = handler._handle(args)
  File "/home/lnevers/gcf-2.5-021914/src/gcf/omnilib/handler.py", line 90, in _handle
    (message, val) = getattr(self.amhandler,call)(args[1:])
  File "/home/lnevers/gcf-2.5-021914/src/gcf/omnilib/amhandler.py", line 1381, in listresources
    (rspecs, message) = self._listresources( args )
  File "/home/lnevers/gcf-2.5-021914/src/gcf/omnilib/amhandler.py", line 1096, in _listresources
    (cred, message) = self.framework.get_user_cred_struct()
  File "/home/lnevers/gcf-2.5-021914/src/gcf/omnilib/frameworks/framework_base.py", line 255, in get_user_cred_struct
    cred = self.wrap_cred(cred)
  File "/home/lnevers/gcf-2.5-021914/src/gcf/omnilib/frameworks/framework_base.py", line 285, in wrap_cred
    cred_type, cred_version = credutils.get_cred_type(cred)
  File "/home/lnevers/gcf-2.5-021914/src/gcf/omnilib/util/credparsing.py", line 106, in get_cred_type
    doc = md.parseString(cred)
  File "/usr/local/lib/python2.6/dist-packages/PyXML-0.8.4-py2.6-linux-i686.egg/_xmlplus/dom/minidom.py", line 1925, in parseString
    return expatbuilder.parseString(string)
  File "/usr/local/lib/python2.6/dist-packages/PyXML-0.8.4-py2.6-linux-i686.egg/_xmlplus/dom/expatbuilder.py", line 942, in parseString
    return builder.parseString(string)
  File "/usr/local/lib/python2.6/dist-packages/PyXML-0.8.4-py2.6-linux-i686.egg/_xmlplus/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
ExpatError: not well-formed (invalid token): line 1, column 0

======================================================================
FAIL: test_CreateSliver: Passes if the sliver creation workflow succeeds.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 773, in test_CreateSliver
    self.subtest_CreateSliverWorkflow()
  File "./am_api_accept.py", line 803, in subtest_CreateSliverWorkflow
    numslivers, manifest, slivers = self.subtest_generic_CreateSliver( slicename, doProvision, doPOA, expectedExpiration=sliceExpiration )
  File "./am_api_accept.py", line 1898, in subtest_generic_CreateSliver
    self.subtest_PerformOperationalAction( slicename, 'geni_start')
  File "./am_api_accept.py", line 1470, in subtest_PerformOperationalAction
    expectedExpiration=expectedExpiration)
  File "./am_api_accept.py", line 1552, in subtest_AMAPIv3CallNoRspec
    retVal2 = self.assertPerformOperationalActionReturn( agg, retVal, expectedExpiration=expectedExpiration, sliceExpiration=sliceExpiration  )
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 679, in assertPerformOperationalActionReturn
    self.assertList( retVal )
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 191, in assertList
    raise NotListAssertionError, msg
NotListAssertionError: Type of '0' is '<type 'int'>' not 'list' as expected.

======================================================================
FAIL: test_CreateSliverWorkflow_multiSlice: Do CreateSliver workflow with multiple slices
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 1141, in test_CreateSliverWorkflow_multiSlice
    createReturn = self.subtest_generic_CreateSliver( slicenames[i], expectedExpiration=sliceExpiration )
  File "./am_api_accept.py", line 1898, in subtest_generic_CreateSliver
    self.subtest_PerformOperationalAction( slicename, 'geni_start')
  File "./am_api_accept.py", line 1470, in subtest_PerformOperationalAction
    expectedExpiration=expectedExpiration)
  File "./am_api_accept.py", line 1552, in subtest_AMAPIv3CallNoRspec
    retVal2 = self.assertPerformOperationalActionReturn( agg, retVal, expectedExpiration=expectedExpiration, sliceExpiration=sliceExpiration  )
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 679, in assertPerformOperationalActionReturn
    self.assertList( retVal )
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 191, in assertList
    raise NotListAssertionError, msg
NotListAssertionError: Type of '0' is '<type 'int'>' not 'list' as expected.

======================================================================
FAIL: test_GetVersion: Passes if a 'GetVersion' returns an XMLRPC struct containing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 229, in test_GetVersion
    self.assertGeniSingleAllocationIfExists( "GetVersion", agg, value )
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 799, in assertGeniSingleAllocationIfExists
    geni_single_allocation = self.assertReturnKeyValueTypeIfExists(AMAPI_call, agg, retVal, key, valueType)
  File "/home/lnevers/gcf-2.5-021914/src/omni_unittest.py", line 433, in assertReturnKeyValueTypeIfExists
    % (method, aggName, key, str(valueType), str(dictionary[key])))
AssertionError: Return from 'GetVersion' at http://instageni.gpolab.bbn.com/protogeni/xmlrpc/am/3.0 expected to have entry 'geni_single_allocation' of type '<type 'int'>' but instead returned: 1

----------------------------------------------------------------------
Ran 13 tests in 351.158s

FAILED (failures=3, errors=1)

Will attach acceptance test log.

Trac comment by lnevers (github user: luisanevers) on 02-19-2014 at 14:19

ahelsing commented 9 years ago

The error about '0' is not a list is the known PG APIv3 poa bug.

The Expat Error is a real bug fixed in ticket #521

Trac comment by ahelsing on 02-19-2014 at 14:47