|
101 | 101 | is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content(
|
102 | 102 | %r{Acquire::http::proxy "http://localhost:8080/";},
|
103 | 103 | ).without_content(
|
104 |
| - %r{Acquire::https::proxy}, |
| 104 | + %r{Acquire::https::proxy }, |
| 105 | + ) |
| 106 | + } |
| 107 | + end |
| 108 | + |
| 109 | + context 'when host=localhost and per-host[proxyscope]=proxyhost' do |
| 110 | + let(:params) { { proxy: { 'host' => 'localhost', 'perhost' => [{ 'scope' => 'proxyscope', 'host' => 'proxyhost' }] } } } |
| 111 | + |
| 112 | + it { |
| 113 | + is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( |
| 114 | + %r{Acquire::http::proxy::proxyscope "http://proxyhost:8080/";}, |
| 115 | + ) |
| 116 | + } |
| 117 | + end |
| 118 | + |
| 119 | + context 'when host=localhost and per-host[proxyscope]=proxyhost:8081' do |
| 120 | + let(:params) { { proxy: { 'host' => 'localhost', 'perhost' => [{ 'scope' => 'proxyscope', 'host' => 'proxyhost', 'port' => 8081 }] } } } |
| 121 | + |
| 122 | + it { |
| 123 | + is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( |
| 124 | + %r{Acquire::http::proxy::proxyscope "http://proxyhost:8081/";}, |
| 125 | + ) |
| 126 | + } |
| 127 | + end |
| 128 | + |
| 129 | + context 'when host=localhost and per-host[proxyscope]=[https]proxyhost' do |
| 130 | + let(:params) { { proxy: { 'host' => 'localhost', 'perhost' => [{ 'scope' => 'proxyscope', 'host' => 'proxyhost', 'https' => true }] } } } |
| 131 | + |
| 132 | + it { |
| 133 | + is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( |
| 134 | + %r{Acquire::https::proxy::proxyscope "https://proxyhost:8080/";}, |
| 135 | + ) |
| 136 | + } |
| 137 | + end |
| 138 | + |
| 139 | + context 'when host=localhost and per-host[proxyscope]=[direct]' do |
| 140 | + let(:params) { { proxy: { 'host' => 'localhost', 'perhost' => [{ 'scope' => 'proxyscope', 'direct' => true }] } } } |
| 141 | + |
| 142 | + it { |
| 143 | + is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( |
| 144 | + %r{Acquire::http::proxy::proxyscope "DIRECT";}, |
| 145 | + ) |
| 146 | + } |
| 147 | + end |
| 148 | + |
| 149 | + context 'when host=localhost and per-host[proxyscope]=[https][direct]' do |
| 150 | + let(:params) { { proxy: { 'host' => 'localhost', 'perhost' => [{ 'scope' => 'proxyscope', 'https' => true, 'direct' => true }] } } } |
| 151 | + |
| 152 | + it { |
| 153 | + is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( |
| 154 | + %r{Acquire::https::proxy::proxyscope "DIRECT";}, |
| 155 | + ) |
| 156 | + } |
| 157 | + end |
| 158 | + |
| 159 | + context 'when host=localhost and per-host[proxyscope]=proxyhost and per-host[proxyscope2]=proxyhost2' do |
| 160 | + let(:params) { { proxy: { 'host' => 'localhost', 'perhost' => [{ 'scope' => 'proxyscope', 'host' => 'proxyhost' }, { 'scope' => 'proxyscope2', 'host' => 'proxyhost2' }] } } } |
| 161 | + |
| 162 | + it { |
| 163 | + is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content( |
| 164 | + %r{Acquire::http::proxy::proxyscope "http://proxyhost:8080/";}, |
| 165 | + ).with_content( |
| 166 | + %r{Acquire::http::proxy::proxyscope2 "http://proxyhost2:8080/";}, |
105 | 167 | )
|
106 | 168 | }
|
107 | 169 | end
|
|
113 | 175 | is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content(
|
114 | 176 | %r{Acquire::http::proxy "http://localhost:8180/";},
|
115 | 177 | ).without_content(
|
116 |
| - %r{Acquire::https::proxy}, |
| 178 | + %r{Acquire::https::proxy }, |
117 | 179 | )
|
118 | 180 | }
|
119 | 181 | end
|
|
0 commit comments