summaryrefslogtreecommitdiff
path: root/files/puppet/modules/pixelated/spec/classes/tests_spec.rb
blob: be69cf2b650c7d1b71107923563a892be822fa0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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/) >> /var/log/check_mk_jobs.log 2>&1"
      )
    end
  end
end