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.

openstack-haproxy-radosgw_spec.rb 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # ROLE: primary-controller
  2. # ROLE: controller
  3. require 'spec_helper'
  4. require 'shared-examples'
  5. manifest = 'openstack-haproxy/openstack-haproxy-radosgw.pp'
  6. describe manifest do
  7. shared_examples 'catalog' do
  8. images_ceph = Noop.hiera_structure 'storage/images_ceph'
  9. objects_ceph = Noop.hiera_structure 'storage/objects_ceph'
  10. if images_ceph and objects_ceph and !Noop.hiera('external_lb', false)
  11. rgw_nodes = Noop.hiera_hash('ceph_rgw_nodes')
  12. let(:rgw_address_map) do
  13. Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', rgw_nodes, 'heat/api'
  14. end
  15. let(:ipaddresses) do
  16. rgw_address_map.values
  17. end
  18. let(:server_names) do
  19. rgw_address_map.keys
  20. end
  21. ironic_enabled = Noop.hiera_structure 'ironic/enabled'
  22. if ironic_enabled
  23. baremetal_virtual_ip = Noop.hiera_structure 'network_metadata/vips/baremetal/ipaddr'
  24. it 'should declare ::openstack::ha::radosgw class with baremetal_virtual_ip' do
  25. should contain_class('openstack::ha::radosgw').with(
  26. 'baremetal_virtual_ip' => baremetal_virtual_ip,
  27. )
  28. end
  29. it "should properly configure radosgw haproxy based on ssl" do
  30. public_ssl_radosgw = Noop.hiera_structure('public_ssl/services', false)
  31. should contain_openstack__ha__haproxy_service('object-storage').with(
  32. 'order' => '130',
  33. 'ipaddresses' => ipaddresses,
  34. 'server_names' => server_names,
  35. 'listen_port' => 8080,
  36. 'balancermember_port' => 6780,
  37. 'public' => true,
  38. 'public_ssl' => public_ssl_radosgw,
  39. 'require_service' => 'radosgw-api',
  40. 'haproxy_config_options' => {
  41. 'option' => ['httplog', 'httpchk GET /'],
  42. 'http-request' => 'set-header X-Forwarded-Proto https if { ssl_fc }',
  43. },
  44. )
  45. end
  46. it 'should declare openstack::ha::haproxy_service with name radosgw-baremetal' do
  47. should contain_openstack__ha__haproxy_service('object-storage-baremetal').with(
  48. 'order' => '135',
  49. 'ipaddresses' => ipaddresses,
  50. 'server_names' => server_names,
  51. 'listen_port' => 8080,
  52. 'balancermember_port' => 6780,
  53. 'public_virtual_ip' => false,
  54. 'internal_virtual_ip' => baremetal_virtual_ip,
  55. 'haproxy_config_options' => {
  56. 'option' => ['httplog', 'httpchk GET /'],
  57. 'http-request' => 'set-header X-Forwarded-Proto https if { ssl_fc }',
  58. },
  59. )
  60. end
  61. end
  62. end
  63. end # end of shared_examples
  64. test_ubuntu_and_centos manifest
  65. end