[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] make quicktest aware of writable ISO SRs



# HG changeset patch
# User Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>
# Date 1268750452 0
# Node ID e7005ce9363b19c72d3d18652ffbb0e6f39010d4
# Parent  8dd78efeaad1907d9f67dbc85b93feffc4285c0f
CA-38109: HostInstallation/TCQuicktest: quicktest failed: 
SR_OPERATION_NOT_SUPPORTED: OpaqueRef:2c96e6a1-afdc-19a6-b6cb-37af7e90e504
CP-1603: CR-50: R4. Include REQ259 - Writable ISO SRs

Update quicktest to match new writable ISO SR support.  The XenServer
Tools SR is special-cased to prevent writing even if the ISO SR backend
itself allows it, and quicktest needed to be updated to match this.

Also, the VM import code has a special case to protect importing into
ISO SRs, so quicktest needs to know about this, too.

Signed-off-by: Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>

diff -r 8dd78efeaad1 -r e7005ce9363b ocaml/xapi/quicktest.ml
--- a/ocaml/xapi/quicktest.ml   Fri Mar 05 10:43:32 2010 +0000
+++ b/ocaml/xapi/quicktest.ml   Tue Mar 16 14:40:52 2010 +0000
@@ -99,6 +99,11 @@
   success test;
   vm
 
+let all_non_iso_srs_with_vdi_create session_id =
+  List.filter
+    (fun sr -> "iso" <> Client.SR.get_content_type !rpc session_id sr)
+    (all_srs_with_vdi_create session_id)
+
 let import_export_test session_id = 
   let test = make_test "VM import/export test" 0 in
   start test;
@@ -107,7 +112,7 @@
 
   Unixext.unlink_safe export_filename;
   vm_export test session_id vm export_filename;
-  let all_srs = all_srs_with_vdi_create session_id in
+  let all_srs = all_non_iso_srs_with_vdi_create session_id in
   List.iter
     (fun sr ->
        debug test (Printf.sprintf "Attempting import to SR: %s" 
(Quicktest_storage.name_of_sr session_id sr));
diff -r 8dd78efeaad1 -r e7005ce9363b ocaml/xapi/quicktest_storage.ml
--- a/ocaml/xapi/quicktest_storage.ml   Fri Mar 05 10:43:32 2010 +0000
+++ b/ocaml/xapi/quicktest_storage.ml   Tue Mar 16 14:40:52 2010 +0000
@@ -524,6 +524,10 @@
   | [ _, plugin ] ->
       plugin.API.sM_capabilities 
 
+let is_tools_sr session_id sr = 
+  let other_config = Client.SR.get_other_config !rpc session_id sr in
+  List.mem_assoc Xapi_globs.tools_sr_tag other_config 
+
 let foreach_sr session_id sr = 
   let ty = Client.SR.get_type !rpc session_id sr in
   let name = Client.SR.get_name_label !rpc session_id sr in
@@ -536,6 +540,17 @@
   | [ _, plugin ] ->
       let caps = plugin.API.sM_capabilities in
       debug test (Printf.sprintf "Capabilities reported: [ %s ]" 
(String.concat " " caps));
+      (* Mirror the special handling for the XenServer Tools SR; the
+         create and delete capabilities are forbidden in that special case.
+         See Xapi_sr.valid_operations. *)
+      let caps =
+        if is_tools_sr session_id sr then
+          List.filter
+            (fun cap -> not (List.mem cap [ vdi_create; vdi_delete ])) caps
+        else
+          caps
+      in
+      debug test (Printf.sprintf "Capabilities filtered to: [ %s ]" 
(String.concat " " caps));
       success test;
 
       sr_scan_test       caps session_id sr;
2 files changed, 21 insertions(+), 1 deletion(-)
ocaml/xapi/quicktest.ml         |    7 ++++++-
ocaml/xapi/quicktest_storage.ml |   15 +++++++++++++++


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.