mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
credential/app-id: Test DeleteOperation
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user