diff options
Diffstat (limited to 'files/puppet/modules/pixelated/spec')
11 files changed, 0 insertions, 229 deletions
diff --git a/files/puppet/modules/pixelated/spec/classes/agent_spec.rb b/files/puppet/modules/pixelated/spec/classes/agent_spec.rb deleted file mode 100644 index 2ba956b..0000000 --- a/files/puppet/modules/pixelated/spec/classes/agent_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -require 'spec_helper' - describe 'pixelated::agent' do - after :each do - Facter.clear - Facter.clear_messages - end - - - - context 'single node' do - let(:facts) do - { - :operatingsystem => 'Debian', - :osfamily => 'Debian', - :lsbdistid => 'Debian', - :lsbdistcodename => 'jessie', - :testscenario => 'single_node', - } - end - let!(:ensure_packages) { MockFunction.new('ensure_packages',{:type => :statement}) } - let(:pre_condition) { [ - "class stdlib {}", - "define rsyslog::snippet($content) {}", - "define shorewall::rule($source,$destination,$action,$order) {}", - "define apache::vhost::file($content,$mod_security) {}", - "define apt::sources_list($content='deb url') {}", - "define apt::apt_conf($source='file url',$refresh_apt='true') {}", - "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}", - ] } - - it { should contain_class('pixelated::syslog') } - it { should contain_class('pixelated::tests') } - - it { should contain_service('pixelated-server')} - - # testing if shorewall::masq generates the files - it { should contain_shorewall__rule('net2fw-pixelated-user-agent').with_source('net') } - - it { should contain_apache__vhost__file('pixelated').with_content(/mail.example.com/)} - - it "should configure leap webapp" do - should contain_file('/srv/leap/webapp/config/customization/locales/en.yml').with( 'require' => 'File[/srv/leap/webapp/config/customization/views/common]',) - should contain_file('/srv/leap/webapp/config/customization/views/common/_download_button.html.haml') - should contain_file('/srv/leap/webapp/config/customization/views/users/show.html.haml').with_content(/mail.example.com/) - end - end - -end diff --git a/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb b/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb deleted file mode 100644 index 27297db..0000000 --- a/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'spec_helper' - -describe 'pixelated::apt::preferences' do - let(:facts) do - { - :operatingsystem => 'Debian', - :lsbdistid => 'Debian', - :lsbdistcodename => 'jessie', - } - end - - let(:pre_condition) { [ - "class apt {}", - "define apt::sources_list($content='deb url') {}", - "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}", - ] } - - %w( soledad-server soledad-client soledad-common leap-keymanager leap-auth).each do | file | - it { should contain_file("/etc/apt/preferences.d/#{file}").with_ensure('absent')} - end - - %w( python-urllib3 python-requests python-six).each do | package | - it { should contain_apt__preferences_snippet("#{package}").with_release(/jessie/) } - end - -end diff --git a/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb b/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb deleted file mode 100644 index 4d9386e..0000000 --- a/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe 'pixelated' do - context 'single node' do - let(:facts) do - { - :operatingsystem => 'Debian', - :osfamily => 'Debian', - :lsbdistid => 'Debian', - :lsbdistcodename => 'jessie', - :testscenario => 'single_node', - } - end - - let!(:ensure_packages) { MockFunction.new('ensure_packages',{:type => :statement}) } - let(:pre_condition) { [ - "class stdlib {}", - "class apt {}", - "define rsyslog::snippet($content) {}", - "define shorewall::rule($source,$destination,$action,$order) {}", - "define apache::vhost::file($content,$mod_security) {}", - "define apt::sources_list($content='deb url') {}", - "define apt::apt_conf($source='file url',$refresh_apt='true') {}", - "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}", - ] } - - it { should contain_class('pixelated::agent') } - end -end - diff --git a/files/puppet/modules/pixelated/spec/classes/remove_spec.rb b/files/puppet/modules/pixelated/spec/classes/remove_spec.rb deleted file mode 100644 index 5e5567d..0000000 --- a/files/puppet/modules/pixelated/spec/classes/remove_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'spec_helper' - -describe 'pixelated::remove' do - it { should compile } -end - diff --git a/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb b/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb deleted file mode 100644 index b4aacbf..0000000 --- a/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper' - -describe 'pixelated::syslog' do - let(:facts) do - { - :operatingsystem => 'Debian', - :osfamily => 'Debian', - :lsbdistcodename => 'jessie', - } - end - let(:pre_condition) { [ - "class stdlib {}", - "define rsyslog::snippet($content) {}", - "define shorewall::rule($source,$destination,$action,$order) {}", - "define apache::vhost::file($content,$mod_security) {}", - "define apt::sources_list($content='deb url') {}", - "define apt::apt_conf($source='file url') {}", - "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}", - ] } - - - it { should contain_rsyslog__snippet('05-pixelated')} - it { should contain_file('/etc/logrotate.d/pixelated')} -end diff --git a/files/puppet/modules/pixelated/spec/classes/tests_spec.rb b/files/puppet/modules/pixelated/spec/classes/tests_spec.rb deleted file mode 100644 index cc3e9b7..0000000 --- a/files/puppet/modules/pixelated/spec/classes/tests_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'spec_helper' - -describe 'pixelated::tests' do - context 'single node' do - let(:facts) do - { - :operatingsystem => 'Debian', - :osfamily => 'Debian', - :lsbdistid => 'Debian', - :lsbdistcodename => 'jessie', - :testscenario => 'single_node', - } - end - - let!(:ensure_packages) { MockFunction.new('ensure_packages',{:type => :statement}) } - let(:pre_condition) { [ - "class stdlib {}", - ] } - - it do - should contain_file('/srv/leap/tests_custom').with( - 'ensure' => 'directory', - 'mode' => '0755', - ) - end - it do - should contain_file('/srv/leap/tests_custom/functional-tests').with( - 'ensure' => 'directory', - 'recurse' => 'true', - ) - end - - it { should contain_file('/srv/leap/tests_custom/pixelated.rb')} - it { should contain_file('/usr/local/bin/phantomjs')} - - it do - should contain_exec('dummy_register_job').with( - "require" => "Class[::Check_mk::Agent::Install]" - ) - end - it do - should contain_cron('run_functional_tests').with( - "command" => """(date; INVITE_CODE_ENABLED=true /usr/bin/mk-job pixelated-functional-tests /usr/local/bin/behave --stop --tags @staging --tags ~@wip --no-capture -k /srv/leap/tests_custom/functional-tests/ | ts ) >> /var/log/check_mk_jobs.log 2>&1" - ) - end - end -end diff --git a/files/puppet/modules/pixelated/spec/fixtures/hiera/hiera.yaml b/files/puppet/modules/pixelated/spec/fixtures/hiera/hiera.yaml deleted file mode 100644 index 2d001ec..0000000 --- a/files/puppet/modules/pixelated/spec/fixtures/hiera/hiera.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -:backends: - - yaml -:hierarchy: - - "%{::testscenario}" -:yaml: - :datadir: 'spec/fixtures/hiera' diff --git a/files/puppet/modules/pixelated/spec/fixtures/hiera/multi_node.yaml b/files/puppet/modules/pixelated/spec/fixtures/hiera/multi_node.yaml deleted file mode 100644 index c8bf5c7..0000000 --- a/files/puppet/modules/pixelated/spec/fixtures/hiera/multi_node.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -domain: - full: pixelated.example.com - full_suffix: example.com - internal: pixelated.example.i - internal_suffix: example.i - name: pixelated.example.com -services: ["pixelated"] - diff --git a/files/puppet/modules/pixelated/spec/fixtures/hiera/single_node.yaml b/files/puppet/modules/pixelated/spec/fixtures/hiera/single_node.yaml deleted file mode 100644 index 0759bdf..0000000 --- a/files/puppet/modules/pixelated/spec/fixtures/hiera/single_node.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -domain: - full: pixelated.example.com - full_suffix: example.com - internal: pixelated.example.i - internal_suffix: example.i - name: pixelated.example.com -services: ["mx","pixelated"] - -webapp: - invite_required: true diff --git a/files/puppet/modules/pixelated/spec/fixtures/hiera/with_nagios.yaml b/files/puppet/modules/pixelated/spec/fixtures/hiera/with_nagios.yaml deleted file mode 100644 index 74b9031..0000000 --- a/files/puppet/modules/pixelated/spec/fixtures/hiera/with_nagios.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -domain: - full: pixelated.example.com - full_suffix: example.com - internal: pixelated.example.i - internal_suffix: example.i - name: pixelated.example.com -services: ["pixelated","monitor"] - diff --git a/files/puppet/modules/pixelated/spec/spec_helper.rb b/files/puppet/modules/pixelated/spec/spec_helper.rb deleted file mode 100644 index fb6ab97..0000000 --- a/files/puppet/modules/pixelated/spec/spec_helper.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'rspec-puppet' -require 'rspec-puppet-utils' -require 'puppetlabs_spec_helper/module_spec_helper' -require 'puppetlabs_spec_helper/puppetlabs_spec_helper' - -fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) - -RSpec.configure do |c| - c.module_path = File.join(fixture_path, 'modules') - c.manifest_dir = File.join(fixture_path, 'manifests') - c.hiera_config = 'spec/fixtures/hiera/hiera.yaml' -end |