Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ocaml/xapi/cancel_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,19 @@ let _ =
| [ v ] ->
let net = Client.Network.get_by_name_label ~rpc ~session_id ~label:"Host internal management network" in
if List.length net = 0 then failwith "Failed to find the host internal management network";
let vdi = Client.VDI.get_by_name_label ~rpc ~session_id ~label:"xs-tools.iso" in
if List.length vdi = 0 then failwith "Failed to find the xs-tools.iso";
let vdi =
let tools_iso_filter = "field \"is_tools_iso\"=\"true\"" in
begin match Client.VDI.get_all_records_where !rpc session_id tools_iso_filter with
| (vdi, _)::_ -> vdi
| [] -> failwith "Failed to find the tools ISO";
end
in
let env = {
session_id = session_id;
vm = v;
id = Client.VM.get_uuid ~rpc ~session_id ~self:v;
net = List.hd net;
vdi = List.hd vdi;
vdi;
} in
run env
| _ ->
Expand Down
22 changes: 15 additions & 7 deletions ocaml/xapi/quicktest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,14 @@ let setup_export_test_vm session_id =
debug test (Printf.sprintf "Template has uuid: %s%!" uuid);
let vm = vm_install test session_id uuid "quicktest-export" in
debug test (Printf.sprintf "Installed new VM");
let cd = List.hd (Client.VDI.get_by_name_label !rpc session_id "xs-tools.iso") in
let cd =
let tools_iso_filter = "field \"is_tools_iso\"=\"true\"" in
match Client.VDI.get_all_records_where !rpc session_id tools_iso_filter with
| (vdi, _)::_ -> vdi
| [] ->
failed test "Failed to find tools ISO VDI";
failwith "setup_export_test_vm";
in
debug test "Looking for the SR which supports the smallest disk size";
let all_srs = all_srs_with_vdi_create session_id in
let smallest : int64 option list = List.map (fun sr -> Quicktest_storage.find_smallest_disk_size session_id sr) all_srs in
Expand All @@ -320,12 +327,13 @@ let setup_export_test_vm session_id =
| sr, None -> debug test (Printf.sprintf "SR %s has no minimum disk size!" sr)
) (List.combine sr_names smallest);
let minimum = List.fold_left min (1L ** gib) (List.map (fun x -> Opt.default (1L ** gib) x) smallest) in
let possible_srs = List.filter (fun (sr, size) -> size = Some minimum) (List.combine all_srs smallest) in
if List.length possible_srs = 0 then begin
failed test "Failed to find an SR which can create a VDI";
failwith "setup_export_test_vm";
end;
let sr = fst (List.hd possible_srs) in
let sr =
match List.filter (fun (_, size) -> size = Some minimum) (List.combine all_srs smallest) with
| (sr, _)::_ -> sr
| [] ->
failed test "Failed to find an SR which can create a VDI";
failwith "setup_export_test_vm";
in
debug test (Printf.sprintf "Using a disk size of: %Ld on SR: %s" minimum (Quicktest_storage.name_of_sr session_id sr));
let vdi = Client.VDI.create !rpc session_id "small"
"description" sr 4194304L `user false false [] [] [] [] in
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xe-cli/rt/tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ let cd_guest_verified (cli : Util.t_cli) vmid =
log Info "Test: VM NAME='%s'" domainname;
log Info "Test: Testing CD operations";
ensure_vm_down cli vmid 0;
let cd1 = ("xs-tools.iso",get_vdi_uuid_from_name cli "xs-tools.iso","2","xenlegacy.exe") in
let cd2 = ("xs-tools.iso",get_vdi_uuid_from_name cli "xs-tools.iso","3","xenlegacy.exe") in
let cd1 = ("guest-tools.iso",get_vdi_uuid_from_name cli "guest-tools.iso","2","xenlegacy.exe") in
let cd2 = ("guest-tools.iso",get_vdi_uuid_from_name cli "guest-tools.iso","3","xenlegacy.exe") in

let checkcdset cdset =
let missingcds = List.filter (fun (name,uuid,device,file) -> uuid="") cdset in
Expand Down
9 changes: 5 additions & 4 deletions scripts/scalability-tests/provision-vm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if [ $# -le 1 ]; then
echo "Usage: ${0} vm_per_host host1 [host2 ... hostN]"
echo "${0} provisions <vm_per_host> debiant-etch VMs on each host and installs them on a local VHD disk. Moreover, all the hosts join a common pool."
echo "if PROVISION_VM_WITH_CD is set to 1, then attach xs-tools.iso CD-ROM to the initial Debian Etch VM before cloning it."
echo "if PROVISION_VM_WITH_CD is set to 1, then attach guest tools ISO CD-ROM to the initial Debian Etch VM before cloning it."
exit 1
fi

Expand Down Expand Up @@ -68,9 +68,10 @@ install () {
echo "[${HOST}] Set."

if [ "${PROVISION_VM_WITH_CD}" == "1" ]; then
echo "[${HOST}] Attaching a CD-ROM."
${XE} vm-cd-add vm=${DEB} cd-name=xs-tools.iso device=3
echo "[${HOST}] Attached."
echo "[${HOST}] Attaching a CD-ROM."
TOOLS_ISO=`${XE} vdi-list is-tools-iso=ture params=name-label --minimal`
${XE} vm-cd-add vm=${DEB} cd-name=${TOOLS_ISO} device=3
echo "[${HOST}] Attached."
fi

}
Expand Down