Skip to content

Commit 0678df0

Browse files
authored
CA-425192/CP-311612/CP-311613: backport quicktest SMAPIv3 fixes to LCM branch (#6959)
Backport #6908 to the LCM branch. These latent bugs have existed in the tests for a long time, but previously our test system (XenRT) picked machines randomly, so it would've been unlikely to pick a machine which has a local 4K SR (SMAPIv3 instead of SMAPIv1), and even if it did, the test would seemingly pass on a rerun (because another machine would get picked). We are now explicitly running the test multiple times on different hardware categories, and some of those tests are now failing 100% of the time.
2 parents eaf7841 + 58b47ab commit 0678df0

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

ocaml/quicktest/qt_filter.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ module SR : sig
6868
val not_type : string -> srs -> srs
6969
(** Filters out SRs of the given type *)
7070

71+
val is_smapiv1 : Qt.sr_info -> bool
72+
(** Whether this is a v1 (true) or v3+ (false) SR *)
73+
7174
val smapiv1 : srs -> srs
7275
(** Selects SMAPIv1 SRs *)
7376

ocaml/quicktest/quicktest_cbt.ml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,21 @@ let vdi_data_destroy_test rpc session_id sr_info () =
7373
(VDI.get_type ~session_id ~rpc ~self:snapshot) ;
7474
assert_cbt_status true ~rpc ~session_id ~vDI:snapshot
7575
~msg:"VDI snapshot cbt_enabled field erroneously set to false" ;
76+
7677
(* test_vdi_update ~session_id snapshot;
7778
temporarily comment this out as it is blocked on CA-273981
7879
VDI.update doesn't currently work on cbt-metadata VDIs *)
79-
let content_id_str = "/No content: this is a cbt_metadata VDI/" in
80-
Alcotest.(check string)
81-
(Printf.sprintf
82-
"VDI.data_destroy failed to update VDI.content_id to \"%s\""
83-
content_id_str
84-
)
85-
(VDI.get_other_config ~session_id ~rpc ~self:snapshot
86-
|> List.assoc "content_id"
87-
)
88-
content_id_str
80+
if Qt_filter.SR.is_smapiv1 sr_info then
81+
let content_id_str = "/No content: this is a cbt_metadata VDI/" in
82+
Alcotest.(check string)
83+
(Printf.sprintf
84+
"VDI.data_destroy failed to update VDI.content_id to \"%s\""
85+
content_id_str
86+
)
87+
(VDI.get_other_config ~session_id ~rpc ~self:snapshot
88+
|> List.assoc "content_id"
89+
)
90+
content_id_str
8991
)
9092

9193
(* Check VDI.{copy, clone} all properly update cbt_enabled

ocaml/quicktest/quicktest_vdi_ops_data_integrity.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ let large_data_integrity_tests vdi_op op_name =
256256
let sr_with_vdi_create_destroy =
257257
Qt_filter.SR.(all |> allowed_operations [`vdi_create; `vdi_destroy] |> not_iso)
258258

259-
let supported_srs test_case =
259+
let supported_srs ?(f = Fun.id) test_case =
260260
let open Qt_filter in
261-
test_case |> conn |> sr sr_with_vdi_create_destroy
261+
test_case |> conn |> sr (f sr_with_vdi_create_destroy)
262262

263263
(* XXX Currently only GFS2 SRs support sparse reading of VDIs exported as TAR *)
264264
let supported_gfs2_srs test_case =
@@ -276,7 +276,7 @@ let tests () =
276276
)
277277
@ (delta_data_integrity_tests delta_export_import_vhd
278278
"VDI delta export/import to/from VHD file"
279-
|> supported_srs
279+
|> supported_srs ~f:Qt_filter.SR.smapiv1
280280
)
281281
@ (data_integrity_tests export_import_tar "VDI export/import to/from TAR file"
282282
|> supported_srs

0 commit comments

Comments
 (0)