|
1 | 1 | require 'spec_helper' |
2 | 2 |
|
3 | 3 | describe 'openvpn', type: :class do |
4 | | - let(:title) { 'test openvpn hiera lookups' } |
| 4 | + on_supported_os.each do |os, facts| |
| 5 | + context "on #{os}" do |
| 6 | + let(:pre_condition) { 'class { "openvpn" : manage_service => true }' } |
| 7 | + let(:facts) do |
| 8 | + facts |
| 9 | + end |
| 10 | + let(:title) { 'test openvpn hiera lookups' } |
5 | 11 |
|
6 | | - let(:facts) do |
7 | | - { |
8 | | - concat_basedir: '/var/lib/puppet/concat', |
9 | | - osfamily: 'Debian', |
10 | | - operatingsystem: 'Ubuntu', |
11 | | - operatingsystemrelease: '12.04' |
12 | | - } |
13 | | - end |
| 12 | + it { is_expected.to create_class('openvpn') } |
14 | 13 |
|
15 | | - it { is_expected.to create_class('openvpn') } |
16 | | - it { is_expected.to contain_class('openvpn::service') } |
| 14 | + it do |
| 15 | + is_expected.to contain_openvpn__server('winterthur').with( |
| 16 | + 'country' => 'CH', |
| 17 | + 'province' => 'ZH', |
| 18 | + 'city' => 'Winterthur', |
| 19 | + 'organization' => 'example.org', |
| 20 | + |
| 21 | + 'server' => '10.200.200.0 255.255.255.0' |
| 22 | + ) |
| 23 | + end |
17 | 24 |
|
18 | | - it do |
19 | | - is_expected.to contain_openvpn__server('winterthur').with( |
20 | | - 'country' => 'CH', |
21 | | - 'province' => 'ZH', |
22 | | - 'city' => 'Winterthur', |
23 | | - 'organization' => 'example.org', |
24 | | - 'email' => 'root@example.org', |
25 | | - 'server' => '10.200.200.0 255.255.255.0' |
26 | | - ) |
27 | | - end |
| 25 | + it do |
| 26 | + is_expected.to contain_openvpn__server('uster').with( |
| 27 | + 'country' => 'CH', |
| 28 | + 'province' => 'ZH', |
| 29 | + 'city' => 'Uster', |
| 30 | + 'organization' => 'example.com', |
| 31 | + 'email' => 'root@example.com', |
| 32 | + 'server' => '10.100.100.0 255.255.255.0' |
| 33 | + ) |
| 34 | + end |
28 | 35 |
|
29 | | - it do |
30 | | - is_expected.to contain_openvpn__server('uster').with( |
31 | | - 'country' => 'CH', |
32 | | - 'province' => 'ZH', |
33 | | - 'city' => 'Uster', |
34 | | - 'organization' => 'example.com', |
35 | | - |
36 | | - 'server' => '10.100.100.0 255.255.255.0' |
37 | | - ) |
38 | | - end |
| 36 | + it do |
| 37 | + is_expected.to contain_openvpn__client('winti-client1').with( |
| 38 | + 'server' => 'winterthur' |
| 39 | + ) |
| 40 | + end |
39 | 41 |
|
40 | | - it do |
41 | | - is_expected.to contain_openvpn__client('winti-client1').with( |
42 | | - 'server' => 'winterthur' |
43 | | - ) |
44 | | - end |
| 42 | + it do |
| 43 | + is_expected.to contain_openvpn__client('winti-client2').with( |
| 44 | + 'server' => 'winterthur' |
| 45 | + ) |
| 46 | + end |
45 | 47 |
|
46 | | - it do |
47 | | - is_expected.to contain_openvpn__client('winti-client2').with( |
48 | | - 'server' => 'winterthur' |
49 | | - ) |
50 | | - end |
| 48 | + it do |
| 49 | + is_expected.to contain_openvpn__client('uster-client1').with( |
| 50 | + 'server' => 'uster' |
| 51 | + ) |
| 52 | + end |
51 | 53 |
|
52 | | - it do |
53 | | - is_expected.to contain_openvpn__client('uster-client1').with( |
54 | | - 'server' => 'uster' |
55 | | - ) |
56 | | - end |
| 54 | + it do |
| 55 | + is_expected.to contain_openvpn__client('uster-client2').with( |
| 56 | + 'server' => 'uster' |
| 57 | + ) |
| 58 | + end |
57 | 59 |
|
58 | | - it do |
59 | | - is_expected.to contain_openvpn__client('uster-client2').with( |
60 | | - 'server' => 'uster' |
61 | | - ) |
62 | | - end |
| 60 | + it do |
| 61 | + is_expected.to contain_openvpn__client_specific_config('winti-client1').with( |
| 62 | + 'server' => 'winterthur', |
| 63 | + 'ifconfig' => '10.200.200.50 10.200.200.51' |
| 64 | + ) |
| 65 | + end |
63 | 66 |
|
64 | | - it do |
65 | | - is_expected.to contain_openvpn__client_specific_config('winti-client1').with( |
66 | | - 'server' => 'winterthur', |
67 | | - 'ifconfig' => '10.200.200.50 10.200.200.51' |
68 | | - ) |
69 | | - end |
| 67 | + it do |
| 68 | + is_expected.to contain_openvpn__client_specific_config('uster-client1').with( |
| 69 | + 'server' => 'uster', |
| 70 | + 'ifconfig' => '10.100.100.50 10.100.100.51' |
| 71 | + ) |
| 72 | + end |
70 | 73 |
|
71 | | - it do |
72 | | - is_expected.to contain_openvpn__client_specific_config('uster-client1').with( |
73 | | - 'server' => 'uster', |
74 | | - 'ifconfig' => '10.100.100.50 10.100.100.51' |
75 | | - ) |
76 | | - end |
77 | | - |
78 | | - it do |
79 | | - is_expected.to contain_openvpn__revoke('winti-client2').with( |
80 | | - 'server' => 'winterthur' |
81 | | - ) |
82 | | - end |
| 74 | + it do |
| 75 | + is_expected.to contain_openvpn__revoke('winti-client2').with( |
| 76 | + 'server' => 'winterthur' |
| 77 | + ) |
| 78 | + end |
83 | 79 |
|
84 | | - it do |
85 | | - is_expected.to contain_openvpn__revoke('uster-client2').with( |
86 | | - 'server' => 'uster' |
87 | | - ) |
| 80 | + it do |
| 81 | + is_expected.to contain_openvpn__revoke('uster-client2').with( |
| 82 | + 'server' => 'uster' |
| 83 | + ) |
| 84 | + end |
| 85 | + end |
88 | 86 | end |
89 | 87 | end |
0 commit comments