summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-03-10 16:40:26 -0700
committerTim Smith <tsmith84@gmail.com>2020-03-10 16:40:26 -0700
commitf8371b71f91d6311c1a1dafb6f5f9d87871e0cee (patch)
tree648777b21f386ac93f9487c2745158163984e900
parentc03bda633b91e15c2f2dcbf6515a532401984ff7 (diff)
downloadchef-f8371b71f91d6311c1a1dafb6f5f9d87871e0cee.tar.gz
Exercise the helper even if we can't load a value
We're not authorized to fetch it, but we can exercise the code path Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb b/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb
index 407a54cd73..4af3c64697 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb
@@ -30,3 +30,14 @@ chef_vault_secret "super_secret_2" do
raw_data("auth" => "4321")
admins "bob_bobberson"
end
+
+ruby_block "load vault item" do
+ block do
+ begin
+ chef_vault_item("creds", "super_secret_1")
+ rescue ChefVault::Exceptions::SecretDecryption
+ puts "Not authorized for this key!"
+ end
+ end
+ action :run
+end