Added spec to test the ssh key file permission changing.

This commit is contained in:
Sean Wolfe 2012-05-01 14:05:22 -07:00
parent e10e8aae86
commit 024f492cb3
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
require File.expand_path("../../base", __FILE__)
describe Vagrant::SSH do
context "check_key_permissions" do
let(:key_path) { File.expand_path("../id_rsa", __FILE__) }
let(:ssh_instance) { Vagrant::SSH.new(double) }
before(:each) do
File.open(key_path, 'w') do |file|
file.write("hello!")
end
File.chmod(644, key_path)
end
after(:each) do
FileUtils.rm(key_path)
end
it "should not raise an exception if we set a keyfile permission correctly" do
ssh_instance.check_key_permissions(key_path)
end
end
end