renamed crontab entry template, switched to proper ssh
This commit is contained in:
parent
712aa9cc68
commit
af07bd0d3b
|
@ -64,7 +64,7 @@ module Vagrant
|
||||||
|
|
||||||
def prepare_rsync(ssh)
|
def prepare_rsync(ssh)
|
||||||
logger.info "Preparing system for rsync..."
|
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 chmod +x #{config.vm.rsync_script}")
|
||||||
ssh.exec!("sudo rm #{config.vm.rsync_crontab_entry_file}")
|
ssh.exec!("sudo rm #{config.vm.rsync_crontab_entry_file}")
|
||||||
end
|
end
|
||||||
|
@ -107,7 +107,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_crontab_entry(opts)
|
def render_crontab_entry(opts)
|
||||||
TemplateRenderer.render('crontab-entry', opts)
|
TemplateRenderer.render('crontab_entry', opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,7 +104,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
@folders = stub_shared_folders
|
@folders = stub_shared_folders
|
||||||
@ssh = mock("ssh")
|
@ssh = mock("ssh")
|
||||||
@runner.env.ssh.stubs(:execute).yields(@ssh)
|
@runner.ssh.stubs(:execute).yields(@ssh)
|
||||||
@runner.system.stubs(:mount_shared_folder)
|
@runner.system.stubs(:mount_shared_folder)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase
|
||||||
@folders.each do |name, hostpath, guestpath, rsyncd|
|
@folders.each do |name, hostpath, guestpath, rsyncd|
|
||||||
@runner.system.expects(:create_rsync).with(@ssh, :rsyncpath => rsyncd, :guestpath => guestpath)
|
@runner.system.expects(:create_rsync).with(@ssh, :rsyncpath => rsyncd, :guestpath => guestpath)
|
||||||
end
|
end
|
||||||
@runner.ssh.expects(:execute).yields(ssh)
|
@runner.ssh.expects(:execute).yields(@ssh)
|
||||||
|
|
||||||
@action.after_boot
|
@action.after_boot
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,12 +46,12 @@ class LinuxSystemTest < Test::Unit::TestCase
|
||||||
context "preparing rsync" do
|
context "preparing rsync" do
|
||||||
setup do
|
setup do
|
||||||
@ssh.stubs(:exec!)
|
@ssh.stubs(:exec!)
|
||||||
@vm.env.stubs(:ssh).returns(@ssh)
|
@vm.stubs(:ssh).returns(@ssh)
|
||||||
@vm.env.ssh.stubs(:upload!)
|
@vm.ssh.stubs(:upload!)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "upload the rsync template" do
|
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
|
string_io.string =~ /#!\/bin\/sh/ && guest_path == @mock_env.config.vm.rsync_script
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -97,6 +97,10 @@ class LinuxSystemTest < Test::Unit::TestCase
|
||||||
@instance.expects(:chown).with(@ssh, "foo")
|
@instance.expects(:chown).with(@ssh, "foo")
|
||||||
@instance.create_rsync(@ssh, :rsyncpath => "foo")
|
@instance.create_rsync(@ssh, :rsyncpath => "foo")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "return provide a formatted crontab entry that runs every minute" do
|
||||||
|
assert @instance.render_crontab_entry({}).include?("* * * * *")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
@ -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.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
||||||
s.authors = ["Mitchell Hashimoto", "John Bender"]
|
s.authors = ["Mitchell Hashimoto", "John Bender"]
|
||||||
s.date = %q{2010-05-18}
|
s.date = %q{2010-05-19}
|
||||||
s.default_executable = %q{vagrant}
|
s.default_executable = %q{vagrant}
|
||||||
s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.}
|
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"]
|
s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"]
|
||||||
|
@ -101,7 +101,7 @@ Gem::Specification.new do |s|
|
||||||
"templates/Vagrantfile.erb",
|
"templates/Vagrantfile.erb",
|
||||||
"templates/chef_server_client.erb",
|
"templates/chef_server_client.erb",
|
||||||
"templates/chef_solo_solo.erb",
|
"templates/chef_solo_solo.erb",
|
||||||
"templates/crontab-entry.erb",
|
"templates/crontab_entry.erb",
|
||||||
"templates/package_Vagrantfile.erb",
|
"templates/package_Vagrantfile.erb",
|
||||||
"templates/rsync.erb",
|
"templates/rsync.erb",
|
||||||
"templates/ssh_config.erb",
|
"templates/ssh_config.erb",
|
||||||
|
|
Loading…
Reference in New Issue