|
221 | 221 | it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^key-direction 1$}) } |
222 | 222 | it { is_expected.not_to contain_file('/etc/openvpn/test_client.conf').with_content(%r{nobind}) } |
223 | 223 | it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^port\s+\d+$}) } |
| 224 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').without_content(%r{^remote-random-hostname$}) } |
| 225 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').without_content(%r{^remote-random$}) } |
| 226 | + |
| 227 | + it { is_expected.not_to contain_openvpn__ca('test_client') } |
| 228 | + |
| 229 | + case facts[:os]['family'] |
| 230 | + when 'RedHat' |
| 231 | + it { |
| 232 | + is_expected.to contain_file('/etc/openvpn/test_client/keys'). |
| 233 | + with(ensure: 'directory', mode: '0750', group: 'nobody') |
| 234 | + } |
| 235 | + end |
| 236 | + end |
| 237 | + |
| 238 | + context 'creating a server in client mode with multiple remotes and random' do |
| 239 | + let(:title) { 'test_client' } |
| 240 | + let(:nobind) { false } |
| 241 | + let(:params) do |
| 242 | + { |
| 243 | + 'remote' => ['vpn1.example.com 12345', 'vpn2.example.com 23456'], |
| 244 | + 'remote_random_hostname' => true, |
| 245 | + 'remote_random' => true, |
| 246 | + 'server_poll_timeout' => 1, |
| 247 | + 'ping_timer_rem' => true, |
| 248 | + 'tls_auth' => true, |
| 249 | + 'tls_client' => true, |
| 250 | + 'nobind' => nobind |
| 251 | + } |
| 252 | + end |
| 253 | + |
| 254 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^client$}) } |
| 255 | + it { |
| 256 | + is_expected.to contain_file('/etc/openvpn/test_client.conf'). |
| 257 | + with_content(%r{^remote\s+vpn1.example.com\s+12345$}) |
| 258 | + } |
| 259 | + it { |
| 260 | + is_expected.to contain_file('/etc/openvpn/test_client.conf'). |
| 261 | + with_content(%r{^remote\s+vpn2.example.com\s+23456$}) |
| 262 | + } |
| 263 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^remote-random-hostname$}) } |
| 264 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^remote-random$}) } |
| 265 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^server-poll-timeout\s+1$}) } |
| 266 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^ping-timer-rem$}) } |
| 267 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^ns-cert-type server}) } |
| 268 | + it { is_expected.not_to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^mode\s+server$}) } |
| 269 | + it { is_expected.not_to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^client-config-dir}) } |
| 270 | + it { is_expected.not_to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^dh}) } |
| 271 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^tls-client$}) } |
| 272 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^key-direction 1$}) } |
| 273 | + it { is_expected.not_to contain_file('/etc/openvpn/test_client.conf').with_content(%r{nobind}) } |
| 274 | + it { is_expected.to contain_file('/etc/openvpn/test_client.conf').with_content(%r{^port\s+\d+$}) } |
224 | 275 |
|
225 | 276 | it { is_expected.not_to contain_openvpn__ca('test_client') } |
226 | 277 |
|
|
0 commit comments