File tree Expand file tree Collapse file tree 8 files changed +39
-1
lines changed Expand file tree Collapse file tree 8 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 66 let ( :facts ) do
77 facts
88 end
9+
910 case facts [ :osfamily ]
1011 when 'Redhat'
1112 context 'with all defaults' do
2526 version : '3.6.1'
2627 }
2728 end
29+
2830 it 'includes gluster::install with version 3.6.1' do
2931 is_expected . to create_class ( 'gluster::install' ) . with (
3032 repo : true ,
3941 repo : false
4042 }
4143 end
44+
4245 it 'includes gluster::install with repo=>false' do
4346 is_expected . to create_class ( 'gluster::install' ) . with (
4447 repo : false ,
6568 version : '3.6.1'
6669 }
6770 end
71+
6872 it 'includes gluster::install with version 3.6.1' do
6973 is_expected . to create_class ( 'gluster::install' ) . with (
7074 repo : true ,
7983 repo : false
8084 }
8185 end
86+
8287 it 'includes gluster::install with repo=>false' do
8388 is_expected . to create_class ( 'gluster::install' ) . with (
8489 repo : false ,
Original file line number Diff line number Diff line change 66 let ( :facts ) do
77 facts
88 end
9+
910 case facts [ :osfamily ]
1011 when 'Redhat'
1112 context 'with all defaults' do
4243 repo : false
4344 }
4445 end
46+
4547 it 'creates gluster::install' do
4648 is_expected . to create_class ( 'gluster::install' ) . with (
4749 server : true ,
9799 repo : false
98100 }
99101 end
102+
100103 it 'creates gluster::install' do
101104 is_expected . to create_class ( 'gluster::install' ) . with (
102105 server : true ,
139142 }
140143 }
141144 end
145+
142146 it 'creates gluster::volume' do
143147 is_expected . to contain_gluster__volume ( 'data1' ) . with (
144148 name : 'data1' ,
152156 context 'when volumes incorrectly defined' do
153157 let :params do
154158 {
155- volumes : { 'data1' => %w( this is an array ) }
159+ volumes : { 'data1' => %w[ this is an array ] }
156160 }
157161 end
162+
158163 it 'fails' do
159164 expect do
160165 is_expected . to contain_gluster__volume ( 'data1' )
Original file line number Diff line number Diff line change 99 let :pre_condition do
1010 'require ::gluster::service'
1111 end
12+
1213 context 'with defaults' do
1314 it { is_expected . to compile . with_all_deps }
1415 case facts [ :osfamily ]
2829 let :params do
2930 { repo : false }
3031 end
32+
3133 it { is_expected . not_to create_class ( 'gluster::repo' ) }
3234 end
3335 context 'when client is false' do
3436 let :params do
3537 { client : false }
3638 end
39+
3740 case facts [ :osfamily ]
3841 when 'Redhat'
3942 it { is_expected . not_to create_package ( 'glusterfs-fuse' ) }
4548 let :params do
4649 { server : false }
4750 end
51+
4852 case facts [ :osfamily ]
4953 when 'Redhat' , 'Debian'
5054 it { is_expected . not_to create_package ( 'glusterfs-server' ) }
5660 architecture : 'zLinux'
5761 )
5862 end
63+
5964 case facts [ :osfamily ]
6065 when 'Archlinux'
6166 it { is_expected . not_to create_class ( 'gluster::repo' ) }
Original file line number Diff line number Diff line change 99 let :pre_condition do
1010 'require ::gluster::params'
1111 end
12+
1213 case facts [ :osfamily ]
1314 when 'Debian'
1415 context 'with all defaults' do
2829 architecture : 'zLinux'
2930 )
3031 end
32+
3133 it 'does not install' do
3234 expect do
3335 is_expected . to create_file ( '/etc/pki/rpm-gpg/RPM-GPG-KEY-gluster.pub' )
4042 priority : '700'
4143 }
4244 end
45+
4346 it 'installs' do
4447 is_expected . to contain_apt__source ( 'glusterfs-LATEST' ) . with (
4548 repos : 'main' ,
5659 release : '3.9'
5760 }
5861 end
62+
5963 it 'installs' do
6064 is_expected . to contain_apt__source ( 'glusterfs-LATEST' ) . with (
6165 repos : 'main' ,
7579 release : '3.6'
7680 }
7781 end
82+
7883 it 'installs' do
7984 is_expected . to contain_apt__source ( 'glusterfs-LATEST' ) . with (
8085 repos : 'main' ,
9499 release : '3.8'
95100 }
96101 end
102+
97103 it 'installs' do
98104 is_expected . to contain_apt__source ( 'glusterfs-LATEST' ) . with (
99105 repos : 'main' ,
Original file line number Diff line number Diff line change 66 let ( :facts ) do
77 facts
88 end
9+
910 case facts [ :osfamily ]
1011 when 'Redhat'
1112 context 'with all defaults' do
2728 version : 'foobar'
2829 }
2930 end
31+
3032 it 'does not install' do
3133 expect do
3234 is_expected . to create_file ( '/etc/yum.repos.d/glusterfs-x86_64.repo' )
3941 architecture : 'zLinux'
4042 )
4143 end
44+
4245 it 'does not install' do
4346 expect do
4447 is_expected . to create_file ( '/etc/yum.repos.d/glusterfs-x86_64.repo' )
5154 priority : '50'
5255 }
5356 end
57+
5458 it 'installs' do
5559 is_expected . to create_package ( 'yum-plugin-priorities' )
5660 is_expected . to create_yumrepo ( 'glusterfs-x86_64' ) . with (
Original file line number Diff line number Diff line change 66 let ( :facts ) do
77 facts
88 end
9+
910 context 'with all defaults' do
1011 it { is_expected . to compile . with_all_deps }
1112 it 'starts the service' do
Original file line number Diff line number Diff line change 1414 gluster_binary : '/usr/sbin/gluster'
1515 }
1616 end
17+
1718 it { is_expected . to compile }
1819 end
1920
2627 gluster_peer_list : 'peer1.example.com'
2728 }
2829 end
30+
2931 it { is_expected . to compile }
3032 it { is_expected . not_to contain_exec ( 'gluster peer probe peer1.example.com' ) }
3133 end
3739 gluster_peer_list : 'peer1.example.com,peer2.example.com'
3840 }
3941 end
42+
4043 it { is_expected . to compile }
4144 it { is_expected . not_to contain_exec ( 'gluster peer probe peer1.example.com' ) }
4245 end
5154 gluster_peer_list : ''
5255 }
5356 end
57+
5458 it { is_expected . to compile }
5559 it { is_expected . to contain_exec ( 'gluster peer probe peer1.example.com' ) }
5660 end
6266 gluster_peer_list : 'peer2.example.com'
6367 }
6468 end
69+
6570 it { is_expected . to compile }
6671 it { is_expected . to contain_exec ( 'gluster peer probe peer1.example.com' ) }
6772 end
7378 gluster_peer_list : 'peer2.example.com,peer3.example.com'
7479 }
7580 end
81+
7682 it { is_expected . to compile }
7783 it { is_expected . to contain_exec ( 'gluster peer probe peer1.example.com' ) }
7884 end
8793 fqdn : 'peer1.example.com'
8894 }
8995 end
96+
9097 it { is_expected . to compile }
9198 it 'we don\'t try to join with ourselves' do
9299 is_expected . not_to contain_exec ( 'gluster peer probe peer1.example.com' )
Original file line number Diff line number Diff line change 2929 gluster_binary : '/usr/sbin/gluster'
3030 }
3131 end
32+
3233 it { is_expected . to compile . with_all_deps }
3334 end
3435
3940 gluster_peer_list : 'peer1.example.com,peer2.example.com'
4041 }
4142 end
43+
4244 it { is_expected . to compile . with_all_deps }
4345 end
4446
5052 gluster_volume_list : 'gl1.example.com:/glusterfs/backup,gl2.example.com:/glusterfs/backup'
5153 }
5254 end
55+
5356 it { is_expected . to compile . with_all_deps }
5457 end
5558 end
6669 let ( :args ) do
6770 'replica 2 transport tcp srv1.local:/export/brick1/brick srv2.local:/export/brick1/brick srv1.local:/export/brick2/brick srv2.local:/export/brick2/brick'
6871 end
72+
6973 it { is_expected . to compile . with_all_deps }
7074 it do
7175 is_expected . to contain_exec ( "gluster create volume #{ title } " ) . with (
8185 let ( :args ) do
8286 'replica 2 transport tcp srv1.local:/export/brick1/brick srv2.local:/export/brick1/brick srv1.local:/export/brick2/brick srv2.local:/export/brick2/brick force'
8387 end
88+
8489 it { is_expected . to compile . with_all_deps }
8590 it do
8691 is_expected . to contain_exec ( "gluster create volume #{ title } " ) . with (
You can’t perform that action at this time.
0 commit comments