backup 3.0.19 → 3.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +9 -8
- data/Gemfile.lock +19 -1
- data/Guardfile +13 -9
- data/README.md +93 -31
- data/backup.gemspec +3 -3
- data/bin/backup +6 -283
- data/lib/backup.rb +101 -72
- data/lib/backup/archive.rb +21 -9
- data/lib/backup/binder.rb +22 -0
- data/lib/backup/cleaner.rb +36 -0
- data/lib/backup/cli/helpers.rb +103 -0
- data/lib/backup/cli/utility.rb +308 -0
- data/lib/backup/compressor/base.rb +2 -2
- data/lib/backup/compressor/pbzip2.rb +76 -0
- data/lib/backup/configuration/compressor/pbzip2.rb +28 -0
- data/lib/backup/configuration/database/riak.rb +25 -0
- data/lib/backup/configuration/encryptor/open_ssl.rb +6 -0
- data/lib/backup/configuration/helpers.rb +5 -18
- data/lib/backup/configuration/notifier/base.rb +13 -0
- data/lib/backup/configuration/notifier/hipchat.rb +41 -0
- data/lib/backup/configuration/notifier/mail.rb +38 -0
- data/lib/backup/configuration/notifier/prowl.rb +23 -0
- data/lib/backup/configuration/storage/cloudfiles.rb +4 -0
- data/lib/backup/configuration/storage/dropbox.rb +8 -4
- data/lib/backup/database/base.rb +10 -2
- data/lib/backup/database/mongodb.rb +16 -19
- data/lib/backup/database/mysql.rb +2 -2
- data/lib/backup/database/postgresql.rb +2 -2
- data/lib/backup/database/redis.rb +15 -7
- data/lib/backup/database/riak.rb +45 -0
- data/lib/backup/dependency.rb +21 -7
- data/lib/backup/encryptor/base.rb +1 -1
- data/lib/backup/encryptor/open_ssl.rb +20 -5
- data/lib/backup/errors.rb +124 -0
- data/lib/backup/finder.rb +11 -3
- data/lib/backup/logger.rb +121 -82
- data/lib/backup/model.rb +103 -44
- data/lib/backup/notifier/base.rb +50 -0
- data/lib/backup/notifier/campfire.rb +32 -52
- data/lib/backup/notifier/hipchat.rb +99 -0
- data/lib/backup/notifier/mail.rb +100 -61
- data/lib/backup/notifier/presently.rb +31 -40
- data/lib/backup/notifier/prowl.rb +73 -0
- data/lib/backup/notifier/twitter.rb +29 -39
- data/lib/backup/packager.rb +25 -0
- data/lib/backup/splitter.rb +62 -0
- data/lib/backup/storage/base.rb +178 -18
- data/lib/backup/storage/cloudfiles.rb +34 -28
- data/lib/backup/storage/dropbox.rb +64 -67
- data/lib/backup/storage/ftp.rb +48 -40
- data/lib/backup/storage/local.rb +33 -28
- data/lib/backup/storage/ninefold.rb +40 -26
- data/lib/backup/storage/object.rb +8 -6
- data/lib/backup/storage/rsync.rb +61 -51
- data/lib/backup/storage/s3.rb +29 -27
- data/lib/backup/storage/scp.rb +56 -36
- data/lib/backup/storage/sftp.rb +49 -33
- data/lib/backup/syncer/base.rb +1 -1
- data/lib/backup/syncer/rsync.rb +1 -1
- data/lib/backup/template.rb +46 -0
- data/lib/backup/version.rb +1 -1
- data/spec/archive_spec.rb +34 -9
- data/spec/backup_spec.rb +1 -1
- data/spec/cli/helpers_spec.rb +35 -0
- data/spec/cli/utility_spec.rb +38 -0
- data/spec/compressor/bzip2_spec.rb +1 -1
- data/spec/compressor/gzip_spec.rb +1 -1
- data/spec/compressor/lzma_spec.rb +1 -1
- data/spec/compressor/pbzip2_spec.rb +63 -0
- data/spec/configuration/base_spec.rb +1 -1
- data/spec/configuration/compressor/bzip2_spec.rb +1 -1
- data/spec/configuration/compressor/gzip_spec.rb +1 -1
- data/spec/configuration/compressor/lzma_spec.rb +1 -1
- data/spec/configuration/database/base_spec.rb +1 -1
- data/spec/configuration/database/mongodb_spec.rb +1 -1
- data/spec/configuration/database/mysql_spec.rb +1 -1
- data/spec/configuration/database/postgresql_spec.rb +1 -1
- data/spec/configuration/database/redis_spec.rb +1 -1
- data/spec/configuration/database/riak_spec.rb +31 -0
- data/spec/configuration/encryptor/gpg_spec.rb +1 -1
- data/spec/configuration/encryptor/open_ssl_spec.rb +4 -1
- data/spec/configuration/notifier/campfire_spec.rb +1 -1
- data/spec/configuration/notifier/hipchat_spec.rb +43 -0
- data/spec/configuration/notifier/mail_spec.rb +34 -22
- data/spec/configuration/notifier/presently_spec.rb +1 -1
- data/spec/configuration/notifier/prowl_spec.rb +28 -0
- data/spec/configuration/notifier/twitter_spec.rb +1 -1
- data/spec/configuration/storage/cloudfiles_spec.rb +19 -16
- data/spec/configuration/storage/dropbox_spec.rb +1 -1
- data/spec/configuration/storage/ftp_spec.rb +1 -1
- data/spec/configuration/storage/local_spec.rb +1 -1
- data/spec/configuration/storage/ninefold_spec.rb +1 -1
- data/spec/configuration/storage/rsync_spec.rb +1 -1
- data/spec/configuration/storage/s3_spec.rb +1 -1
- data/spec/configuration/storage/scp_spec.rb +1 -1
- data/spec/configuration/storage/sftp_spec.rb +1 -1
- data/spec/configuration/syncer/rsync_spec.rb +1 -1
- data/spec/configuration/syncer/s3_spec.rb +1 -1
- data/spec/database/base_spec.rb +10 -1
- data/spec/database/mongodb_spec.rb +34 -7
- data/spec/database/mysql_spec.rb +8 -7
- data/spec/database/postgresql_spec.rb +8 -7
- data/spec/database/redis_spec.rb +39 -9
- data/spec/database/riak_spec.rb +50 -0
- data/spec/encryptor/gpg_spec.rb +1 -1
- data/spec/encryptor/open_ssl_spec.rb +77 -20
- data/spec/errors_spec.rb +306 -0
- data/spec/finder_spec.rb +91 -0
- data/spec/logger_spec.rb +254 -33
- data/spec/model_spec.rb +120 -15
- data/spec/notifier/campfire_spec.rb +127 -52
- data/spec/notifier/hipchat_spec.rb +193 -0
- data/spec/notifier/mail_spec.rb +290 -74
- data/spec/notifier/presently_spec.rb +290 -73
- data/spec/notifier/prowl_spec.rb +149 -0
- data/spec/notifier/twitter_spec.rb +106 -41
- data/spec/spec_helper.rb +8 -2
- data/spec/splitter_spec.rb +71 -0
- data/spec/storage/base_spec.rb +280 -19
- data/spec/storage/cloudfiles_spec.rb +38 -22
- data/spec/storage/dropbox_spec.rb +17 -13
- data/spec/storage/ftp_spec.rb +145 -55
- data/spec/storage/local_spec.rb +6 -6
- data/spec/storage/ninefold_spec.rb +70 -29
- data/spec/storage/object_spec.rb +44 -44
- data/spec/storage/rsync_spec.rb +186 -63
- data/spec/storage/s3_spec.rb +23 -24
- data/spec/storage/scp_spec.rb +116 -41
- data/spec/storage/sftp_spec.rb +124 -46
- data/spec/syncer/rsync_spec.rb +3 -3
- data/spec/syncer/s3_spec.rb +1 -1
- data/spec/version_spec.rb +1 -1
- data/templates/cli/utility/archive +13 -0
- data/{lib/templates → templates/cli/utility}/compressor/bzip2 +1 -1
- data/{lib/templates → templates/cli/utility}/compressor/gzip +1 -1
- data/{lib/templates → templates/cli/utility}/compressor/lzma +0 -0
- data/templates/cli/utility/compressor/pbzip2 +7 -0
- data/templates/cli/utility/config +31 -0
- data/{lib/templates → templates/cli/utility}/database/mongodb +1 -1
- data/{lib/templates → templates/cli/utility}/database/mysql +1 -1
- data/{lib/templates → templates/cli/utility}/database/postgresql +1 -1
- data/{lib/templates → templates/cli/utility}/database/redis +1 -1
- data/templates/cli/utility/database/riak +8 -0
- data/{lib/templates → templates/cli/utility}/encryptor/gpg +1 -1
- data/templates/cli/utility/encryptor/openssl +9 -0
- data/templates/cli/utility/model.erb +23 -0
- data/{lib/templates → templates/cli/utility}/notifier/campfire +2 -1
- data/templates/cli/utility/notifier/hipchat +15 -0
- data/{lib/templates → templates/cli/utility}/notifier/mail +6 -1
- data/{lib/templates → templates/cli/utility}/notifier/presently +1 -0
- data/templates/cli/utility/notifier/prowl +11 -0
- data/{lib/templates → templates/cli/utility}/notifier/twitter +2 -1
- data/templates/cli/utility/splitter +7 -0
- data/templates/cli/utility/storage/cloudfiles +12 -0
- data/{lib/templates → templates/cli/utility}/storage/dropbox +1 -1
- data/{lib/templates → templates/cli/utility}/storage/ftp +0 -0
- data/templates/cli/utility/storage/local +7 -0
- data/{lib/templates → templates/cli/utility}/storage/ninefold +1 -1
- data/templates/cli/utility/storage/rsync +11 -0
- data/{lib/templates → templates/cli/utility}/storage/s3 +0 -2
- data/templates/cli/utility/storage/scp +11 -0
- data/templates/cli/utility/storage/sftp +11 -0
- data/{lib/templates → templates/cli/utility}/syncer/rsync +1 -1
- data/{lib/templates → templates/cli/utility}/syncer/s3 +1 -1
- data/templates/general/links +11 -0
- data/templates/general/version.erb +2 -0
- data/templates/notifier/mail/failure.erb +9 -0
- data/templates/notifier/mail/success.erb +7 -0
- data/templates/notifier/mail/warning.erb +9 -0
- data/templates/storage/dropbox/authorization_url.erb +6 -0
- data/templates/storage/dropbox/authorized.erb +4 -0
- data/templates/storage/dropbox/cache_file_written.erb +10 -0
- metadata +81 -45
- data/lib/backup/cli.rb +0 -110
- data/lib/backup/exception/command_failed.rb +0 -8
- data/lib/backup/exception/command_not_found.rb +0 -8
- data/lib/backup/notifier/binder.rb +0 -32
- data/lib/backup/notifier/templates/notify_failure.erb +0 -33
- data/lib/backup/notifier/templates/notify_success.erb +0 -16
- data/lib/templates/archive +0 -7
- data/lib/templates/encryptor/openssl +0 -8
- data/lib/templates/readme +0 -15
- data/lib/templates/storage/cloudfiles +0 -11
- data/lib/templates/storage/local +0 -7
- data/lib/templates/storage/rsync +0 -11
- data/lib/templates/storage/scp +0 -11
- data/lib/templates/storage/sftp +0 -11
data/spec/backup_spec.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::CLI::Helpers do
|
6
|
+
let(:helpers) { Module.new.extend(subject) }
|
7
|
+
|
8
|
+
describe '#raise_if_command_failed!' do
|
9
|
+
|
10
|
+
it 'returns nil if status exit code is in ignore_exit_codes' do
|
11
|
+
process_data = { :status => '3', :ignore_exit_codes => [1,3,5] }
|
12
|
+
helpers.raise_if_command_failed!('foo', process_data).should be_nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'raises an error with stdout/stderr data' do
|
16
|
+
process_data = { :status => '3', :ignore_exit_codes => [2,4,6],
|
17
|
+
:stdout => 'stdout data', :stderr => 'stderr data' }
|
18
|
+
|
19
|
+
expect do
|
20
|
+
helpers.raise_if_command_failed!('utility_name', process_data)
|
21
|
+
end.to raise_error(
|
22
|
+
Backup::Errors::CLI::SystemCallError,
|
23
|
+
"CLI::SystemCallError: Failed to run utility_name on #{RUBY_PLATFORM}\n" +
|
24
|
+
" The following information should help to determine the problem:\n" +
|
25
|
+
" Exit Code: 3\n" +
|
26
|
+
" STDERR:\n" +
|
27
|
+
" stderr data\n" +
|
28
|
+
" STDOUT:\n" +
|
29
|
+
" stdout data"
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe 'Backup::CLI::Utility' do
|
6
|
+
let(:cli) { Backup::CLI::Utility }
|
7
|
+
|
8
|
+
describe '#perform' do
|
9
|
+
|
10
|
+
context 'when errors occur' do
|
11
|
+
|
12
|
+
before do
|
13
|
+
@argv_save = ARGV
|
14
|
+
end
|
15
|
+
|
16
|
+
after do
|
17
|
+
ARGV.replace(@argv_save)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should log the error and exit' do
|
21
|
+
ARGV.replace(['perform', '-t', 'foo'])
|
22
|
+
FileUtils.stubs(:mkdir_p).raises(SystemCallError, 'yikes!')
|
23
|
+
|
24
|
+
Backup::Logger.expects(:error).with do |err|
|
25
|
+
err.message.should ==
|
26
|
+
"CLIError: SystemCallError: unknown error - yikes!"
|
27
|
+
end
|
28
|
+
|
29
|
+
expect do
|
30
|
+
cli.start
|
31
|
+
end.to raise_error(SystemExit)
|
32
|
+
end
|
33
|
+
|
34
|
+
end # context 'when errors occur'
|
35
|
+
|
36
|
+
end # describe '#perform'
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Compressor::Pbzip2 do
|
6
|
+
let(:compressor) { Backup::Compressor::Pbzip2.new }
|
7
|
+
|
8
|
+
before do
|
9
|
+
Backup::Model.extension = 'tar'
|
10
|
+
end
|
11
|
+
|
12
|
+
describe 'the options' do
|
13
|
+
it do
|
14
|
+
compressor.send(:best).should == []
|
15
|
+
end
|
16
|
+
|
17
|
+
it do
|
18
|
+
compressor.send(:fast).should == []
|
19
|
+
end
|
20
|
+
|
21
|
+
it do
|
22
|
+
compressor.send(:processors).should == []
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#perform!' do
|
27
|
+
before do
|
28
|
+
[:run, :utility].each { |method| compressor.stubs(method) }
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should perform the compression' do
|
32
|
+
compressor.expects(:utility).with(:pbzip2).returns(:pbzip2)
|
33
|
+
compressor.expects(:run).with("pbzip2 '#{ File.join(Backup::TMP_PATH, "#{ Backup::TIME }.#{ Backup::TRIGGER }.tar") }'")
|
34
|
+
compressor.perform!
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should perform the compression with the --best, --fast and -p1 options' do
|
38
|
+
compressor = Backup::Compressor::Pbzip2.new do |c|
|
39
|
+
c.best = true
|
40
|
+
c.fast = true
|
41
|
+
c.processors = 1
|
42
|
+
end
|
43
|
+
|
44
|
+
compressor.stubs(:utility).returns(:pbzip2)
|
45
|
+
compressor.expects(:run).with("pbzip2 --best --fast -p1 '#{ File.join(Backup::TMP_PATH, "#{ Backup::TIME }.#{ Backup::TRIGGER }.tar") }'")
|
46
|
+
compressor.perform!
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should set the class variable @extension (Backup::Model.extension) to .bz2' do
|
50
|
+
compressor.stubs(:utility).returns(:pbzip2)
|
51
|
+
compressor.expects(:run)
|
52
|
+
|
53
|
+
Backup::Model.extension.should == 'tar'
|
54
|
+
compressor.perform!
|
55
|
+
Backup::Model.extension.should == 'tar.bz2'
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'should log' do
|
59
|
+
Backup::Logger.expects(:message).with("Backup::Compressor::Pbzip2 started compressing the archive.")
|
60
|
+
compressor.perform!
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Database::Riak do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Database::Riak.defaults do |db|
|
8
|
+
db.name = 'mydb'
|
9
|
+
db.node = '/var/lib/redis/db'
|
10
|
+
db.cookie = 'mypassword'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should set the default Riak configuration' do
|
15
|
+
db = Backup::Configuration::Database::Riak
|
16
|
+
db.name.should == 'mydb'
|
17
|
+
db.node.should == '/var/lib/redis/db'
|
18
|
+
db.cookie.should == 'mypassword'
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#clear_defaults!' do
|
22
|
+
it 'should clear all the defaults, resetting them to nil' do
|
23
|
+
Backup::Configuration::Database::Riak.clear_defaults!
|
24
|
+
|
25
|
+
db = Backup::Configuration::Database::Riak
|
26
|
+
db.name.should == nil
|
27
|
+
db.node.should == nil
|
28
|
+
db.cookie.should == nil
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require File.
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
4
|
|
5
5
|
describe Backup::Configuration::Encryptor::OpenSSL do
|
6
6
|
before do
|
7
7
|
Backup::Configuration::Encryptor::OpenSSL.defaults do |encryptor|
|
8
8
|
encryptor.password = 'my_password'
|
9
|
+
encryptor.password_file = nil
|
9
10
|
encryptor.base64 = true
|
10
11
|
encryptor.salt = true
|
11
12
|
end
|
@@ -14,6 +15,7 @@ describe Backup::Configuration::Encryptor::OpenSSL do
|
|
14
15
|
it 'should set the default encryptor configuration' do
|
15
16
|
encryptor = Backup::Configuration::Encryptor::OpenSSL
|
16
17
|
encryptor.password.should == 'my_password'
|
18
|
+
encryptor.password_file.should == nil
|
17
19
|
encryptor.base64.should == true
|
18
20
|
encryptor.salt.should == true
|
19
21
|
end
|
@@ -24,6 +26,7 @@ describe Backup::Configuration::Encryptor::OpenSSL do
|
|
24
26
|
|
25
27
|
encryptor = Backup::Configuration::Encryptor::OpenSSL
|
26
28
|
encryptor.password.should == nil
|
29
|
+
encryptor.password_file.should == nil
|
27
30
|
encryptor.base64.should == nil
|
28
31
|
encryptor.salt.should == nil
|
29
32
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Notifier::Hipchat do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Notifier::Hipchat.defaults do |hipchat|
|
8
|
+
hipchat.token = 'token'
|
9
|
+
hipchat.from = 'DB Backup'
|
10
|
+
hipchat.rooms_notified = ['activity']
|
11
|
+
hipchat.success_color = 'green'
|
12
|
+
hipchat.warning_color = 'yellow'
|
13
|
+
hipchat.failure_color = 'red'
|
14
|
+
hipchat.notify_users = true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should set the default tweet configuration' do
|
19
|
+
hipchat = Backup::Configuration::Notifier::Hipchat
|
20
|
+
hipchat.token.should == 'token'
|
21
|
+
hipchat.from.should == 'DB Backup'
|
22
|
+
hipchat.rooms_notified.should == ['activity']
|
23
|
+
hipchat.success_color.should == 'green'
|
24
|
+
hipchat.warning_color.should == 'yellow'
|
25
|
+
hipchat.failure_color.should == 'red'
|
26
|
+
hipchat.notify_users.should == true
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#clear_defaults!' do
|
30
|
+
it 'should clear all the defaults, resetting them to nil' do
|
31
|
+
Backup::Configuration::Notifier::Hipchat.clear_defaults!
|
32
|
+
|
33
|
+
hipchat = Backup::Configuration::Notifier::Hipchat
|
34
|
+
hipchat.token.should == nil
|
35
|
+
hipchat.from.should == nil
|
36
|
+
hipchat.rooms_notified.should == nil
|
37
|
+
hipchat.success_color.should == nil
|
38
|
+
hipchat.warning_color.should == nil
|
39
|
+
hipchat.failure_color.should == nil
|
40
|
+
hipchat.notify_users.should == nil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require File.
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
4
|
|
5
5
|
describe Backup::Configuration::Notifier::Mail do
|
6
6
|
before do
|
7
7
|
Backup::Configuration::Notifier::Mail.defaults do |mail|
|
8
|
+
mail.delivery_method = :file
|
8
9
|
mail.from = 'my.sender.email@gmail.com'
|
9
10
|
mail.to = 'my.receiver.email@gmail.com'
|
10
11
|
mail.address = 'smtp.gmail.com'
|
@@ -14,22 +15,29 @@ describe Backup::Configuration::Notifier::Mail do
|
|
14
15
|
mail.password = 'secret'
|
15
16
|
mail.authentication = 'plain'
|
16
17
|
mail.enable_starttls_auto = true
|
17
|
-
mail.openssl_verify_mode =
|
18
|
+
mail.openssl_verify_mode = 'none'
|
19
|
+
mail.sendmail = '/path/to/sendmail'
|
20
|
+
mail.sendmail_args = '-i -t -X/tmp/traffic.log'
|
21
|
+
mail.mail_folder = '/path/to/backup/mails'
|
18
22
|
end
|
19
23
|
end
|
20
24
|
|
21
25
|
it 'should set the default Mail configuration' do
|
22
26
|
mail = Backup::Configuration::Notifier::Mail
|
23
|
-
mail.
|
24
|
-
mail.
|
25
|
-
mail.
|
26
|
-
mail.
|
27
|
-
mail.
|
28
|
-
mail.
|
29
|
-
mail.
|
30
|
-
mail.
|
31
|
-
mail.
|
32
|
-
mail.
|
27
|
+
mail.delivery_method.should == :file
|
28
|
+
mail.from.should == 'my.sender.email@gmail.com'
|
29
|
+
mail.to.should == 'my.receiver.email@gmail.com'
|
30
|
+
mail.address.should == 'smtp.gmail.com'
|
31
|
+
mail.port.should == 587
|
32
|
+
mail.domain.should == 'your.host.name'
|
33
|
+
mail.user_name.should == 'user'
|
34
|
+
mail.password.should == 'secret'
|
35
|
+
mail.authentication.should == 'plain'
|
36
|
+
mail.enable_starttls_auto.should == true
|
37
|
+
mail.openssl_verify_mode.should == 'none'
|
38
|
+
mail.sendmail.should == '/path/to/sendmail'
|
39
|
+
mail.sendmail_args.should == '-i -t -X/tmp/traffic.log'
|
40
|
+
mail.mail_folder.should == '/path/to/backup/mails'
|
33
41
|
end
|
34
42
|
|
35
43
|
describe '#clear_defaults!' do
|
@@ -37,16 +45,20 @@ describe Backup::Configuration::Notifier::Mail do
|
|
37
45
|
Backup::Configuration::Notifier::Mail.clear_defaults!
|
38
46
|
|
39
47
|
mail = Backup::Configuration::Notifier::Mail
|
40
|
-
mail.
|
41
|
-
mail.
|
42
|
-
mail.
|
43
|
-
mail.
|
44
|
-
mail.
|
45
|
-
mail.
|
46
|
-
mail.
|
47
|
-
mail.
|
48
|
-
mail.
|
49
|
-
mail.
|
48
|
+
mail.delivery_method.should == nil
|
49
|
+
mail.from.should == nil
|
50
|
+
mail.to.should == nil
|
51
|
+
mail.address.should == nil
|
52
|
+
mail.port.should == nil
|
53
|
+
mail.domain.should == nil
|
54
|
+
mail.user_name.should == nil
|
55
|
+
mail.password.should == nil
|
56
|
+
mail.authentication.should == nil
|
57
|
+
mail.enable_starttls_auto.should == nil
|
58
|
+
mail.openssl_verify_mode.should == nil
|
59
|
+
mail.sendmail.should == nil
|
60
|
+
mail.sendmail_args.should == nil
|
61
|
+
mail.mail_folder.should == nil
|
50
62
|
end
|
51
63
|
end
|
52
64
|
end
|