jdk_8_1221_spec.rb 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. require 'spec_helper_acceptance'
  2. describe 'jdk_8_1221' do
  3. if os[:platform] =~ /windows/
  4. else
  5. # Serverspec examples can be found at
  6. # http://serverspec.org/resource_types.html
  7. it 'Should apply the manifest without error' do
  8. pp = <<-EOS
  9. node default {
  10. include fmw_jdk::rng_service
  11. $java_home_dir = '/usr/java/jdk1.8.0_111'
  12. Class['fmw_wls::setup'] ->
  13. Class['fmw_wls::install']
  14. class { 'fmw_jdk::install':
  15. java_home_dir => $java_home_dir,
  16. source_file => '/software/jdk-8u111-linux-x64.tar.gz',
  17. }
  18. # can be removed when all the default are used.
  19. class { 'fmw_wls':
  20. version => '12.2.1.2',
  21. middleware_home_dir => '/opt/oracle/middleware_1221',
  22. os_user_uid => '600',
  23. }
  24. include fmw_wls::setup
  25. # this requires fmw_jdk::install
  26. class { 'fmw_wls::install':
  27. java_home_dir => $java_home_dir,
  28. source_file => '/software/fmw_12.2.1.2.0_infrastructure.jar',
  29. install_type => 'infra', # 'wls' is the default
  30. }
  31. # can be removed when all the default are used.
  32. class { 'fmw_inst':
  33. version => '12.2.1.2',
  34. java_home_dir => $java_home_dir,
  35. middleware_home_dir => '/opt/oracle/middleware_1221',
  36. }
  37. $files = ['/tmp/soa_suite','/tmp/service_bus']
  38. file{$files:
  39. ensure => absent,
  40. recurse => true,
  41. purge => true,
  42. force => true,
  43. }
  44. File[$files] ->
  45. Class['fmw_inst::soa_suite'] ->
  46. Class['fmw_inst::service_bus']
  47. # this requires fmw_wls::install
  48. class { 'fmw_inst::soa_suite':
  49. source_file => '/software/fmw_12.2.1.2.0_soa_Disk1_1of1.zip',
  50. }
  51. # this requires fmw_wls::install
  52. class { 'fmw_inst::service_bus':
  53. source_file => '/software/fmw_12.2.1.2.0_osb_Disk1_1of1.zip',
  54. }
  55. }
  56. EOS
  57. # Run it twice and test for idempotency
  58. apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
  59. apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
  60. # expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
  61. shell('sleep 15')
  62. end
  63. describe file('/usr/java/jdk1.8.0_111') do
  64. it { should be_directory }
  65. it { should be_owned_by 'root' }
  66. end
  67. describe file('/usr/java/jdk1.8.0_111/bin/java') do
  68. it { should be_file }
  69. it { should be_owned_by 'root' }
  70. it { should be_executable }
  71. end
  72. describe file('/usr/bin/java') do
  73. it { should be_symlink }
  74. it { should be_linked_to '/etc/alternatives/java' }
  75. end
  76. describe group('oinstall') do
  77. it { should exist }
  78. end
  79. describe user('oracle') do
  80. it { should belong_to_group 'oinstall' }
  81. it { should have_home_directory '/home/oracle' }
  82. it { should have_login_shell '/bin/bash' }
  83. end
  84. describe file('/etc/oraInst.loc') do
  85. it { should be_file }
  86. it { should be_owned_by 'root' }
  87. it { should be_readable.by('others') }
  88. it { should contain 'inventory_loc=/home/oracle/oraInventory' }
  89. it { should contain 'inst_group=oinstall' }
  90. end
  91. describe file('/tmp/wls_12c.rsp') do
  92. it { should be_file }
  93. it { should contain 'ORACLE_HOME=/opt/oracle/middleware_1221' }
  94. it { should contain 'INSTALL_TYPE=Fusion Middleware Infrastructure' }
  95. end
  96. describe file('/home/oracle/oraInventory') do
  97. it { should be_directory }
  98. it { should be_owned_by 'oracle' }
  99. it { should be_grouped_into 'oinstall' }
  100. end
  101. describe file('/opt/oracle/middleware_1221') do
  102. it { should be_directory }
  103. it { should be_owned_by 'oracle' }
  104. it { should be_grouped_into 'oinstall' }
  105. end
  106. describe file('/opt/oracle/middleware_1221/oracle_common/common/bin/wlst.sh') do
  107. it { should be_file }
  108. it { should be_owned_by 'oracle' }
  109. it { should be_grouped_into 'oinstall' }
  110. it { should be_executable }
  111. end
  112. describe file('/opt/oracle/middleware_1221/oracle_common/bin/rcu') do
  113. it { should be_file }
  114. it { should be_owned_by 'oracle' }
  115. it { should be_grouped_into 'oinstall' }
  116. it { should be_executable }
  117. end
  118. describe file('/opt/oracle/middleware_1221/soa/bin') do
  119. it { should be_directory }
  120. it { should be_owned_by 'oracle' }
  121. it { should be_grouped_into 'oinstall' }
  122. end
  123. describe file('/opt/oracle/middleware_1221/osb/bin') do
  124. it { should be_directory }
  125. it { should be_owned_by 'oracle' }
  126. it { should be_grouped_into 'oinstall' }
  127. end
  128. end
  129. end