diff options
author | kwadronaut <kwadronaut@leap.se> | 2018-11-07 15:43:41 +0100 |
---|---|---|
committer | kwadronaut <kwadronaut@leap.se> | 2018-11-07 15:43:41 +0100 |
commit | e598088c2f9263e7682e399b65376d7a2c529ded (patch) | |
tree | aa628edf0ad55dc2adea8bc6f96bf516aaba0a30 /spec/classes/onionbalance_spec.rb | |
parent | d30831f7214da266ad943cf4013f0632e8b15d48 (diff) | |
parent | 77070c6bf97ecd6fc860cae6120dca86fa910e5a (diff) |
Diffstat (limited to 'spec/classes/onionbalance_spec.rb')
-rw-r--r-- | spec/classes/onionbalance_spec.rb | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/spec/classes/onionbalance_spec.rb b/spec/classes/onionbalance_spec.rb new file mode 100644 index 0000000..ff9bb27 --- /dev/null +++ b/spec/classes/onionbalance_spec.rb @@ -0,0 +1,60 @@ +require File.expand_path(File.join(File.dirname(__FILE__),'../spec_helper')) + +describe 'tor::onionbalance', :type => 'class' do + let(:default_facts) { + { + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + } + } + let(:facts){ default_facts } + let(:pre_condition){'Exec{path => "/bin"}' } + let(:params){ + { + :services => { + 'keyname_of_service1' => { + 'name1' => 'onionservice_addr_3', + 'name2' => 'onionservice_addr_2', + '_key_content' => 'content_of_key_of_onionbalanced_service1', + }, + }, + } + } + describe 'with standard' do + it { is_expected.to compile.with_all_deps } + + it { is_expected.to contain_package('python2-onionbalance').with( + :ensure => 'installed', + ) } + it { is_expected.to contain_service('tor@onionbalance').with( + :ensure => 'running', + :enable => true, + ) } + it { is_expected.to contain_service('onionbalance').with( + :ensure => 'running', + :enable => true, + :subscribe => 'Service[tor@onionbalance]', + ) } + context 'on Debian' do + let(:facts) { + { + :osfamily => 'Debian', + :operatingsystem => 'Debian', + } + } + it { is_expected.to compile.with_all_deps } + it { is_expected.to contain_package('onionbalance').with( + :ensure => 'installed', + ) } + it { is_expected.to contain_service('tor@onionbalance').with( + :ensure => 'running', + :enable => true, + ) } + it { is_expected.to contain_service('onionbalance').with( + :ensure => 'running', + :enable => true, + :subscribe => 'Service[tor@onionbalance]', + ) } + end + end +end |