server_spec.rb 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. require 'spec_helper'
  2. describe 'puppetdb::server', :type => :class do
  3. basefacts =
  4. {
  5. :osfamily => 'RedHat',
  6. :operatingsystem => 'RedHat',
  7. :operatingsystemrelease => '6.5',
  8. :fqdn => 'test.domain.local',
  9. :kernel => 'Linux',
  10. :selinux => true,
  11. }
  12. context 'on a supported platform' do
  13. let(:facts) do
  14. basefacts
  15. end
  16. describe 'when using default values' do
  17. it { should contain_class('puppetdb::server') }
  18. it { should contain_class('puppetdb::server::global') }
  19. it { should contain_class('puppetdb::server::command_processing') }
  20. it { should contain_class('puppetdb::server::database') }
  21. it { should contain_class('puppetdb::server::read_database') }
  22. it { should contain_class('puppetdb::server::jetty') }
  23. it { should contain_class('puppetdb::server::puppetdb') }
  24. end
  25. describe 'when not specifying JAVA_ARGS' do
  26. it { should_not contain_ini_subsetting('Xms') }
  27. end
  28. describe 'when specifying JAVA_ARGS' do
  29. let(:params) do
  30. {
  31. 'java_args' => {
  32. '-Xms' => '2g',
  33. }
  34. }
  35. end
  36. context 'on standard PuppetDB' do
  37. it { should contain_ini_subsetting("'-Xms'").
  38. with(
  39. 'ensure' => 'present',
  40. 'path' => '/etc/sysconfig/puppetdb',
  41. 'section' => '',
  42. 'key_val_separator' => '=',
  43. 'setting' => 'JAVA_ARGS',
  44. 'subsetting' => '-Xms',
  45. 'value' => '2g'
  46. )}
  47. end
  48. end
  49. describe 'when specifying JAVA_ARGS with merge_default_java_args false' do
  50. let (:params) do
  51. {
  52. 'java_args' => {'-Xms' => '2g'},
  53. 'merge_default_java_args' => false,
  54. }
  55. end
  56. context 'on standard PuppetDB' do
  57. it { should contain_ini_setting('java_args').
  58. with(
  59. 'ensure' => 'present',
  60. 'path' => '/etc/sysconfig/puppetdb',
  61. 'section' => '',
  62. 'setting' => 'JAVA_ARGS',
  63. 'value' => '"-Xms2g"'
  64. )}
  65. end
  66. end
  67. end
  68. end