mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-14 18:47:01 +02:00
Add existence check verification to config/client testcase
This commit is contained in:
parent
b954f6d9b0
commit
727a66b378
@ -81,6 +81,21 @@ func TestBackend_ConfigClient(t *testing.T) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
checkFound, exists, err := b.HandleExistenceCheck(&logical.Request{
|
||||||
|
Operation: logical.CreateOperation,
|
||||||
|
Path: "config/client",
|
||||||
|
Storage: storage,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if !checkFound {
|
||||||
|
t.Fatal("existence check not found for path 'config/client'")
|
||||||
|
}
|
||||||
|
if exists {
|
||||||
|
t.Fatal("existence check should have return 'false' for 'config/client'")
|
||||||
|
}
|
||||||
|
|
||||||
configClientCreateRequest := &logical.Request{
|
configClientCreateRequest := &logical.Request{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "config/client",
|
Path: "config/client",
|
||||||
@ -92,6 +107,21 @@ func TestBackend_ConfigClient(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkFound, exists, err = b.HandleExistenceCheck(&logical.Request{
|
||||||
|
Operation: logical.CreateOperation,
|
||||||
|
Path: "config/client",
|
||||||
|
Storage: storage,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if !checkFound {
|
||||||
|
t.Fatal("existence check not found for path 'config/client'")
|
||||||
|
}
|
||||||
|
if !exists {
|
||||||
|
t.Fatal("existence check should have return 'true' for 'config/client'")
|
||||||
|
}
|
||||||
|
|
||||||
clientConfig, err := clientConfigEntry(storage)
|
clientConfig, err := clientConfigEntry(storage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -103,6 +133,9 @@ func TestBackend_ConfigClient(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBackend_PathConfigCertificate(t *testing.T) {
|
||||||
|
}
|
||||||
|
|
||||||
func TestBackend_PathImage(t *testing.T) {
|
func TestBackend_PathImage(t *testing.T) {
|
||||||
config := logical.TestBackendConfig()
|
config := logical.TestBackendConfig()
|
||||||
storage := &logical.InmemStorage{}
|
storage := &logical.InmemStorage{}
|
||||||
|
Loading…
Reference in New Issue
Block a user