|
19 | 19 | describe 'apt::source default values' do |
20 | 20 | it 'should add a repo with defaults values' do |
21 | 21 | should contain_apt__source('rabbitmq').with( { |
| 22 | + :ensure => 'present', |
| 23 | + :location => 'http://www.rabbitmq.com/debian/', |
| 24 | + :release => 'testing', |
| 25 | + :repos => 'main', |
| 26 | + }) |
| 27 | + end |
| 28 | + end |
| 29 | + end |
| 30 | + |
| 31 | + context 'on Debian' do |
| 32 | + let(:params) {{ :manage_repos => false }} |
| 33 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 34 | + it 'does ensure rabbitmq apt::source is absent when manage_repos is false' do |
| 35 | + should_not contain_apt__source('rabbitmq') |
| 36 | + end |
| 37 | + end |
| 38 | + |
| 39 | + context 'on Debian' do |
| 40 | + let(:params) {{ :manage_repos => true }} |
| 41 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 42 | + |
| 43 | + it 'includes rabbitmq::repo::apt' do |
| 44 | + should contain_class('rabbitmq::repo::apt') |
| 45 | + end |
| 46 | + |
| 47 | + describe 'apt::source default values' do |
| 48 | + it 'should add a repo with defaults values' do |
| 49 | + should contain_apt__source('rabbitmq').with( { |
| 50 | + :ensure => 'present', |
22 | 51 | :location => 'http://www.rabbitmq.com/debian/', |
23 | 52 | :release => 'testing', |
24 | 53 | :repos => 'main', |
|
30 | 59 | context 'on Debian' do |
31 | 60 | let(:params) {{ :repos_ensure => false }} |
32 | 61 | let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
33 | | - it 'does ensure rabbitmq apt::source is absent when repos_ensure is false' do |
| 62 | + it 'does ensure rabbitmq apt::source is absent when repos_ensure is false' do |
34 | 63 | should contain_apt__source('rabbitmq').with( |
35 | 64 | 'ensure' => 'absent' |
36 | 65 | ) |
37 | 66 | end |
38 | 67 | end |
39 | 68 |
|
| 69 | + context 'on Debian' do |
| 70 | + let(:params) {{ :repos_ensure => true }} |
| 71 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 72 | + |
| 73 | + it 'includes rabbitmq::repo::apt' do |
| 74 | + should contain_class('rabbitmq::repo::apt') |
| 75 | + end |
| 76 | + |
| 77 | + describe 'apt::source default values' do |
| 78 | + it 'should add a repo with defaults values' do |
| 79 | + should contain_apt__source('rabbitmq').with( { |
| 80 | + :ensure => 'present', |
| 81 | + :location => 'http://www.rabbitmq.com/debian/', |
| 82 | + :release => 'testing', |
| 83 | + :repos => 'main', |
| 84 | + }) |
| 85 | + end |
| 86 | + end |
| 87 | + end |
| 88 | + |
| 89 | + context 'on Debian' do |
| 90 | + let(:params) {{ :manage_repos => true, :repos_ensure => false }} |
| 91 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 92 | + |
| 93 | + it 'includes rabbitmq::repo::apt' do |
| 94 | + should contain_class('rabbitmq::repo::apt') |
| 95 | + end |
| 96 | + |
| 97 | + describe 'apt::source default values' do |
| 98 | + it 'should add a repo with defaults values' do |
| 99 | + should contain_apt__source('rabbitmq').with( { |
| 100 | + :ensure => 'absent', |
| 101 | + }) |
| 102 | + end |
| 103 | + end |
| 104 | + end |
| 105 | + |
| 106 | + context 'on Debian' do |
| 107 | + let(:params) {{ :manage_repos => true, :repos_ensure => true }} |
| 108 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 109 | + |
| 110 | + it 'includes rabbitmq::repo::apt' do |
| 111 | + should contain_class('rabbitmq::repo::apt') |
| 112 | + end |
| 113 | + |
| 114 | + describe 'apt::source default values' do |
| 115 | + it 'should add a repo with defaults values' do |
| 116 | + should contain_apt__source('rabbitmq').with( { |
| 117 | + :ensure => 'present', |
| 118 | + :location => 'http://www.rabbitmq.com/debian/', |
| 119 | + :release => 'testing', |
| 120 | + :repos => 'main', |
| 121 | + }) |
| 122 | + end |
| 123 | + end |
| 124 | + end |
| 125 | + |
| 126 | + context 'on Debian' do |
| 127 | + let(:params) {{ :manage_repos => false, :repos_ensure => true }} |
| 128 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 129 | + it 'does ensure rabbitmq apt::source is absent when manage_repos is false and repos_ensure is true' do |
| 130 | + should_not contain_apt__source('rabbitmq') |
| 131 | + end |
| 132 | + end |
| 133 | + |
| 134 | + context 'on Debian' do |
| 135 | + let(:params) {{ :manage_repos => false, :repos_ensure => false }} |
| 136 | + let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }} |
| 137 | + it 'does ensure rabbitmq apt::source is absent when manage_repos is false and repos_ensure is false' do |
| 138 | + should_not contain_apt__source('rabbitmq') |
| 139 | + end |
| 140 | + end |
| 141 | + |
40 | 142 | context 'on Redhat' do |
41 | 143 | let(:facts) {{ :osfamily => 'RedHat' }} |
42 | 144 | it 'includes rabbitmq::repo::rhel' do |
43 | 145 | should contain_class('rabbitmq::repo::rhel') |
| 146 | + should contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
44 | 147 | end |
45 | 148 | end |
46 | 149 |
|
47 | 150 | context 'on Redhat' do |
48 | 151 | let(:params) {{ :repos_ensure => false }} |
49 | 152 | let(:facts) {{ :osfamily => 'RedHat' }} |
50 | 153 | it 'does not import repo public key when repos_ensure is false' do |
| 154 | + should contain_class('rabbitmq::repo::rhel') |
| 155 | + should_not contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 156 | + end |
| 157 | + end |
| 158 | + |
| 159 | + context 'on Redhat' do |
| 160 | + let(:params) {{ :repos_ensure => true }} |
| 161 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 162 | + it 'does import repo public key when repos_ensure is true' do |
| 163 | + should contain_class('rabbitmq::repo::rhel') |
| 164 | + should contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 165 | + end |
| 166 | + end |
| 167 | + |
| 168 | + context 'on Redhat' do |
| 169 | + let(:params) {{ :manage_repos => false }} |
| 170 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 171 | + it 'does not import repo public key when manage_repos is false' do |
| 172 | + should_not contain_class('rabbitmq::repo::rhel') |
| 173 | + should_not contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 174 | + end |
| 175 | + end |
| 176 | + |
| 177 | + context 'on Redhat' do |
| 178 | + let(:params) {{ :manage_repos => true }} |
| 179 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 180 | + it 'does import repo public key when manage_repos is true' do |
| 181 | + should contain_class('rabbitmq::repo::rhel') |
| 182 | + should contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 183 | + end |
| 184 | + end |
| 185 | + |
| 186 | + context 'on Redhat' do |
| 187 | + let(:params) {{ :manage_repos => false, :repos_ensure => true }} |
| 188 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 189 | + it 'does not import repo public key when manage_repos is false and repos_ensure is true' do |
| 190 | + should_not contain_class('rabbitmq::repo::rhel') |
| 191 | + should_not contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 192 | + end |
| 193 | + end |
| 194 | + |
| 195 | + context 'on Redhat' do |
| 196 | + let(:params) {{ :manage_repos => true, :repos_ensure => true }} |
| 197 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 198 | + it 'does import repo public key when manage_repos is true and repos_ensure is true' do |
| 199 | + should contain_class('rabbitmq::repo::rhel') |
| 200 | + should contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 201 | + end |
| 202 | + end |
| 203 | + |
| 204 | + context 'on Redhat' do |
| 205 | + let(:params) {{ :manage_repos => false, :repos_ensure => false }} |
| 206 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 207 | + it 'does not import repo public key when manage_repos is false and repos_ensure is false' do |
| 208 | + should_not contain_class('rabbitmq::repo::rhel') |
| 209 | + should_not contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
| 210 | + end |
| 211 | + end |
| 212 | + |
| 213 | + context 'on Redhat' do |
| 214 | + let(:params) {{ :manage_repos => true, :repos_ensure => false }} |
| 215 | + let(:facts) {{ :osfamily => 'RedHat' }} |
| 216 | + it 'does not import repo public key when manage_repos is true and repos_ensure is false' do |
| 217 | + should contain_class('rabbitmq::repo::rhel') |
51 | 218 | should_not contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc') |
52 | 219 | end |
53 | 220 | end |
|
0 commit comments