From 227822c9134d3411a65f2e63c4368d9f9c091762 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 7 Mar 2017 13:29:20 -0800 Subject: 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 --- spec/functional/knife/ssh_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/functional/knife') 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 () -# 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 -- cgit v1.2.1