SHARE
TWEET

Untitled

a guest Oct 10th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'spec_helper'
  2.  
  3. describe 'profiled::service' do
  4.   let(:node) { "this.is.only.used.for.unit.tests" }
  5.  
  6.   let :facts do
  7.     {
  8.       :hostname => 'rbbanner103',
  9.     }
  10.   end
  11.   let(:pre_condition) {[
  12.     'include profiled::install',
  13.     'include profiled::config',
  14.   ]}
  15.   let(:extra_facts) do
  16.     {}
  17.   end
  18.  
  19.   let(:params) do
  20.     {
  21.       enabled: true,
  22.     }
  23.   end
  24.  
  25.   it { is_expected.to compile }
  26.  
  27.   it do
  28.     is_expected.to contain_service('profiled').with(
  29.       ensure: true,
  30.       enable: true,
  31.       require: 'Class[Profiled::Install]',
  32.       subscribe: ['Class[Profiled::Install]', 'File[/usr/local/target/etc/profiled.conf]'],
  33.     )
  34.   end
  35.  
  36. end
  37.  
  38.  
  39.  
  40.  
  41. class profiled::install() {
  42.  
  43.     include rb::bannerd
  44.  
  45.     if ( $rb::bannerd::rbbanners[$hostname]['role'] == 'bannerd-beta' ) {
  46.         $http_config = rb_get_beta_package_info($hostname,"http://trgdev1.rbdev.mail.ru:9443/${hostname}.yaml")
  47.         $version = $http_config['profiled_version']
  48.     } else {
  49.         $version = $cache::versions['profiled']
  50.     }
  51.  
  52.     pkg { 'profiled':
  53.       version => $version,
  54.     }
  55.  
  56.     rbmon::role { "profiled": }
  57.     include base::users::target
  58.  
  59.     include compass::tarantool_context_iproto_ro_1
  60.     include compass::tarantool_context_iproto_ro_2
  61.     include compass::tarantool_context_iproto_ro_3
  62.     include compass::tarantool_context_iproto_ro_4
  63.     include compass::tarantool_context_iproto_ro_5
  64.     include compass::tarantool_context_iproto_ro_6
  65.     include compass::tarantool_context_iproto_ro_7
  66.     include compass::tarantool_context_iproto_ro_8
  67.     include compass::tarantool_context_iproto_ro_9
  68.     include compass::tarantool_context_iproto_ro_10
  69.     include compass::tarantool_context_iproto_ro_11
  70.     include compass::tarantool_context_iproto_ro_12
  71.     include compass::tarantool_context_iproto_ro_13
  72.     include compass::tarantool_context_iproto_ro_14
  73.     include compass::tarantool_context_iproto_ro_15
  74.     include compass::tarantool_context_iproto_ro_16
  75.  
  76.     file { "/var/log/profiled/" :
  77.         ensure  => directory,
  78.         owner   => "target",
  79.         group   => "target",
  80.         mode    => "0755",
  81.     }
  82. }
  83.  
  84.  
  85.  
  86.  bundle exec parallel_rspec -- ./spec/classes/profiled/service_spec.rb
  87. 1 processes for 1 specs, ~ 1 specs per process
  88. FF
  89.  
  90. Failures:
  91.  
  92.   1) profiled::service is expected to compile into a catalogue without dependency cycles
  93.      Failure/Error: it { is_expected.to compile }
  94.        error during compilation: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /Users/mikhail.petrov/gitroot/mail.ru/rb/rbpuppet/modules/profiled/manifests/install.pp, line: 9, column: 20) on node rbbanner103
  95.      # ./spec/classes/profiled/service_spec.rb:29:in `block (2 levels) in <top (required)>'
  96.  
  97.   2) profiled::service is expected to contain Service[profiled] with ensure => true, enable => true, require => "Class[Profiled::Install]" and subscribe => ["Class[Profiled::Install]", "File[/usr/local/target/etc/profiled.conf]"]
  98.      Failure/Error:
  99.        is_expected.to contain_service('profiled').with(
  100.          ensure: true,
  101.          enable: true,
  102.          require: 'Class[Profiled::Install]',
  103.          subscribe: ['Class[Profiled::Install]', 'File[/usr/local/target/etc/profiled.conf]'],
  104.        )
  105.  
  106.      Puppet::PreformattedError:
  107.        Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /Users/mikhail.petrov/gitroot/mail.ru/rb/rbpuppet/modules/profiled/manifests/install.pp, line: 9, column: 20) on node rbbanner103
  108.      # /Library/Ruby/Gems/2.3.0/gems/puppet-6.0.10/lib/puppet/pops/evaluator/runtime3_support.rb:39:in `optionally_fail'
  109.      # /Library/Ruby/Gems/2.3.0/gems/puppet-6.0.10/lib/puppet/pops/evaluator/runtime3_support.rb:21:in `fail'
  110.      # /Library/Ruby/Gems/2.3.0/gems/puppet-6.0.10/lib/puppet/pops/evaluator/access_operator.rb:35:in `access_Object'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top