File tree 3 files changed +14
-4
lines changed
3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 64
64
rresult
65
65
x509
66
66
xapi-consts
67
+ xapi-datamodel
67
68
xapi-stdext-unix
68
69
)
69
70
(deps
Original file line number Diff line number Diff line change @@ -179,11 +179,20 @@ let test_valid_leaf_cert pem_leaf time pkey () =
179
179
match validate_pem_chain ~pem_leaf ~pem_chain: None time pkey with
180
180
| Ok _ ->
181
181
()
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
183
192
Alcotest. fail
184
193
(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
187
196
)
188
197
189
198
let test_invalid_cert pem_leaf time pkey error reason =
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ unixgetenv () {
110
110
}
111
111
112
112
hashtblfind () {
113
- N=34
113
+ N=35
114
114
# Looks for all .ml files except the ones using Core.Hashtbl.find,
115
115
# which already returns Option
116
116
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