@@ -216,12 +216,19 @@ mod test {
216
216
test_utils:: { test_delete_api, test_mount_auth_api, test_read_api, test_rusty_vault_init, test_write_api} ,
217
217
} ;
218
218
219
- pub async fn test_read_role ( core : & Core , token : & str , path : & str , role_name : & str ) -> Result < Option < Response > , RvError > {
219
+ #[ maybe_async:: maybe_async]
220
+ pub async fn test_read_role (
221
+ core : & Core ,
222
+ token : & str ,
223
+ path : & str ,
224
+ role_name : & str ,
225
+ ) -> Result < Option < Response > , RvError > {
220
226
let resp = test_read_api ( core, token, format ! ( "auth/{}/role/{}" , path, role_name) . as_str ( ) , true ) . await ;
221
227
assert ! ( resp. is_ok( ) ) ;
222
228
resp
223
229
}
224
230
231
+ #[ maybe_async:: maybe_async]
225
232
pub async fn test_write_role (
226
233
core : & Core ,
227
234
token : & str ,
@@ -251,10 +258,13 @@ mod test {
251
258
test_write_api ( core, token, format ! ( "auth/{}/role/{}" , path, role_name) . as_str ( ) , expect, Some ( role_data) ) . await ;
252
259
}
253
260
261
+ #[ maybe_async:: maybe_async]
254
262
pub async fn test_delete_role ( core : & Core , token : & str , path : & str , role_name : & str ) {
255
- assert ! ( test_delete_api( core, token, format!( "auth/{}/role/{}" , path, role_name) . as_str( ) , true , None ) . await . is_ok( ) ) ;
263
+ let resp = test_delete_api ( core, token, format ! ( "auth/{}/role/{}" , path, role_name) . as_str ( ) , true , None ) . await ;
264
+ assert ! ( resp. is_ok( ) ) ;
256
265
}
257
266
267
+ #[ maybe_async:: maybe_async]
258
268
pub async fn generate_secret_id ( core : & Core , token : & str , path : & str , role_name : & str ) -> ( String , String ) {
259
269
let resp =
260
270
test_write_api ( core, token, format ! ( "auth/{}/role/{}/secret-id" , path, role_name) . as_str ( ) , true , None ) . await ;
@@ -266,6 +276,7 @@ mod test {
266
276
( secret_id. to_string ( ) , secret_id_accessor. to_string ( ) )
267
277
}
268
278
279
+ #[ maybe_async:: maybe_async]
269
280
pub async fn test_login (
270
281
core : & Core ,
271
282
path : & str ,
@@ -299,6 +310,7 @@ mod test {
299
310
resp
300
311
}
301
312
313
+ #[ maybe_async:: maybe_async]
302
314
async fn test_approle ( core : & Core , token : & str , path : & str , role_name : & str ) {
303
315
// Create a role
304
316
let resp = test_write_api ( core, token, format ! ( "auth/{}/role/{}" , path, role_name) . as_str ( ) , true , None ) . await ;
@@ -446,6 +458,7 @@ mod test {
446
458
let _ = test_login ( core, path, role_id, & secret_id, false ) . await ;
447
459
}
448
460
461
+ #[ maybe_async:: maybe_async]
449
462
async fn test_approle_role_service ( core : & Core , token : & str , path : & str , role_name : & str ) {
450
463
// Create a role
451
464
let mut data = json ! ( {
@@ -533,7 +546,7 @@ mod test {
533
546
println ! ( "resp_data: {:?}" , resp_data) ;
534
547
}
535
548
536
- #[ tokio:: test]
549
+ #[ maybe_async :: test ( feature = "sync_handler" , async ( all ( not ( feature = "sync_handler" ) ) , tokio:: test) ) ]
537
550
async fn test_credential_approle_module ( ) {
538
551
let ( root_token, core) = test_rusty_vault_init ( "test_approle_module" ) ;
539
552
let core = core. read ( ) . unwrap ( ) ;
0 commit comments