Skip to content

Commit

Permalink
add unit tests to handle mutual exclusion (#22352)
Browse files Browse the repository at this point in the history
* add unit tests to handle mutual exclusion

* revert rotation_test.go and add missing test case to path_roles_test.go
  • Loading branch information
Zlaticanin committed Aug 22, 2023
1 parent 6aedaaf commit 7a542fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions builtin/logical/database/path_roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ func TestBackend_StaticRole_Config(t *testing.T) {
path: "plugin-role-test",
err: errors.New("one of rotation_schedule or rotation_period must be provided to create a static account"),
},
"rotation_period with rotation_schedule": {
account: map[string]interface{}{
"username": dbUser,
"rotation_period": "5400s",
"rotation_schedule": "* * * * *",
},
path: "plugin-role-test",
err: errors.New("mutually exclusive fields rotation_period and rotation_schedule were both specified; only one of them can be provided"),
},
"rotation window invalid with rotation_period": {
account: map[string]interface{}{
"username": dbUser,
Expand Down

0 comments on commit 7a542fc

Please sign in to comment.