jdk_7_1213_spec.rb 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. require 'spec_helper_acceptance'
  2. describe 'jdk_7_1213' 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. 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-7u79-linux-x64.tar.gz',
  17. }
  18. # # can be removed when all the default are used.
  19. # class { 'fmw_wls':
  20. # version => '12.1.3', # this is also the default
  21. # middleware_home_dir => '/opt/oracle/middleware_1213',
  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.1.3.0.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.1.3', # this is also the default
  34. # java_home_dir => $java_home_dir,
  35. # middleware_home_dir => '/opt/oracle/middleware_1213',
  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.1.3.0.0_soa_Disk1_1of1.zip',
  50. # }
  51. # # this requires fmw_wls::install
  52. # class { 'fmw_inst::service_bus':
  53. # source_file => '/software/fmw_12.1.3.0.0_osb_Disk1_1of1.zip',
  54. # }
  55. # # this requires fmw_wls::install
  56. # class { 'fmw_inst::mft':
  57. # source_file => '/software/fmw_12.1.3.0.0_mft_Disk1_1of1.zip',
  58. # }
  59. }
  60. EOS
  61. # Run it twice and test for idempotency
  62. apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
  63. apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
  64. # expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
  65. shell('sleep 15')
  66. end
  67. describe file('/usr/java/jdk1.7.0_79') do
  68. it { should be_directory }
  69. it { should be_owned_by 'root' }
  70. end
  71. describe file('/usr/java/jdk1.7.0_79/bin/java') do
  72. it { should be_file }
  73. it { should be_owned_by 'root' }
  74. it { should be_executable }
  75. end
  76. describe file('/usr/bin/java') do
  77. it { should be_symlink }
  78. it { should be_linked_to '/etc/alternatives/java' }
  79. end
  80. # describe group('oinstall') do
  81. # it { should exist }
  82. # end
  83. # describe user('oracle') do
  84. # it { should belong_to_group 'oinstall' }
  85. # it { should have_home_directory '/home/oracle' }
  86. # it { should have_login_shell '/bin/bash' }
  87. # end
  88. # describe file('/etc/oraInst.loc') do
  89. # it { should be_file }
  90. # it { should be_owned_by 'root' }
  91. # it { should be_readable.by('others') }
  92. # it { should contain 'inventory_loc=/home/oracle/oraInventory' }
  93. # it { should contain 'inst_group=oinstall' }
  94. # end
  95. # describe file('/tmp/wls_12c.rsp') do
  96. # it { should be_file }
  97. # it { should contain 'ORACLE_HOME=/opt/oracle/middleware_1213' }
  98. # it { should contain 'INSTALL_TYPE=Fusion Middleware Infrastructure' }
  99. # end
  100. # describe file('/home/oracle/oraInventory') do
  101. # it { should be_directory }
  102. # it { should be_owned_by 'oracle' }
  103. # it { should be_grouped_into 'oinstall' }
  104. # end
  105. # describe file('/opt/oracle/middleware_1213') do
  106. # it { should be_directory }
  107. # it { should be_owned_by 'oracle' }
  108. # it { should be_grouped_into 'oinstall' }
  109. # end
  110. # describe file('/opt/oracle/middleware_1213/oracle_common/common/bin/wlst.sh') do
  111. # it { should be_file }
  112. # it { should be_owned_by 'oracle' }
  113. # it { should be_grouped_into 'oinstall' }
  114. # it { should be_executable }
  115. # end
  116. # describe file('/opt/oracle/middleware_1213/oracle_common/bin/rcu') do
  117. # it { should be_file }
  118. # it { should be_owned_by 'oracle' }
  119. # it { should be_grouped_into 'oinstall' }
  120. # it { should be_executable }
  121. # end
  122. # describe file('/opt/oracle/middleware_1213/soa/bin') do
  123. # it { should be_directory }
  124. # it { should be_owned_by 'oracle' }
  125. # it { should be_grouped_into 'oinstall' }
  126. # end
  127. # describe file('/opt/oracle/middleware_1213/osb/bin') do
  128. # it { should be_directory }
  129. # it { should be_owned_by 'oracle' }
  130. # it { should be_grouped_into 'oinstall' }
  131. # end
  132. end
  133. end