backup_checksum 3.0.23
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of backup_checksum might be problematic. Click here for more details.
- data/.gitignore +7 -0
- data/.travis.yml +10 -0
- data/Gemfile +28 -0
- data/Gemfile.lock +130 -0
- data/Guardfile +21 -0
- data/LICENSE.md +24 -0
- data/README.md +476 -0
- data/backup_checksum.gemspec +32 -0
- data/bin/backup +11 -0
- data/lib/backup.rb +217 -0
- data/lib/backup/archive.rb +117 -0
- data/lib/backup/binder.rb +22 -0
- data/lib/backup/checksum/base.rb +44 -0
- data/lib/backup/checksum/shasum.rb +16 -0
- data/lib/backup/cleaner.rb +121 -0
- data/lib/backup/cli/helpers.rb +88 -0
- data/lib/backup/cli/utility.rb +247 -0
- data/lib/backup/compressor/base.rb +29 -0
- data/lib/backup/compressor/bzip2.rb +50 -0
- data/lib/backup/compressor/gzip.rb +47 -0
- data/lib/backup/compressor/lzma.rb +50 -0
- data/lib/backup/compressor/pbzip2.rb +56 -0
- data/lib/backup/config.rb +173 -0
- data/lib/backup/configuration/base.rb +15 -0
- data/lib/backup/configuration/checksum/base.rb +9 -0
- data/lib/backup/configuration/checksum/shasum.rb +9 -0
- data/lib/backup/configuration/compressor/base.rb +9 -0
- data/lib/backup/configuration/compressor/bzip2.rb +23 -0
- data/lib/backup/configuration/compressor/gzip.rb +23 -0
- data/lib/backup/configuration/compressor/lzma.rb +23 -0
- data/lib/backup/configuration/compressor/pbzip2.rb +28 -0
- data/lib/backup/configuration/database/base.rb +19 -0
- data/lib/backup/configuration/database/mongodb.rb +49 -0
- data/lib/backup/configuration/database/mysql.rb +42 -0
- data/lib/backup/configuration/database/postgresql.rb +41 -0
- data/lib/backup/configuration/database/redis.rb +39 -0
- data/lib/backup/configuration/database/riak.rb +29 -0
- data/lib/backup/configuration/encryptor/base.rb +9 -0
- data/lib/backup/configuration/encryptor/gpg.rb +17 -0
- data/lib/backup/configuration/encryptor/open_ssl.rb +32 -0
- data/lib/backup/configuration/helpers.rb +52 -0
- data/lib/backup/configuration/notifier/base.rb +28 -0
- data/lib/backup/configuration/notifier/campfire.rb +25 -0
- data/lib/backup/configuration/notifier/hipchat.rb +41 -0
- data/lib/backup/configuration/notifier/mail.rb +112 -0
- data/lib/backup/configuration/notifier/presently.rb +25 -0
- data/lib/backup/configuration/notifier/prowl.rb +23 -0
- data/lib/backup/configuration/notifier/twitter.rb +21 -0
- data/lib/backup/configuration/storage/base.rb +18 -0
- data/lib/backup/configuration/storage/cloudfiles.rb +25 -0
- data/lib/backup/configuration/storage/dropbox.rb +58 -0
- data/lib/backup/configuration/storage/ftp.rb +29 -0
- data/lib/backup/configuration/storage/local.rb +17 -0
- data/lib/backup/configuration/storage/ninefold.rb +20 -0
- data/lib/backup/configuration/storage/rsync.rb +29 -0
- data/lib/backup/configuration/storage/s3.rb +25 -0
- data/lib/backup/configuration/storage/scp.rb +25 -0
- data/lib/backup/configuration/storage/sftp.rb +25 -0
- data/lib/backup/configuration/syncer/base.rb +10 -0
- data/lib/backup/configuration/syncer/cloud.rb +23 -0
- data/lib/backup/configuration/syncer/cloud_files.rb +30 -0
- data/lib/backup/configuration/syncer/rsync/base.rb +28 -0
- data/lib/backup/configuration/syncer/rsync/local.rb +11 -0
- data/lib/backup/configuration/syncer/rsync/pull.rb +11 -0
- data/lib/backup/configuration/syncer/rsync/push.rb +31 -0
- data/lib/backup/configuration/syncer/s3.rb +23 -0
- data/lib/backup/database/base.rb +59 -0
- data/lib/backup/database/mongodb.rb +232 -0
- data/lib/backup/database/mysql.rb +163 -0
- data/lib/backup/database/postgresql.rb +146 -0
- data/lib/backup/database/redis.rb +139 -0
- data/lib/backup/database/riak.rb +69 -0
- data/lib/backup/dependency.rb +114 -0
- data/lib/backup/encryptor/base.rb +29 -0
- data/lib/backup/encryptor/gpg.rb +80 -0
- data/lib/backup/encryptor/open_ssl.rb +72 -0
- data/lib/backup/errors.rb +124 -0
- data/lib/backup/logger.rb +152 -0
- data/lib/backup/model.rb +386 -0
- data/lib/backup/notifier/base.rb +81 -0
- data/lib/backup/notifier/campfire.rb +168 -0
- data/lib/backup/notifier/hipchat.rb +99 -0
- data/lib/backup/notifier/mail.rb +206 -0
- data/lib/backup/notifier/presently.rb +88 -0
- data/lib/backup/notifier/prowl.rb +65 -0
- data/lib/backup/notifier/twitter.rb +70 -0
- data/lib/backup/package.rb +51 -0
- data/lib/backup/packager.rb +108 -0
- data/lib/backup/pipeline.rb +107 -0
- data/lib/backup/splitter.rb +75 -0
- data/lib/backup/storage/base.rb +119 -0
- data/lib/backup/storage/cloudfiles.rb +87 -0
- data/lib/backup/storage/cycler.rb +117 -0
- data/lib/backup/storage/dropbox.rb +181 -0
- data/lib/backup/storage/ftp.rb +119 -0
- data/lib/backup/storage/local.rb +82 -0
- data/lib/backup/storage/ninefold.rb +116 -0
- data/lib/backup/storage/rsync.rb +149 -0
- data/lib/backup/storage/s3.rb +94 -0
- data/lib/backup/storage/scp.rb +99 -0
- data/lib/backup/storage/sftp.rb +108 -0
- data/lib/backup/syncer/base.rb +42 -0
- data/lib/backup/syncer/cloud.rb +190 -0
- data/lib/backup/syncer/cloud_files.rb +56 -0
- data/lib/backup/syncer/rsync/base.rb +52 -0
- data/lib/backup/syncer/rsync/local.rb +53 -0
- data/lib/backup/syncer/rsync/pull.rb +38 -0
- data/lib/backup/syncer/rsync/push.rb +113 -0
- data/lib/backup/syncer/s3.rb +47 -0
- data/lib/backup/template.rb +46 -0
- data/lib/backup/version.rb +43 -0
- data/spec/archive_spec.rb +335 -0
- data/spec/cleaner_spec.rb +304 -0
- data/spec/cli/helpers_spec.rb +176 -0
- data/spec/cli/utility_spec.rb +363 -0
- data/spec/compressor/base_spec.rb +31 -0
- data/spec/compressor/bzip2_spec.rb +83 -0
- data/spec/compressor/gzip_spec.rb +83 -0
- data/spec/compressor/lzma_spec.rb +83 -0
- data/spec/compressor/pbzip2_spec.rb +124 -0
- data/spec/config_spec.rb +321 -0
- data/spec/configuration/base_spec.rb +35 -0
- data/spec/configuration/compressor/bzip2_spec.rb +29 -0
- data/spec/configuration/compressor/gzip_spec.rb +29 -0
- data/spec/configuration/compressor/lzma_spec.rb +29 -0
- data/spec/configuration/compressor/pbzip2_spec.rb +32 -0
- data/spec/configuration/database/base_spec.rb +17 -0
- data/spec/configuration/database/mongodb_spec.rb +56 -0
- data/spec/configuration/database/mysql_spec.rb +53 -0
- data/spec/configuration/database/postgresql_spec.rb +53 -0
- data/spec/configuration/database/redis_spec.rb +50 -0
- data/spec/configuration/database/riak_spec.rb +35 -0
- data/spec/configuration/encryptor/gpg_spec.rb +26 -0
- data/spec/configuration/encryptor/open_ssl_spec.rb +35 -0
- data/spec/configuration/notifier/base_spec.rb +32 -0
- data/spec/configuration/notifier/campfire_spec.rb +32 -0
- data/spec/configuration/notifier/hipchat_spec.rb +44 -0
- data/spec/configuration/notifier/mail_spec.rb +71 -0
- data/spec/configuration/notifier/presently_spec.rb +35 -0
- data/spec/configuration/notifier/prowl_spec.rb +29 -0
- data/spec/configuration/notifier/twitter_spec.rb +35 -0
- data/spec/configuration/storage/cloudfiles_spec.rb +41 -0
- data/spec/configuration/storage/dropbox_spec.rb +38 -0
- data/spec/configuration/storage/ftp_spec.rb +44 -0
- data/spec/configuration/storage/local_spec.rb +29 -0
- data/spec/configuration/storage/ninefold_spec.rb +32 -0
- data/spec/configuration/storage/rsync_spec.rb +41 -0
- data/spec/configuration/storage/s3_spec.rb +38 -0
- data/spec/configuration/storage/scp_spec.rb +41 -0
- data/spec/configuration/storage/sftp_spec.rb +41 -0
- data/spec/configuration/syncer/cloud_files_spec.rb +44 -0
- data/spec/configuration/syncer/rsync/base_spec.rb +33 -0
- data/spec/configuration/syncer/rsync/local_spec.rb +10 -0
- data/spec/configuration/syncer/rsync/pull_spec.rb +10 -0
- data/spec/configuration/syncer/rsync/push_spec.rb +43 -0
- data/spec/configuration/syncer/s3_spec.rb +38 -0
- data/spec/database/base_spec.rb +54 -0
- data/spec/database/mongodb_spec.rb +428 -0
- data/spec/database/mysql_spec.rb +335 -0
- data/spec/database/postgresql_spec.rb +278 -0
- data/spec/database/redis_spec.rb +260 -0
- data/spec/database/riak_spec.rb +108 -0
- data/spec/dependency_spec.rb +49 -0
- data/spec/encryptor/base_spec.rb +30 -0
- data/spec/encryptor/gpg_spec.rb +134 -0
- data/spec/encryptor/open_ssl_spec.rb +129 -0
- data/spec/errors_spec.rb +306 -0
- data/spec/logger_spec.rb +363 -0
- data/spec/model_spec.rb +649 -0
- data/spec/notifier/base_spec.rb +89 -0
- data/spec/notifier/campfire_spec.rb +199 -0
- data/spec/notifier/hipchat_spec.rb +188 -0
- data/spec/notifier/mail_spec.rb +280 -0
- data/spec/notifier/presently_spec.rb +181 -0
- data/spec/notifier/prowl_spec.rb +117 -0
- data/spec/notifier/twitter_spec.rb +132 -0
- data/spec/package_spec.rb +61 -0
- data/spec/packager_spec.rb +225 -0
- data/spec/pipeline_spec.rb +257 -0
- data/spec/spec_helper.rb +59 -0
- data/spec/splitter_spec.rb +120 -0
- data/spec/storage/base_spec.rb +160 -0
- data/spec/storage/cloudfiles_spec.rb +230 -0
- data/spec/storage/cycler_spec.rb +239 -0
- data/spec/storage/dropbox_spec.rb +370 -0
- data/spec/storage/ftp_spec.rb +247 -0
- data/spec/storage/local_spec.rb +235 -0
- data/spec/storage/ninefold_spec.rb +319 -0
- data/spec/storage/rsync_spec.rb +345 -0
- data/spec/storage/s3_spec.rb +221 -0
- data/spec/storage/scp_spec.rb +209 -0
- data/spec/storage/sftp_spec.rb +220 -0
- data/spec/syncer/base_spec.rb +22 -0
- data/spec/syncer/cloud_files_spec.rb +192 -0
- data/spec/syncer/rsync/base_spec.rb +118 -0
- data/spec/syncer/rsync/local_spec.rb +121 -0
- data/spec/syncer/rsync/pull_spec.rb +90 -0
- data/spec/syncer/rsync/push_spec.rb +327 -0
- data/spec/syncer/s3_spec.rb +192 -0
- data/spec/version_spec.rb +21 -0
- data/templates/cli/utility/archive +25 -0
- data/templates/cli/utility/compressor/bzip2 +7 -0
- data/templates/cli/utility/compressor/gzip +7 -0
- data/templates/cli/utility/compressor/lzma +7 -0
- data/templates/cli/utility/compressor/pbzip2 +7 -0
- data/templates/cli/utility/config +31 -0
- data/templates/cli/utility/database/mongodb +18 -0
- data/templates/cli/utility/database/mysql +21 -0
- data/templates/cli/utility/database/postgresql +17 -0
- data/templates/cli/utility/database/redis +16 -0
- data/templates/cli/utility/database/riak +11 -0
- data/templates/cli/utility/encryptor/gpg +12 -0
- data/templates/cli/utility/encryptor/openssl +9 -0
- data/templates/cli/utility/model.erb +23 -0
- data/templates/cli/utility/notifier/campfire +12 -0
- data/templates/cli/utility/notifier/hipchat +15 -0
- data/templates/cli/utility/notifier/mail +22 -0
- data/templates/cli/utility/notifier/presently +13 -0
- data/templates/cli/utility/notifier/prowl +11 -0
- data/templates/cli/utility/notifier/twitter +13 -0
- data/templates/cli/utility/splitter +7 -0
- data/templates/cli/utility/storage/cloud_files +22 -0
- data/templates/cli/utility/storage/dropbox +20 -0
- data/templates/cli/utility/storage/ftp +12 -0
- data/templates/cli/utility/storage/local +7 -0
- data/templates/cli/utility/storage/ninefold +9 -0
- data/templates/cli/utility/storage/rsync +11 -0
- data/templates/cli/utility/storage/s3 +19 -0
- data/templates/cli/utility/storage/scp +11 -0
- data/templates/cli/utility/storage/sftp +11 -0
- data/templates/cli/utility/syncer/cloud_files +48 -0
- data/templates/cli/utility/syncer/rsync_local +12 -0
- data/templates/cli/utility/syncer/rsync_pull +17 -0
- data/templates/cli/utility/syncer/rsync_push +17 -0
- data/templates/cli/utility/syncer/s3 +45 -0
- 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 +311 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Helpers do
|
6
|
+
|
7
|
+
before do
|
8
|
+
class Backup::Configuration::Base
|
9
|
+
class << self
|
10
|
+
attr_accessor :rspec_method, :rspec_test, :rspec_mocha
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should clear the defaults' do
|
16
|
+
Backup::Configuration::Base.expects(:send).with('rspec_method=', nil)
|
17
|
+
Backup::Configuration::Base.expects(:send).with('rspec_test=', nil)
|
18
|
+
Backup::Configuration::Base.expects(:send).with('rspec_mocha=', nil)
|
19
|
+
Backup::Configuration::Base.clear_defaults!
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should return the setters' do
|
23
|
+
Backup::Configuration::Base.send(:setter_methods).count.should == 3
|
24
|
+
%w[rspec_method= rspec_test= rspec_mocha=].each do |method|
|
25
|
+
Backup::Configuration::Base.send(:setter_methods).should include(method)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should return the getters' do
|
30
|
+
Backup::Configuration::Base.send(:getter_methods).count.should == 3
|
31
|
+
%w[rspec_method rspec_test rspec_mocha].each do |method|
|
32
|
+
Backup::Configuration::Base.send(:getter_methods).should include(method)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Compressor::Bzip2 do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Compressor::Bzip2.defaults do |compressor|
|
8
|
+
compressor.best = true
|
9
|
+
compressor.fast = true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
after { Backup::Configuration::Compressor::Bzip2.clear_defaults! }
|
13
|
+
|
14
|
+
it 'should set the default compressor configuration' do
|
15
|
+
compressor = Backup::Configuration::Compressor::Bzip2
|
16
|
+
compressor.best.should == true
|
17
|
+
compressor.fast.should == true
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#clear_defaults!' do
|
21
|
+
it 'should clear all the defaults, resetting them to nil' do
|
22
|
+
Backup::Configuration::Compressor::Bzip2.clear_defaults!
|
23
|
+
|
24
|
+
compressor = Backup::Configuration::Compressor::Bzip2
|
25
|
+
compressor.best.should == nil
|
26
|
+
compressor.fast.should == nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Compressor::Gzip do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Compressor::Gzip.defaults do |compressor|
|
8
|
+
compressor.best = true
|
9
|
+
compressor.fast = true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
after { Backup::Configuration::Compressor::Gzip.clear_defaults! }
|
13
|
+
|
14
|
+
it 'should set the default compressor configuration' do
|
15
|
+
compressor = Backup::Configuration::Compressor::Gzip
|
16
|
+
compressor.best.should == true
|
17
|
+
compressor.fast.should == true
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#clear_defaults!' do
|
21
|
+
it 'should clear all the defaults, resetting them to nil' do
|
22
|
+
Backup::Configuration::Compressor::Gzip.clear_defaults!
|
23
|
+
|
24
|
+
compressor = Backup::Configuration::Compressor::Gzip
|
25
|
+
compressor.best.should == nil
|
26
|
+
compressor.fast.should == nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Compressor::Lzma do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Compressor::Lzma.defaults do |compressor|
|
8
|
+
compressor.best = true
|
9
|
+
compressor.fast = true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
after { Backup::Configuration::Compressor::Lzma.clear_defaults! }
|
13
|
+
|
14
|
+
it 'should set the default compressor configuration' do
|
15
|
+
compressor = Backup::Configuration::Compressor::Lzma
|
16
|
+
compressor.best.should == true
|
17
|
+
compressor.fast.should == true
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#clear_defaults!' do
|
21
|
+
it 'should clear all the defaults, resetting them to nil' do
|
22
|
+
Backup::Configuration::Compressor::Lzma.clear_defaults!
|
23
|
+
|
24
|
+
compressor = Backup::Configuration::Compressor::Lzma
|
25
|
+
compressor.best.should == nil
|
26
|
+
compressor.fast.should == nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Compressor::Pbzip2 do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Compressor::Pbzip2.defaults do |compressor|
|
8
|
+
compressor.best = true
|
9
|
+
compressor.fast = true
|
10
|
+
compressor.processors = 2
|
11
|
+
end
|
12
|
+
end
|
13
|
+
after { Backup::Configuration::Compressor::Pbzip2.clear_defaults! }
|
14
|
+
|
15
|
+
it 'should set the default compressor configuration' do
|
16
|
+
compressor = Backup::Configuration::Compressor::Pbzip2
|
17
|
+
compressor.best.should == true
|
18
|
+
compressor.fast.should == true
|
19
|
+
compressor.processors.should == 2
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#clear_defaults!' do
|
23
|
+
it 'should clear all the defaults, resetting them to nil' do
|
24
|
+
Backup::Configuration::Compressor::Pbzip2.clear_defaults!
|
25
|
+
|
26
|
+
compressor = Backup::Configuration::Compressor::Pbzip2
|
27
|
+
compressor.best.should == nil
|
28
|
+
compressor.fast.should == nil
|
29
|
+
compressor.processors.should == nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Database::Base do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Database::Base.defaults do |db|
|
8
|
+
db.utility_path = '/usr/bin/my_util' # deprecated
|
9
|
+
end
|
10
|
+
end
|
11
|
+
after { Backup::Configuration::Database::Base.clear_defaults! }
|
12
|
+
|
13
|
+
it 'should set the default Base configuration' do
|
14
|
+
db = Backup::Configuration::Database::Base
|
15
|
+
db.utility_path.should == '/usr/bin/my_util'
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Database::MongoDB do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Database::MongoDB.defaults do |db|
|
8
|
+
db.name = 'mydb'
|
9
|
+
db.username = 'myuser'
|
10
|
+
db.password = 'mypassword'
|
11
|
+
db.host = 'myhost'
|
12
|
+
db.port = 'myport'
|
13
|
+
db.only_collections = %w[my other tables]
|
14
|
+
db.additional_options = %w[my options]
|
15
|
+
db.ipv6 = true
|
16
|
+
db.mongodump_utility = '/path/to/mongodump'
|
17
|
+
db.mongo_utility = '/path/to/mongo'
|
18
|
+
db.lock = true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
after { Backup::Configuration::Database::MongoDB.clear_defaults! }
|
22
|
+
|
23
|
+
it 'should set the default MongoDB configuration' do
|
24
|
+
db = Backup::Configuration::Database::MongoDB
|
25
|
+
db.name.should == 'mydb'
|
26
|
+
db.username.should == 'myuser'
|
27
|
+
db.password.should == 'mypassword'
|
28
|
+
db.host.should == 'myhost'
|
29
|
+
db.port.should == 'myport'
|
30
|
+
db.only_collections.should == %w[my other tables]
|
31
|
+
db.additional_options.should == %w[my options]
|
32
|
+
db.ipv6.should == true
|
33
|
+
db.mongodump_utility.should == '/path/to/mongodump'
|
34
|
+
db.mongo_utility.should == '/path/to/mongo'
|
35
|
+
db.lock.should == true
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#clear_defaults!' do
|
39
|
+
it 'should clear all the defaults, resetting them to nil' do
|
40
|
+
Backup::Configuration::Database::MongoDB.clear_defaults!
|
41
|
+
|
42
|
+
db = Backup::Configuration::Database::MongoDB
|
43
|
+
db.name.should == nil
|
44
|
+
db.username.should == nil
|
45
|
+
db.password.should == nil
|
46
|
+
db.host.should == nil
|
47
|
+
db.port.should == nil
|
48
|
+
db.only_collections.should == nil
|
49
|
+
db.additional_options.should == nil
|
50
|
+
db.ipv6.should == nil
|
51
|
+
db.mongodump_utility.should == nil
|
52
|
+
db.mongo_utility.should == nil
|
53
|
+
db.lock.should == nil
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Database::MySQL do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Database::MySQL.defaults do |db|
|
8
|
+
db.name = 'mydb'
|
9
|
+
db.username = 'myuser'
|
10
|
+
db.password = 'mypassword'
|
11
|
+
db.host = 'myhost'
|
12
|
+
db.port = 'myport'
|
13
|
+
db.socket = 'mysocket'
|
14
|
+
db.skip_tables = %w[my tables]
|
15
|
+
db.only_tables = %w[my other tables]
|
16
|
+
db.additional_options = %w[my options]
|
17
|
+
db.mysqldump_utility = '/path/to/mysqldump'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
after { Backup::Configuration::Database::MySQL.clear_defaults! }
|
21
|
+
|
22
|
+
it 'should set the default MySQL configuration' do
|
23
|
+
db = Backup::Configuration::Database::MySQL
|
24
|
+
db.name.should == 'mydb'
|
25
|
+
db.username.should == 'myuser'
|
26
|
+
db.password.should == 'mypassword'
|
27
|
+
db.host.should == 'myhost'
|
28
|
+
db.port.should == 'myport'
|
29
|
+
db.socket.should == 'mysocket'
|
30
|
+
db.skip_tables.should == %w[my tables]
|
31
|
+
db.only_tables.should == %w[my other tables]
|
32
|
+
db.additional_options.should == %w[my options]
|
33
|
+
db.mysqldump_utility.should == '/path/to/mysqldump'
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#clear_defaults!' do
|
37
|
+
it 'should clear all the defaults, resetting them to nil' do
|
38
|
+
Backup::Configuration::Database::MySQL.clear_defaults!
|
39
|
+
|
40
|
+
db = Backup::Configuration::Database::MySQL
|
41
|
+
db.name.should == nil
|
42
|
+
db.username.should == nil
|
43
|
+
db.password.should == nil
|
44
|
+
db.host.should == nil
|
45
|
+
db.port.should == nil
|
46
|
+
db.socket.should == nil
|
47
|
+
db.skip_tables.should == nil
|
48
|
+
db.only_tables.should == nil
|
49
|
+
db.additional_options.should == nil
|
50
|
+
db.mysqldump_utility.should == nil
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Database::PostgreSQL do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Database::PostgreSQL.defaults do |db|
|
8
|
+
db.name = 'mydb'
|
9
|
+
db.username = 'myuser'
|
10
|
+
db.password = 'mypassword'
|
11
|
+
db.host = 'myhost'
|
12
|
+
db.port = 'myport'
|
13
|
+
db.socket = 'mysocket'
|
14
|
+
db.skip_tables = %w[my tables]
|
15
|
+
db.only_tables = %w[my other tables]
|
16
|
+
db.additional_options = %w[my options]
|
17
|
+
db.pg_dump_utility = '/path/to/pg_dump'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
after { Backup::Configuration::Database::PostgreSQL.clear_defaults! }
|
21
|
+
|
22
|
+
it 'should set the default PostgreSQL configuration' do
|
23
|
+
db = Backup::Configuration::Database::PostgreSQL
|
24
|
+
db.name.should == 'mydb'
|
25
|
+
db.username.should == 'myuser'
|
26
|
+
db.password.should == 'mypassword'
|
27
|
+
db.host.should == 'myhost'
|
28
|
+
db.port.should == 'myport'
|
29
|
+
db.socket.should == 'mysocket'
|
30
|
+
db.skip_tables.should == %w[my tables]
|
31
|
+
db.only_tables.should == %w[my other tables]
|
32
|
+
db.additional_options.should == %w[my options]
|
33
|
+
db.pg_dump_utility.should == '/path/to/pg_dump'
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#clear_defaults!' do
|
37
|
+
it 'should clear all the defaults, resetting them to nil' do
|
38
|
+
Backup::Configuration::Database::PostgreSQL.clear_defaults!
|
39
|
+
|
40
|
+
db = Backup::Configuration::Database::PostgreSQL
|
41
|
+
db.name.should == nil
|
42
|
+
db.username.should == nil
|
43
|
+
db.password.should == nil
|
44
|
+
db.host.should == nil
|
45
|
+
db.port.should == nil
|
46
|
+
db.socket.should == nil
|
47
|
+
db.skip_tables.should == nil
|
48
|
+
db.only_tables.should == nil
|
49
|
+
db.additional_options.should == nil
|
50
|
+
db.pg_dump_utility.should == nil
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Database::Redis do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Database::Redis.defaults do |db|
|
8
|
+
db.name = 'mydb'
|
9
|
+
db.path = '/var/lib/redis/db'
|
10
|
+
db.password = 'mypassword'
|
11
|
+
db.invoke_save = true
|
12
|
+
db.host = 'localhost'
|
13
|
+
db.port = 123
|
14
|
+
db.socket = '/redis.sock'
|
15
|
+
db.additional_options = %w[my options]
|
16
|
+
db.redis_cli_utility = '/path/to/redis-cli'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
after { Backup::Configuration::Database::Redis.clear_defaults! }
|
20
|
+
|
21
|
+
it 'should set the default Redis configuration' do
|
22
|
+
db = Backup::Configuration::Database::Redis
|
23
|
+
db.name.should == 'mydb'
|
24
|
+
db.path.should == '/var/lib/redis/db'
|
25
|
+
db.password.should == 'mypassword'
|
26
|
+
db.invoke_save.should == true
|
27
|
+
db.host.should == 'localhost'
|
28
|
+
db.port.should == 123
|
29
|
+
db.socket.should == '/redis.sock'
|
30
|
+
db.additional_options.should == %w[my options]
|
31
|
+
db.redis_cli_utility.should == '/path/to/redis-cli'
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#clear_defaults!' do
|
35
|
+
it 'should clear all the defaults, resetting them to nil' do
|
36
|
+
Backup::Configuration::Database::Redis.clear_defaults!
|
37
|
+
|
38
|
+
db = Backup::Configuration::Database::Redis
|
39
|
+
db.name.should == nil
|
40
|
+
db.path.should == nil
|
41
|
+
db.password.should == nil
|
42
|
+
db.invoke_save.should == nil
|
43
|
+
db.host.should == nil
|
44
|
+
db.port.should == nil
|
45
|
+
db.socket.should == nil
|
46
|
+
db.additional_options.should == nil
|
47
|
+
db.redis_cli_utility.should == nil
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,35 @@
|
|
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
|
+
db.riak_admin_utility = '/path/to/riak-admin'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
after { Backup::Configuration::Database::Riak.clear_defaults! }
|
15
|
+
|
16
|
+
it 'should set the default Riak configuration' do
|
17
|
+
db = Backup::Configuration::Database::Riak
|
18
|
+
db.name.should == 'mydb'
|
19
|
+
db.node.should == '/var/lib/redis/db'
|
20
|
+
db.cookie.should == 'mypassword'
|
21
|
+
db.riak_admin_utility.should == '/path/to/riak-admin'
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#clear_defaults!' do
|
25
|
+
it 'should clear all the defaults, resetting them to nil' do
|
26
|
+
Backup::Configuration::Database::Riak.clear_defaults!
|
27
|
+
|
28
|
+
db = Backup::Configuration::Database::Riak
|
29
|
+
db.name.should == nil
|
30
|
+
db.node.should == nil
|
31
|
+
db.cookie.should == nil
|
32
|
+
db.riak_admin_utility.should == nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper.rb', __FILE__)
|
4
|
+
|
5
|
+
describe Backup::Configuration::Encryptor::GPG do
|
6
|
+
before do
|
7
|
+
Backup::Configuration::Encryptor::GPG.defaults do |encryptor|
|
8
|
+
encryptor.key = 'my_key'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
after { Backup::Configuration::Encryptor::GPG.clear_defaults! }
|
12
|
+
|
13
|
+
it 'should set the default encryptor configuration' do
|
14
|
+
encryptor = Backup::Configuration::Encryptor::GPG
|
15
|
+
encryptor.key.should == 'my_key'
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#clear_defaults!' do
|
19
|
+
it 'should clear all the defaults, resetting them to nil' do
|
20
|
+
Backup::Configuration::Encryptor::GPG.clear_defaults!
|
21
|
+
|
22
|
+
encryptor = Backup::Configuration::Encryptor::GPG
|
23
|
+
encryptor.key.should == nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|