Skip to content

Commit

Permalink
Kms_test: add ListKeys test
Browse files Browse the repository at this point in the history
  • Loading branch information
zbaylin committed Dec 16, 2021
1 parent 355d1ed commit 953328c
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion libraries/kms/lib_test/aws_kms_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,34 @@ functor
Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err);
false

let suite config = "Test KMS" >::: [ "Sign" >:: sign_test config ]
let list_keys_test config _ =
let request = Aws_kms.Types.ListKeysRequest.make () in
let result =
Runtime.(
un_m
(run_request
~region:config.region
~access_key:config.access_key
~secret_key:config.secret_key
(module ListKeys)
request))
in
"List keys returns successfully"
@?
match result with
| `Ok resp ->
Printf.printf
"%s\n"
(Yojson.Basic.to_string
Types.ListKeysResponse.(to_json (of_json (to_json resp))));
true
| `Error err ->
Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err);
false

let suite config =
"Test KMS"
>::: [ "Sign" >:: sign_test config; "ListKeys" >:: list_keys_test config ]

let () =
let access_key =
Expand Down

0 comments on commit 953328c

Please sign in to comment.