Skip to content

Commit

Permalink
add test checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Mar 26, 2024
1 parent d9a48cc commit 8d12742
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vault/data_source_namespaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ func TestAccDataSourceNamespaces(t *testing.T) {
resource.TestCheckTypeSetElemAttr(resourceName+".test", consts.FieldPaths+".*", "test-0"),
resource.TestCheckTypeSetElemAttr(resourceName+".test", consts.FieldPaths+".*", "test-1"),
resource.TestCheckTypeSetElemAttr(resourceName+".test", consts.FieldPaths+".*", "test-2"),

resource.TestCheckResourceAttr(resourceName+".test", consts.FieldNamespace, ns),
// test nested which will not have any namespaces under it
resource.TestCheckResourceAttr(resourceName+".nested", consts.FieldPaths+".#", "0"),
resource.TestCheckResourceAttr(resourceName+".nested", consts.FieldNamespace, ns+"/test-0/nested"),
),
},
},
Expand All @@ -51,6 +53,7 @@ resource "vault_namespace" "test" {
path = "test-${count.index}"
}
# this will create a namespace with the path "test/test-0/nested"
resource "vault_namespace" "nested" {
namespace = vault_namespace.test[0].path_fq
path = "nested"
Expand Down

0 comments on commit 8d12742

Please sign in to comment.