summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnehaldwivedi <sdwivedi@msystechnologies.com>2021-11-02 00:01:56 -0700
committersnehaldwivedi <sdwivedi@msystechnologies.com>2021-11-02 00:01:56 -0700
commitb16cc94f174fa01c4813038497f8b50a51f1db48 (patch)
tree049f68a7aa9abae555ed17f31fd30d0ffe65ce47
parent3a4fc1dad717951a06b3bfd02a070582917f6a41 (diff)
downloadchef-snehal/chef_client_validation_key_fix.tar.gz
-rw-r--r--spec/integration/client/client_spec.rb2
-rw-r--r--spec/unit/application/base_spec.rb8
2 files changed, 7 insertions, 3 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 50fe825a48..adcffec715 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -74,7 +74,7 @@ describe "chef-client" do
shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -K #{@path} ", cwd: chef_dir)
end
- it "should find validation.pem successfully in /etc/chef/ directory" do
+ it "should find validation.pem successfully in default directory" do
shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" ", cwd: chef_dir)
end
end
diff --git a/spec/unit/application/base_spec.rb b/spec/unit/application/base_spec.rb
index a3a794871d..ce90464603 100644
--- a/spec/unit/application/base_spec.rb
+++ b/spec/unit/application/base_spec.rb
@@ -29,8 +29,12 @@ describe Chef::Application::Base, "setup_application" do
end
context "when validation key is not supplied" do
- it "should return full path for validation_key" do
- expect(Chef::Config.validation_key).to eql("/etc/chef/validation.pem")
+ it "should return default path for validation_key" do
+ if windows?
+ expect(Chef::Config.validation_key).to eql("C:\\chef\\validation.pem")
+ else
+ expect(Chef::Config.validation_key).to eql("/etc/chef/validation.pem")
+ end
end
end
end