Skip to content

Commit 6be0cd2

Browse files
committed
Fix sm-cli/test
Signed-off-by: Rob Hoes <[email protected]>
1 parent a0fbe9d commit 6be0cd2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

ocaml/sm-cli/test.ml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ let rpc call =
3030
~http:(xmlrpc ~version:"1.0" "/") call
3131

3232
open Storage_interface
33+
module Client = Storage_interface.Client(struct let rpc = rpc end)
3334

3435
let task = "sm-test"
3536

@@ -41,7 +42,7 @@ let usage_and_exit () =
4142
exit 1
4243

4344
let find_vdi_in_scan sr vdi =
44-
match Client.SR.scan rpc ~task ~sr with
45+
match Client.SR.scan ~task ~sr with
4546
| Success (Vdis results) ->
4647
begin
4748
try
@@ -52,7 +53,7 @@ let find_vdi_in_scan sr vdi =
5253
| x ->
5354
failwith (Printf.sprintf "Unexpected result from SR.scan: %s\n" (string_of_result x))
5455

55-
let test_query sr _ = let (_: query_result) = Client.query rpc () in ()
56+
let test_query sr _ = let (_: query_result) = Client.query () in ()
5657

5758
let missing_vdi = "missing"
5859

@@ -62,7 +63,7 @@ let test_scan_missing_vdi sr _ =
6263
| None -> ()
6364

6465
let test_destroy_missing_vdi sr _ =
65-
begin match Client.VDI.destroy rpc ~task ~sr ~vdi:missing_vdi with
66+
begin match Client.VDI.destroy ~task ~sr ~vdi:missing_vdi with
6667
| Failure Vdi_does_not_exist -> ()
6768
| x -> failwith (Printf.sprintf "Unexpected result from VDI.destroy: %s\n" (string_of_result x))
6869
end
@@ -104,7 +105,7 @@ let example_vdi_info =
104105

105106
let test_create_destroy sr _ =
106107
let vdi_info = example_vdi_info in
107-
let vdi_info' = begin match Client.VDI.create rpc ~task ~sr ~vdi_info ~params:[] with
108+
let vdi_info' = begin match Client.VDI.create ~task ~sr ~vdi_info ~params:[] with
108109
| Success (Vdi vdi_info') ->
109110
vdi_info_assert_equal vdi_info vdi_info';
110111
vdi_info'
@@ -115,7 +116,7 @@ let test_create_destroy sr _ =
115116
| None -> failwith (Printf.sprintf "SR.scan failed to find vdi: %s" (string_of_vdi_info vdi_info'))
116117
| Some vdi_info'' -> vdi_info_assert_equal vdi_info' vdi_info''
117118
end;
118-
begin match Client.VDI.destroy rpc ~task ~sr ~vdi:vdi_info'.vdi with
119+
begin match Client.VDI.destroy ~task ~sr ~vdi:vdi_info'.vdi with
119120
| Success Unit -> ()
120121
| x -> failwith (Printf.sprintf "Unexpected result: %s\n" (string_of_result x))
121122
end;
@@ -125,18 +126,18 @@ let test_create_destroy sr _ =
125126
end
126127

127128
let test_attach_activate sr _ =
128-
let vdi_info = match Client.VDI.create rpc ~task ~sr ~vdi_info:example_vdi_info ~params:[] with
129+
let vdi_info = match Client.VDI.create ~task ~sr ~vdi_info:example_vdi_info ~params:[] with
129130
| Success (Vdi x) -> x
130131
| x -> failwith (Printf.sprintf "Unexpected result: %s\n" (string_of_result x)) in
131132
let dp = "test_attach_activate" in
132-
let (_: string) = match Client.VDI.attach rpc ~task ~sr ~dp ~vdi:vdi_info.vdi ~read_write:true with
133+
let (_: string) = match Client.VDI.attach ~task ~sr ~dp ~vdi:vdi_info.vdi ~read_write:true with
133134
| Success (Params x) -> x
134135
| x -> failwith (Printf.sprintf "Unexpected result: %s\n" (string_of_result x)) in
135-
begin match Client.VDI.activate rpc ~task ~sr ~dp ~vdi:vdi_info.vdi with
136+
begin match Client.VDI.activate ~task ~sr ~dp ~vdi:vdi_info.vdi with
136137
| Success Unit -> ()
137138
| x -> failwith (Printf.sprintf "Unexpected result: %s\n" (string_of_result x))
138139
end;
139-
begin match Client.VDI.destroy rpc ~task ~sr ~vdi:vdi_info.vdi with
140+
begin match Client.VDI.destroy ~task ~sr ~vdi:vdi_info.vdi with
140141
| Success Unit -> ()
141142
| x -> failwith (Printf.sprintf "Unexpected result: %s\n" (string_of_result x))
142143
end

0 commit comments

Comments
 (0)