setup_spec.rb 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. require 'spec_helper'
  2. describe 'fmw_wls::setup' , :type => :class do
  3. describe 'When all attributes are default, on an unspecified platform' do
  4. it do
  5. expect { should contain_package('xxx')
  6. }.to raise_error(Puppet::Error, /Unrecognized operating system, use this class on a Linux or Solaris host/)
  7. end
  8. end
  9. describe 'When all attributes are default, on CentOS platform' do
  10. let(:facts) {{ operatingsystem: 'CentOS',
  11. kernel: 'Linux',
  12. osfamily: 'RedHat',
  13. operatingsystemmajrelease: '7' }}
  14. it { should contain_group('oinstall') }
  15. it { should contain_user('oracle').with(
  16. uid: 500,
  17. gid: 'oinstall',
  18. groups: 'oinstall',
  19. shell: '/bin/bash',
  20. home: '/home/oracle',
  21. ).that_requires('Group[oinstall]')
  22. }
  23. end
  24. describe 'When all attributes are default, on a Solaris platform' do
  25. let(:facts) {{ operatingsystem: 'Solaris',
  26. kernel: 'SunOS',
  27. osfamily: 'SunOS',
  28. operatingsystemmajrelease: '5.11' }}
  29. it { should contain_group('oinstall') }
  30. it { should contain_user('oracle').with(
  31. uid: 500,
  32. gid: 'oinstall',
  33. groups: 'oinstall',
  34. shell: '/bin/bash',
  35. home: '/export/home/oracle',
  36. ).that_requires('Group[oinstall]')
  37. }
  38. end
  39. end