File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 6464 rresult
6565 x509
6666 xapi-consts
67+ xapi-datamodel
6768 xapi-stdext-unix
6869 )
6970 (deps
Original file line number Diff line number Diff line change @@ -179,11 +179,20 @@ let test_valid_leaf_cert pem_leaf time pkey () =
179179 match validate_pem_chain ~pem_leaf ~pem_chain: None time pkey with
180180 | Ok _ ->
181181 ()
182- | Error (`Msg (_ , msg )) ->
182+ | Error (`Msg err ) ->
183+ let err_to_str (name , params ) =
184+ let Datamodel_types. {err_doc; err_params; _} =
185+ Hashtbl. find Datamodel_errors. errors name
186+ in
187+ let args = List. combine err_params params in
188+ Format. asprintf " %s %a" err_doc
189+ Fmt. (Dump. list (pair ~sep: (Fmt. any " :@ " ) string string ))
190+ args
191+ in
183192 Alcotest. fail
184193 (Format. asprintf " Valid certificate could not be validated: %a"
185- Fmt. ( Dump. list string )
186- msg
194+ ( Fmt. of_to_string err_to_str )
195+ err
187196 )
188197
189198let test_invalid_cert pem_leaf time pkey error reason =
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ unixgetenv () {
110110}
111111
112112hashtblfind () {
113- N=34
113+ N=35
114114 # Looks for all .ml files except the ones using Core.Hashtbl.find,
115115 # which already returns Option
116116 HASHTBLFIND=$( git grep -P -r --count ' Hashtbl.find(?!_opt)' -- ' **/*.ml' ' :!ocaml/xapi-storage-script/main.ml' | cut -d ' :' -f 2 | paste -sd+ - | bc)
You can’t perform that action at this time.
0 commit comments