renamed crontab entry template, switched to proper ssh

This commit is contained in:
John Bender 2010-05-19 00:19:32 -07:00
parent 712aa9cc68
commit af07bd0d3b
5 changed files with 13 additions and 9 deletions

View File

@ -64,7 +64,7 @@ module Vagrant
def prepare_rsync(ssh)
logger.info "Preparing system for rsync..."
vm.env.ssh.upload!(StringIO.new(render_rsync), config.vm.rsync_script)
vm.ssh.upload!(StringIO.new(render_rsync), config.vm.rsync_script)
ssh.exec!("sudo chmod +x #{config.vm.rsync_script}")
ssh.exec!("sudo rm #{config.vm.rsync_crontab_entry_file}")
end
@ -107,7 +107,7 @@ module Vagrant
end
def render_crontab_entry(opts)
TemplateRenderer.render('crontab-entry', opts)
TemplateRenderer.render('crontab_entry', opts)
end
end
end

View File

@ -104,7 +104,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase
setup do
@folders = stub_shared_folders
@ssh = mock("ssh")
@runner.env.ssh.stubs(:execute).yields(@ssh)
@runner.ssh.stubs(:execute).yields(@ssh)
@runner.system.stubs(:mount_shared_folder)
end
@ -122,7 +122,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase
@folders.each do |name, hostpath, guestpath, rsyncd|
@runner.system.expects(:create_rsync).with(@ssh, :rsyncpath => rsyncd, :guestpath => guestpath)
end
@runner.ssh.expects(:execute).yields(ssh)
@runner.ssh.expects(:execute).yields(@ssh)
@action.after_boot
end

View File

@ -46,12 +46,12 @@ class LinuxSystemTest < Test::Unit::TestCase
context "preparing rsync" do
setup do
@ssh.stubs(:exec!)
@vm.env.stubs(:ssh).returns(@ssh)
@vm.env.ssh.stubs(:upload!)
@vm.stubs(:ssh).returns(@ssh)
@vm.ssh.stubs(:upload!)
end
should "upload the rsync template" do
@vm.env.ssh.expects(:upload!).with do |string_io, guest_path|
@vm.ssh.expects(:upload!).with do |string_io, guest_path|
string_io.string =~ /#!\/bin\/sh/ && guest_path == @mock_env.config.vm.rsync_script
end
@ -97,6 +97,10 @@ class LinuxSystemTest < Test::Unit::TestCase
@instance.expects(:chown).with(@ssh, "foo")
@instance.create_rsync(@ssh, :rsyncpath => "foo")
end
should "return provide a formatted crontab entry that runs every minute" do
assert @instance.render_crontab_entry({}).include?("* * * * *")
end
end
#-------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Mitchell Hashimoto", "John Bender"]
s.date = %q{2010-05-18}
s.date = %q{2010-05-19}
s.default_executable = %q{vagrant}
s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.}
s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"]
@ -101,7 +101,7 @@ Gem::Specification.new do |s|
"templates/Vagrantfile.erb",
"templates/chef_server_client.erb",
"templates/chef_solo_solo.erb",
"templates/crontab-entry.erb",
"templates/crontab_entry.erb",
"templates/package_Vagrantfile.erb",
"templates/rsync.erb",
"templates/ssh_config.erb",