Skip to content

Commit

Permalink
fixup! fixup! Remove CVM and relevant test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Ming Lu <[email protected]>
  • Loading branch information
minglumlu committed May 29, 2024
1 parent 0a9c0cb commit 22dad9b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ocaml/tests/test_xapi_xenops.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let test_xapi_restart_inner () =
let vm3 = make_vm ~__context ~name_label:"vm3" () in
let vm4 = make_vm ~__context ~name_label:"vm4" () in
let vm5 = make_vm ~__context ~name_label:"vm5" () in
let vm7 = make_vm ~__context ~name_label:"vm7" () in
let vm6 = make_vm ~__context ~name_label:"vm6" () in
let host2 =
make_host ~__context ~name_label:"host2" ~hostname:"localhost2" ()
in
Expand All @@ -71,7 +71,7 @@ let test_xapi_restart_inner () =
Db.VM.add_to_other_config ~__context ~self:vm ~key:"xenops"
~value:"simulator"
in
List.iter add_flags [vm1; vm2; vm3; vm4; vm5; vm7] ;
List.iter add_flags [vm1; vm2; vm3; vm4; vm5; vm6] ;
try
(* Domain zero is running but not in xenopsd *)
Db.VM.set_is_control_domain ~__context ~self:vm0 ~value:true ;
Expand All @@ -84,7 +84,7 @@ let test_xapi_restart_inner () =
Xapi_xenops.start ~__context ~self:vm3 false false ;
Xapi_xenops.start ~__context ~self:vm4 false false ;
Xapi_xenops.start ~__context ~self:vm5 false false ;
Xapi_xenops.start ~__context ~self:vm7 false false ;
Xapi_xenops.start ~__context ~self:vm6 false false ;
(* Kill the event thread *)
cancel := true ;
Client.UPDATES.inject_barrier "dbg"
Expand Down Expand Up @@ -118,7 +118,7 @@ let test_xapi_restart_inner () =
in
List.iter
(fun vm -> assert_correct_state (vm, true))
[vm1; vm2; vm3; vm4; vm5; vm7] ;
[vm1; vm2; vm3; vm4; vm5; vm6] ;
(* Simulate various out-of-band VM operations by resetting the xapi state to halted, and stop one that was running *)
Db.VM.set_resident_on ~__context ~self:vm1 ~value:Ref.null ;
Db.VM.set_name_label ~__context ~self:vm1
Expand All @@ -135,10 +135,10 @@ let test_xapi_restart_inner () =
~value:"vm4: xapi thinks it's running somewhere else" ;
Db.VM.destroy ~__context ~self:vm5 ;
ignore
(Client.VM.shutdown "dbg" (Xapi_xenops.id_of_vm ~__context ~self:vm7) None) ;
Db.VM.set_name_label ~__context ~self:vm7
(Client.VM.shutdown "dbg" (Xapi_xenops.id_of_vm ~__context ~self:vm6) None) ;
Db.VM.set_name_label ~__context ~self:vm6
~value:
"vm7: shutdown in xenopsd while xapi was off (and is_control_domain)" ;
"vm6: shutdown in xenopsd while xapi was off (and is_control_domain)" ;
(* Now run the on_xapi_restart logic *)
debug "Resync resident on" ;
Xapi_xenops.resync_resident_on ~__context ;
Expand Down Expand Up @@ -175,7 +175,7 @@ let test_xapi_restart_inner () =
; (vm2, true)
; (vm3, false)
; (vm4, false)
; (vm7, false)
; (vm6, false)
]
with e ->
Printf.printf "Caught: %s\n" (Printexc.to_string e) ;
Expand Down

0 comments on commit 22dad9b

Please sign in to comment.