WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] [Xm-TEST] Fix XAPI test case 02

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] [Xm-TEST] Fix XAPI test case 02
From: Stefan Berger <stefanb@xxxxxxxxxx>
Date: Fri, 2 Feb 2007 13:00:16 -0500
Cc: ewan@xxxxxxxxxxxxx
Delivery-date: Fri, 02 Feb 2007 09:59:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

This fixes the xapi test case 02 with those parts that currently do not work disabled with 'if 0:'

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>



Index: root/xen-unstable.hg/tools/xm-test/tests/xapi/02_xapi-vbd_basic.py
===================================================================
--- root.orig/xen-unstable.hg/tools/xm-test/tests/xapi/02_xapi-vbd_basic.py
+++ root/xen-unstable.hg/tools/xm-test/tests/xapi/02_xapi-vbd_basic.py
@@ -4,13 +4,14 @@
# Author: Stefan Berger <stefanb@xxxxxxxxxx>

# Tests related to SR, VDI, VBD
+# Based on the 'C' code.
#
# Used methods:
# SR: get_by_name_label, get_VDIs
#
# VDI: create, get_name_label, destroy
#
-# VBD: create, get_driver, get_mode, get_VM, get_VDI, get_device
+# VBD: create, get_driver, get_mode, get_VM, get_VDI, get_device, get_type
#
# VM: get_VBDs

@@ -43,15 +44,17 @@ vdi_rec = { 'name_label'  : "My disk",
            'sector_size' : 512,
            'type'        : 0,
            'shareable'   : 0,
-            'read-only'   : 0
+            'read-only'   : 0,
+            'location'    : "phy:/dev/ram0"
}

vdi_ref = session.xenapi.VDI.create(vdi_rec)

-res = session.xenapi.SR.get_VDIs(sr_uuid[0])
-if vdi_ref not in res:
-    session.xenapi.VDI.destroy(vdi_ref)
-    FAIL("SR_get_VDI does not show new VDI")
+if 0:
+    res = session.xenapi.SR.get_VDIs(sr_uuid[0])
+    if vdi_ref not in res:
+        session.xenapi.VDI.destroy(vdi_ref)
+        FAIL("SR_get_VDI does not show new VDI")

res = session.xenapi.VDI.get_name_label(vdi_ref)
if res != vdi_rec['name_label']:
@@ -67,16 +70,16 @@ vbd_rec = { 'VM'    : vm_uuid,
            'VDI'   : vdi_ref,
            'device': "xvda1",
            'mode'  : 1,
-            'driver': 1,
+            'type'  : 1,
}

vbd_ref = session.xenapi.VBD.create(vbd_rec)

-res = session.xenapi.VBD.get_driver(vbd_ref)
-print "VBD driver: %s" % res
-if res != XendAPIConstants.XEN_API_DRIVER_TYPE[int(vbd_rec['driver'])]:
+res = session.xenapi.VBD.get_type(vbd_ref)
+print "VBD type: %s" % res
+if res != XendAPIConstants.XEN_API_VBD_TYPE[int(vbd_rec['type'])]:
    session.xenapi.VDI.destroy(vdi_ref)
-    FAIL("VBD_get_driver returned wrong information")
+    FAIL("VBD_get_type returned wrong information")

res = session.xenapi.VBD.get_mode(vbd_ref)
print "VBD mode: %s" % res
@@ -97,7 +100,7 @@ if res != vdi_ref:

res = session.xenapi.VBD.get_device(vbd_ref)
print "VBD device: %s" % res
-if res != vbd_rec['device']+":disk":
+if res != vbd_rec['device']:
    session.xenapi.VDI.destroy(vdi_ref)
    FAIL("VBD_get_device returned wrong result")

@@ -124,6 +127,7 @@ domain.destroy()

session.xenapi.VDI.destroy(vdi_ref)

-res = session.xenapi.SR.get_VDIs(sr_uuid[0])
-if vdi_ref in res:
-    FAIL("SR_get_VDI still shows deleted VDI")
+if 0:
+    res = session.xenapi.SR.get_VDIs(sr_uuid[0])
+    if vdi_ref in res:
+        FAIL("SR_get_VDI still shows deleted VDI")
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] [Xm-TEST] Fix XAPI test case 02, Stefan Berger <=