Fuel Library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

radosgw_spec.rb 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # ROLE: primary-controller
  2. # ROLE: controller
  3. require 'spec_helper'
  4. require 'shared-examples'
  5. manifest = 'ceph/radosgw.pp'
  6. describe manifest do
  7. shared_examples 'catalog' do
  8. radosgw_enabled = Noop.hiera_structure('storage/objects_ceph', false)
  9. ssl_hash = Noop.hiera_structure('use_ssl', {})
  10. storage_hash = Noop.hiera_hash 'storage'
  11. rgw_large_pool_name = '.rgw'
  12. rgw_large_pool_pg_nums = storage_hash['per_pool_pg_nums'][rgw_large_pool_name]
  13. auth_s3_keystone_ceph = storage_hash['auth_s3_keystone_ceph']
  14. rgw_id = 'radosgw.gateway'
  15. radosgw_auth_key = "client.#{rgw_id}"
  16. let(:gateway_name) {
  17. 'radosgw.gateway'
  18. }
  19. let(:fsid) {
  20. Noop.hiera_structure 'storage/fsid', '066F558C-6789-4A93-AAF1-5AF1BA01A3AD'
  21. }
  22. let(:ssl_hash) { Noop.hiera_hash 'use_ssl', {} }
  23. let(:service_endpoint) {
  24. Noop.hiera_structure 'service_endpoint'
  25. }
  26. let(:admin_identity_protocol) {
  27. Noop.puppet_function 'get_ssl_property',ssl_hash,{},'keystone',
  28. 'admin','protocol','http'
  29. }
  30. let(:admin_identity_address) {
  31. Noop.puppet_function 'get_ssl_property',ssl_hash,{},'keystone','admin',
  32. 'hostname',
  33. [Noop.hiera('service_endpoint', Noop.hiera('management_vip'))]
  34. }
  35. let(:admin_identity_url) {
  36. "#{admin_identity_protocol}://#{admin_identity_address}:35357"
  37. }
  38. let(:radosgw_key) do
  39. Noop.hiera_structure 'storage/radosgw_key', 'AQCTg71RsNIHORAAW+O6FCMZWBjmVfMIPk3MhQ=='
  40. end
  41. let(:rgw_init_timeout) {
  42. Noop.hiera_structure 'storage/rgw_init_timeout', '360000'
  43. }
  44. if radosgw_enabled
  45. it 'should add radosgw key' do
  46. should contain_ceph__key("client.#{gateway_name}").with(
  47. 'user' => 'ceph',
  48. 'group' => 'ceph',
  49. 'secret' => radosgw_key,
  50. 'cap_mon' => 'allow rw',
  51. 'cap_osd' => 'allow rwx',
  52. 'inject' => true,
  53. )
  54. end
  55. it 'should deploy ceph' do
  56. should contain_class('ceph').with(
  57. 'fsid' => fsid,
  58. )
  59. end
  60. it 'should contain ceph::rgw' do
  61. should contain_ceph__rgw(gateway_name).with(
  62. 'frontend_type' => 'apache-proxy-fcgi',
  63. )
  64. end
  65. it 'should configure radosgw keystone' do
  66. should contain_ceph__rgw__keystone(gateway_name).with(
  67. 'rgw_keystone_url' => admin_identity_url,
  68. 'rgw_s3_auth_use_keystone' => auth_s3_keystone_ceph,
  69. 'use_pki' => false,
  70. )
  71. end
  72. it 'should set rgw_init_timeout' do
  73. should contain_ceph_config('client.radosgw.gateway/rgw_init_timeout').with(:value => rgw_init_timeout)
  74. end
  75. it { should contain_exec("Create #{rgw_large_pool_name} pool").with(
  76. :command => "ceph -n #{radosgw_auth_key} osd pool create #{rgw_large_pool_name} #{rgw_large_pool_pg_nums} #{rgw_large_pool_pg_nums}",
  77. :unless => "rados lspools | grep '^#{rgw_large_pool_name}$'"
  78. )
  79. }
  80. end
  81. end
  82. test_ubuntu_and_centos manifest
  83. end