From 727a66b378641c4a0cae15d4c8ca97c5dd12a5ab Mon Sep 17 00:00:00 2001 From: vishalnayak Date: Wed, 6 Apr 2016 20:59:05 -0400 Subject: [PATCH] Add existence check verification to config/client testcase --- builtin/credential/aws/backend_test.go | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/builtin/credential/aws/backend_test.go b/builtin/credential/aws/backend_test.go index 10151dc680..de9f6e9112 100644 --- a/builtin/credential/aws/backend_test.go +++ b/builtin/credential/aws/backend_test.go @@ -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{ Operation: logical.UpdateOperation, Path: "config/client", @@ -92,6 +107,21 @@ func TestBackend_ConfigClient(t *testing.T) { 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) if err != nil { 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) { config := logical.TestBackendConfig() storage := &logical.InmemStorage{}