direct-io.hg

changeset 14307:5dd14bfbe956

Make the VTPM.destroy method return 'void' upon success and adapt the
test case to reflect that.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Mar 09 02:32:52 2007 +0000 (2007-03-09)
parents b2f0840bb88f
children a67d3fbd4577
files tools/python/xen/xend/XendAPI.py tools/xm-test/tests/vtpm/09_vtpm-xapi.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Fri Mar 09 01:59:59 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Fri Mar 09 02:32:52 2007 +0000
     1.3 @@ -1926,7 +1926,7 @@ class XendAPI(object):
     1.4                   XendDomain.POWER_STATE_NAMES[dom.state]])
     1.5              from xen.xend.server import tpmif
     1.6              tpmif.destroy_vtpmstate(dom.getName())
     1.7 -            return xen_api_success(True)
     1.8 +            return xen_api_success_void()
     1.9          else:
    1.10              return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
    1.11  
     2.1 --- a/tools/xm-test/tests/vtpm/09_vtpm-xapi.py	Fri Mar 09 01:59:59 2007 +0000
     2.2 +++ b/tools/xm-test/tests/vtpm/09_vtpm-xapi.py	Fri Mar 09 02:32:52 2007 +0000
     2.3 @@ -113,7 +113,7 @@ if not re.search("PCR-00:",run["output"]
     2.4      FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
     2.5  
     2.6  try:
     2.7 -    rc = session.xenapi.VTPM.destroy(vtpm_uuid)
     2.8 +    session.xenapi.VTPM.destroy(vtpm_uuid)
     2.9      #Should never get here
    2.10      FAIL("Could destroy vTPM while VM is running")
    2.11  except:
    2.12 @@ -124,7 +124,7 @@ if rc:
    2.13      FAIL("Could not suspend VM")
    2.14  
    2.15  try:
    2.16 -    rc = session.xenapi.VTPM.destroy(vtpm_uuid)
    2.17 +    session.xenapi.VTPM.destroy(vtpm_uuid)
    2.18      #May not throw an exception in 'suspend' state
    2.19  except:
    2.20      pass
    2.21 @@ -150,8 +150,9 @@ if not re.search("PCR-00:",run["output"]
    2.22  
    2.23  domain.stop()
    2.24  
    2.25 -rc = session.xenapi.VTPM.destroy(vtpm_uuid)
    2.26 -if not rc:
    2.27 +try:
    2.28 +    session.xenapi.VTPM.destroy(vtpm_uuid)
    2.29 +except:
    2.30      FAIL("Could NOT destroy vTPM while domain is halted.")
    2.31  
    2.32  domain.destroy()