mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-14 20:04:13 -04:00
credential/app-id: Test DeleteOperation
This commit is contained in:
parent
31d7426863
commit
a4f9bacb28
1 changed files with 26 additions and 0 deletions
|
|
@ -15,6 +15,8 @@ func TestBackend_basic(t *testing.T) {
|
|||
testAccStepMapUserId(t),
|
||||
testAccLogin(t, ""),
|
||||
testAccLoginInvalid(t),
|
||||
testAccStepDeleteUserId(t),
|
||||
testAccLoginDeleted(t),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
@ -40,6 +42,8 @@ func TestBackend_displayName(t *testing.T) {
|
|||
testAccStepMapUserId(t),
|
||||
testAccLogin(t, "tubbin"),
|
||||
testAccLoginInvalid(t),
|
||||
testAccStepDeleteUserId(t),
|
||||
testAccLoginDeleted(t),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
@ -75,6 +79,13 @@ func testAccStepMapUserId(t *testing.T) logicaltest.TestStep {
|
|||
}
|
||||
}
|
||||
|
||||
func testAccStepDeleteUserId(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.DeleteOperation,
|
||||
Path: "map/user-id/42",
|
||||
}
|
||||
}
|
||||
|
||||
func testAccStepMapUserIdCidr(t *testing.T, cidr string) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
|
|
@ -138,3 +149,18 @@ func testAccLoginInvalid(t *testing.T) logicaltest.TestStep {
|
|||
Check: logicaltest.TestCheckError(),
|
||||
}
|
||||
}
|
||||
|
||||
func testAccLoginDeleted(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
Path: "login",
|
||||
Data: map[string]interface{}{
|
||||
"app_id": "foo",
|
||||
"user_id": "42",
|
||||
},
|
||||
ErrorOk: true,
|
||||
Unauthenticated: true,
|
||||
|
||||
Check: logicaltest.TestCheckError(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue