@@ -216,6 +216,7 @@ mod test {
216216 test_utils:: { test_delete_api, test_mount_auth_api, test_read_api, test_rusty_vault_init, test_write_api} ,
217217 } ;
218218
219+ #[ maybe_async:: maybe_async]
219220 pub async fn test_read_role (
220221 core : & Core ,
221222 token : & str ,
@@ -227,6 +228,7 @@ mod test {
227228 resp
228229 }
229230
231+ #[ maybe_async:: maybe_async]
230232 pub async fn test_write_role (
231233 core : & Core ,
232234 token : & str ,
@@ -257,12 +259,13 @@ mod test {
257259 . await ;
258260 }
259261
262+ #[ maybe_async:: maybe_async]
260263 pub async fn test_delete_role ( core : & Core , token : & str , path : & str , role_name : & str ) {
261- assert ! ( test_delete_api( core, token, format!( "auth/{}/role/{}" , path, role_name) . as_str( ) , true , None )
262- . await
263- . is_ok( ) ) ;
264+ let resp = test_delete_api ( core, token, format ! ( "auth/{}/role/{}" , path, role_name) . as_str ( ) , true , None ) . await ;
265+ assert ! ( resp. is_ok( ) ) ;
264266 }
265267
268+ #[ maybe_async:: maybe_async]
266269 pub async fn generate_secret_id ( core : & Core , token : & str , path : & str , role_name : & str ) -> ( String , String ) {
267270 let resp =
268271 test_write_api ( core, token, format ! ( "auth/{}/role/{}/secret-id" , path, role_name) . as_str ( ) , true , None )
@@ -275,6 +278,7 @@ mod test {
275278 ( secret_id. to_string ( ) , secret_id_accessor. to_string ( ) )
276279 }
277280
281+ #[ maybe_async:: maybe_async]
278282 pub async fn test_login (
279283 core : & Core ,
280284 path : & str ,
@@ -308,6 +312,7 @@ mod test {
308312 resp
309313 }
310314
315+ #[ maybe_async:: maybe_async]
311316 async fn test_approle ( core : & Core , token : & str , path : & str , role_name : & str ) {
312317 // Create a role
313318 let resp = test_write_api ( core, token, format ! ( "auth/{}/role/{}" , path, role_name) . as_str ( ) , true , None ) . await ;
@@ -460,6 +465,7 @@ mod test {
460465 let _ = test_login ( core, path, role_id, & secret_id, false ) . await ;
461466 }
462467
468+ #[ maybe_async:: maybe_async]
463469 async fn test_approle_role_service ( core : & Core , token : & str , path : & str , role_name : & str ) {
464470 // Create a role
465471 let mut data = json ! ( {
@@ -549,7 +555,7 @@ mod test {
549555 println ! ( "resp_data: {:?}" , resp_data) ;
550556 }
551557
552- #[ tokio:: test]
558+ #[ maybe_async :: test ( feature = "sync_handler" , async ( all ( not ( feature = "sync_handler" ) ) , tokio:: test) ) ]
553559 async fn test_credential_approle_module ( ) {
554560 let ( root_token, core) = test_rusty_vault_init ( "test_approle_module" ) ;
555561 let core = core. read ( ) . unwrap ( ) ;
0 commit comments