Remove sync TO folder for unison prior to setting up cron

This commit is contained in:
Mitchell Hashimoto 2010-06-22 23:42:45 -07:00
parent 97f82d7140
commit 03262b0a04
2 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,8 @@ module Vagrant
:options => config.unison.options, :options => config.unison.options,
:script => config.unison.script, :script => config.unison.script,
:log_file => (config.unison.log_file % sanitized_string)) :log_file => (config.unison.log_file % sanitized_string))
ssh.exec!("sudo rm -rf #{opts[:original][:guestpath]}")
ssh.exec!("sudo echo \"#{crontab_entry}\" >> #{config.unison.crontab_entry_file}") ssh.exec!("sudo echo \"#{crontab_entry}\" >> #{config.unison.crontab_entry_file}")
ssh.exec!("crontab #{config.unison.crontab_entry_file}") ssh.exec!("crontab #{config.unison.crontab_entry_file}")
end end

View File

@ -92,6 +92,11 @@ class LinuxSystemTest < Test::Unit::TestCase
@instance.create_unison(@ssh, @options) @instance.create_unison(@ssh, @options)
end end
should "remove the original guestpath" do
@ssh.expects(:exec!).with("sudo rm -rf #{@options[:original][:guestpath]}")
@instance.create_unison(@ssh, @options)
end
should "enable the crontab file" do should "enable the crontab file" do
@ssh.expects(:exec!).with("crontab #{@mock_env.config.unison.crontab_entry_file}") @ssh.expects(:exec!).with("crontab #{@mock_env.config.unison.crontab_entry_file}")
@instance.create_unison(@ssh, @options) @instance.create_unison(@ssh, @options)