jdk_7_1036_spec.rb 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. require 'spec_helper_acceptance'
  2. describe 'jdk_7_1036' 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.7.0_79'
  12. $version = '10.3.6'
  13. $middleware_home_dir = '/opt/oracle/middleware_1036'
  14. Class['fmw_wls::setup'] ->
  15. Class['fmw_wls::install']
  16. class { 'fmw_jdk::install':
  17. java_home_dir => $java_home_dir,
  18. source_file => '/software/jdk-7u79-linux-x64.tar.gz',
  19. }
  20. # # can be removed when all the default are used.
  21. # class { 'fmw_wls':
  22. # version => $version,
  23. # middleware_home_dir => $middleware_home_dir,
  24. # os_user_uid => '600',
  25. # }
  26. # include fmw_wls::setup
  27. # # this requires fmw_jdk::install
  28. # class { 'fmw_wls::install':
  29. # java_home_dir => $java_home_dir,
  30. # source_file => '/software/wls1036_generic.jar',
  31. # }
  32. # # this requires fmw_wls::install
  33. # class { 'fmw_bsu::weblogic':
  34. # version => $version,
  35. # middleware_home_dir => $middleware_home_dir,
  36. # patch_id => 'YUIS',
  37. # source_file => '/software/p20181997_1036_Generic.zip',
  38. # }
  39. # # can be removed when all the default are used.
  40. # class { 'fmw_inst':
  41. # version => $version,
  42. # java_home_dir => $java_home_dir,
  43. # middleware_home_dir => $middleware_home_dir,
  44. # }
  45. # $files = ['/tmp/webcenter','/tmp/soa_suite','/tmp/service_bus']
  46. # file{$files:
  47. # ensure => absent,
  48. # recurse => true,
  49. # purge => true,
  50. # force => true,
  51. # }
  52. # Class['fmw_bsu::weblogic'] ->
  53. # File[$files] ->
  54. # Class['fmw_inst::webcenter'] ->
  55. # Class['fmw_inst::soa_suite'] ->
  56. # Class['fmw_inst::service_bus']
  57. # # this requires fmw_wls::install
  58. # class { 'fmw_inst::webcenter':
  59. # source_file => '/software/ofm_wc_generic_11.1.1.9.0_disk1_1of2.zip',
  60. # source_2_file => '/software/ofm_wc_generic_11.1.1.9.0_disk1_2of2.zip',
  61. # }
  62. # # this requires fmw_wls::install
  63. # class { 'fmw_inst::soa_suite':
  64. # source_file => '/software/ofm_soa_generic_11.1.1.7.0_disk1_1of2.zip',
  65. # source_2_file => '/software/ofm_soa_generic_11.1.1.7.0_disk1_2of2.zip',
  66. # }
  67. # class { 'fmw_inst::service_bus':
  68. # source_file => '/software/ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip',
  69. # }
  70. }
  71. EOS
  72. # Run it twice and test for idempotency
  73. apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
  74. apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
  75. # expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
  76. shell('sleep 15')
  77. end
  78. describe file('/usr/java/jdk1.7.0_79') do
  79. it { should be_directory }
  80. it { should be_owned_by 'root' }
  81. end
  82. describe file('/usr/java/jdk1.7.0_79/bin/java') do
  83. it { should be_file }
  84. it { should be_owned_by 'root' }
  85. it { should be_executable }
  86. end
  87. describe file('/usr/bin/java') do
  88. it { should be_symlink }
  89. it { should be_linked_to '/etc/alternatives/java' }
  90. end
  91. # describe group('oinstall') do
  92. # it { should exist }
  93. # end
  94. # describe user('oracle') do
  95. # it { should belong_to_group 'oinstall' }
  96. # it { should have_home_directory '/home/oracle' }
  97. # it { should have_login_shell '/bin/bash' }
  98. # end
  99. # describe file('/etc/oraInst.loc') do
  100. # it { should be_file }
  101. # it { should be_owned_by 'root' }
  102. # it { should be_readable.by('others') }
  103. # it { should contain 'inventory_loc=/home/oracle/oraInventory' }
  104. # it { should contain 'inst_group=oinstall' }
  105. # end
  106. # describe file('/tmp/wls_11g.rsp') do
  107. # it { should be_file }
  108. # it { should contain '<data-value name="BEAHOME" value="/opt/oracle/middleware_1036" />' }
  109. # end
  110. # describe file('/home/oracle/oraInventory') do
  111. # it { should be_directory }
  112. # it { should be_owned_by 'oracle' }
  113. # it { should be_grouped_into 'oinstall' }
  114. # end
  115. # describe file('/opt/oracle/middleware_1036') do
  116. # it { should be_directory }
  117. # it { should be_owned_by 'oracle' }
  118. # it { should be_grouped_into 'oinstall' }
  119. # end
  120. # describe file('/opt/oracle/middleware_1036/wlserver_10.3/common/bin/wlst.sh') do
  121. # it { should be_file }
  122. # it { should be_owned_by 'oracle' }
  123. # it { should be_grouped_into 'oinstall' }
  124. # it { should be_executable }
  125. # end
  126. # describe file('/opt/oracle/middleware_1036/Oracle_OSB1') do
  127. # it { should be_directory }
  128. # it { should be_owned_by 'oracle' }
  129. # it { should be_grouped_into 'oinstall' }
  130. # end
  131. # describe file('/opt/oracle/middleware_1036/Oracle_SOA1') do
  132. # it { should be_directory }
  133. # it { should be_owned_by 'oracle' }
  134. # it { should be_grouped_into 'oinstall' }
  135. # end
  136. # describe file('/opt/oracle/middleware_1036/Oracle_WC1') do
  137. # it { should be_directory }
  138. # it { should be_owned_by 'oracle' }
  139. # it { should be_grouped_into 'oinstall' }
  140. # end
  141. # describe file('/opt/oracle/middleware_1036/oracle_common') do
  142. # it { should be_directory }
  143. # it { should be_owned_by 'oracle' }
  144. # it { should be_grouped_into 'oinstall' }
  145. # end
  146. end
  147. end