Skip to content

Commit

Permalink
make format
Browse files Browse the repository at this point in the history
Signed-off-by: BenjiReis <[email protected]>
  • Loading branch information
benjamreis committed Jul 18, 2023
1 parent af49756 commit fe4acf8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
27 changes: 14 additions & 13 deletions ocaml/quicktest/qt_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,20 @@ module SR = struct
~self:pool
)
()
else if !A.sr <> "" then
let sr =
Client.Client.SR.get_by_uuid ~rpc:!A.rpc ~session_id:!session_id ~uuid:!A.sr
in
let local_srs =
list_srs_connected_to_localhost !A.rpc !session_id
|> List.map (fun sr_info -> sr_info.Qt.sr)
in
if not (List.mem sr local_srs) then (
failwith (Printf.sprintf "Specified sr %s is not available on the host" !A.sr) ;
) ;
only sr ()
else
else if !A.sr <> "" then (
let sr =
Client.Client.SR.get_by_uuid ~rpc:!A.rpc ~session_id:!session_id
~uuid:!A.sr
in
let local_srs =
list_srs_connected_to_localhost !A.rpc !session_id
|> List.map (fun sr_info -> sr_info.Qt.sr)
in
if not (List.mem sr local_srs) then
failwith
(Printf.sprintf "Specified sr %s is not available on the host" !A.sr) ;
only sr ()
) else
Lazy.force all_srs

let random srs () =
Expand Down
14 changes: 9 additions & 5 deletions ocaml/quicktest/quicktest_args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ let parse () =
)
; ( "-default-sr"
, Arg.Unit (fun () -> use_default_sr := true)
, "Only run SR tests on the pool's default SR, mutually exclusive with -sr"
, "Only run SR tests on the pool's default SR, mutually exclusive with \
-sr"
)
; ("-nocolour", Arg.Clear use_colour, "Don't use colour in the output")
; ("-sr", Arg.String (fun x -> sr := x), "Only run SR tests on the specified SR, mutually exclusive with -default-sr")
; ( "-sr"
, Arg.String (fun x -> sr := x)
, "Only run SR tests on the specified SR, mutually exclusive with \
-default-sr"
)
]
(fun x ->
match (!host, !username, !password) with
Expand All @@ -68,9 +73,8 @@ let parse () =
"Perform some quick functional tests. The default is to test localhost \
over a Unix socket. For remote server supply <hostname> <username> and \
<password> arguments." ;
if !use_default_sr && !sr <> "" then (
raise (Arg.Bad "-default-sr and -sr are mutually exclusive")
) ;
if !use_default_sr && !sr <> "" then
raise (Arg.Bad "-default-sr and -sr are mutually exclusive") ;
if !host = "" then host := "localhost" ;
if !username = "" then username := "root"

Expand Down

0 comments on commit fe4acf8

Please sign in to comment.