|
| 1 | +require 'spec_helper' |
| 2 | + |
| 3 | +describe 'swift::proxy::crossdomain' do |
| 4 | + |
| 5 | + let :facts do |
| 6 | + { |
| 7 | + :concat_basedir => '/var/lib/puppet/concat' |
| 8 | + } |
| 9 | + end |
| 10 | + |
| 11 | + let :pre_condition do |
| 12 | + 'class { "concat::setup": } |
| 13 | + concat { "/etc/swift/proxy-server.conf": }' |
| 14 | + end |
| 15 | + |
| 16 | + let :fragment_file do |
| 17 | + "/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/35_swift_crossdomain" |
| 18 | + end |
| 19 | + |
| 20 | + describe "when using default parameters" do |
| 21 | + it 'should build the fragment with correct parameters' do |
| 22 | + verify_contents(subject, fragment_file, |
| 23 | + [ |
| 24 | + '[filter:crossdomain]', |
| 25 | + 'use = egg:swift#crossdomain', |
| 26 | + 'cross_domain_policy = <allow-access-from domain="*" secure="false" />', |
| 27 | + ] |
| 28 | + ) |
| 29 | + end |
| 30 | + end |
| 31 | + |
| 32 | + describe "when overriding default parameters" do |
| 33 | + let :params do |
| 34 | + { |
| 35 | + :cross_domain_policy => '<allow-access-from domain="xml-fragment-in-ini-file.so.wrong" secure="true" /> |
| 36 | +<allow-access-from domain="*" secure="false" />', |
| 37 | + } |
| 38 | + end |
| 39 | + it 'should build the fragment with correct parameters' do |
| 40 | + verify_contents(subject, fragment_file, |
| 41 | + [ |
| 42 | + '[filter:crossdomain]', |
| 43 | + 'use = egg:swift#crossdomain', |
| 44 | + 'cross_domain_policy = <allow-access-from domain="xml-fragment-in-ini-file.so.wrong" secure="true" />', |
| 45 | + '<allow-access-from domain="*" secure="false" />', |
| 46 | + ] |
| 47 | + ) |
| 48 | + end |
| 49 | + end |
| 50 | + |
| 51 | +end |
0 commit comments