diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-07 13:29:20 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-07 13:29:20 -0800 |
commit | 227822c9134d3411a65f2e63c4368d9f9c091762 (patch) | |
tree | 350f64b52996d1eaab49fefdd9f5eb175c2f6a47 /spec/functional/knife/ssh_spec.rb | |
parent | aa16a9832c4c3d138cd43bbaadeccf1147834601 (diff) | |
download | chef-227822c9134d3411a65f2e63c4368d9f9c091762.tar.gz |
fix spec for solaris 10
this only affects tests running as root on old solaris because ENV['HOME'] for
root is "/" there and that causes a "/.ssh" vs "//.ssh" error if we don't
File.expand_path in both the code and the spec.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional/knife/ssh_spec.rb')
-rw-r--r-- | spec/functional/knife/ssh_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb index cfe28b862f..0de344f24e 100644 --- a/spec/functional/knife/ssh_spec.rb +++ b/spec/functional/knife/ssh_spec.rb @@ -1,6 +1,6 @@ # # Author:: Daniel DeLeo (<dan@chef.io>) -# Copyright:: Copyright 2010-2016, Chef Software Inc. +# Copyright:: Copyright 2010-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -254,7 +254,7 @@ describe Chef::Knife::Ssh do end it "uses the ssh_gateway_identity file" do - expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => "#{ENV['HOME']}/.ssh/aws-gateway.rsa", :keys_only => true }) + expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => File.expand_path("#{ENV['HOME']}/.ssh/aws-gateway.rsa"), :keys_only => true }) @knife.run expect(@knife.config[:ssh_gateway_identity]).to eq("~/.ssh/aws-gateway.rsa") end @@ -268,7 +268,7 @@ describe Chef::Knife::Ssh do end it "uses the ssh_gateway_identity file" do - expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => "#{ENV['HOME']}/.ssh/aws-gateway.rsa", :keys_only => true }) + expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => File.expand_path("#{ENV['HOME']}/.ssh/aws-gateway.rsa"), :keys_only => true }) @knife.run expect(@knife.config[:ssh_gateway_identity]).to eq("~/.ssh/aws-gateway.rsa") end |