File tree 9 files changed +105
-29
lines changed
9 files changed +105
-29
lines changed Original file line number Diff line number Diff line change 16
16
puppet-lint (~> 0.3 )
17
17
puppetlabs_spec_helper (~> 0.4 )
18
18
rspec-puppet (~> 0.1 )
19
- diff-lcs (1.2.4 )
20
- facter (1.7.2 )
19
+ diff-lcs (1.2.5 )
20
+ facter (1.7.3 )
21
21
faraday (0.8.8 )
22
22
multipart-post (~> 1.2.0 )
23
23
faraday_middleware (0.9.0 )
24
24
faraday (>= 0.7.4 , < 0.9 )
25
25
hashie (2.0.5 )
26
26
hiera (1.2.1 )
27
27
json_pure
28
- highline (1.6.19 )
29
- json (1.8.0 )
30
- json_pure (1.8.0 )
28
+ highline (1.6.20 )
29
+ json (1.8.1 )
30
+ json_pure (1.8.1 )
31
31
librarian-puppet (0.9.10 )
32
32
json
33
33
thor (~> 0.15 )
34
34
metaclass (0.0.1 )
35
35
mocha (0.14.0 )
36
36
metaclass (~> 0.0.1 )
37
- multi_json (1.7.9 )
37
+ multi_json (1.8.2 )
38
38
multipart-post (1.2.0 )
39
39
netrc (0.7.7 )
40
40
octokit (1.25.0 )
44
44
hashie (~> 2.0 )
45
45
multi_json (~> 1.3 )
46
46
netrc (~> 0.7.7 )
47
- puppet (3.2.4 )
47
+ puppet (3.3.2 )
48
48
facter (~> 1.6 )
49
49
hiera (~> 1.0 )
50
50
rgen (~> 0.6.5 )
55
55
rspec (>= 2.9.0 )
56
56
rspec-puppet (>= 0.1.1 )
57
57
rake (10.1.0 )
58
- rgen (0.6.5 )
58
+ rgen (0.6.6 )
59
59
rspec (2.14.1 )
60
60
rspec-core (~> 2.14.0 )
61
61
rspec-expectations (~> 2.14.0 )
62
62
rspec-mocks (~> 2.14.0 )
63
- rspec-core (2.14.5 )
64
- rspec-expectations (2.14.2 )
63
+ rspec-core (2.14.7 )
64
+ rspec-expectations (2.14.4 )
65
65
diff-lcs (>= 1.1.3 , < 2.0 )
66
- rspec-mocks (2.14.3 )
66
+ rspec-mocks (2.14.4 )
67
67
rspec-puppet (0.1.6 )
68
68
rspec
69
69
thor (0.18.1 )
Original file line number Diff line number Diff line change 23
23
$logdir
24
24
]:
25
25
ensure => $dir_ensure ;
26
-
27
- ' /Library/LaunchDaemons/dev.postgresql.plist' :
28
- content => template (' postgresql/dev.postgresql.plist.erb' ),
29
- group => ' wheel' ,
30
- owner => ' root' ;
31
26
}
32
27
33
28
sysctl::set {
48
43
file { "${boxen::config::envdir}/postgresql.sh" :
49
44
ensure => absent ,
50
45
}
46
+
47
+
48
+ file { '/Library/LaunchDaemons/dev.postgresql.plist' :
49
+ content => template (' postgresql/dev.postgresql.plist.erb' ),
50
+ group => ' wheel' ,
51
+ owner => ' root' ,
52
+ }
51
53
}
52
54
}
Original file line number Diff line number Diff line change 1
1
# Internal: manages postgresql service
2
2
class postgresql::service (
3
- $ensure = postgresql::params::ensure,
3
+ $ensure = $ postgresql::params::ensure,
4
4
5
5
$service = $postgresql::params::service,
6
6
$enable = $postgresql::params::enable,
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe 'postgresql::config' do
4
+ let ( :facts ) { default_test_facts }
5
+
6
+ it do
7
+ should include_class ( 'boxen::config' )
8
+
9
+ %w( data/postgresql log/postgresql ) . each do |d |
10
+ should contain_file ( "/test/boxen/#{ d } " ) . with_ensure ( :directory )
11
+ end
12
+
13
+ contain_sysctl__set ( "kern.sysv.shmmax" )
14
+ contain_sysctl__set ( "kern.sysv.shmall" )
15
+
16
+ should include_class ( "boxen::config" )
17
+ should contain_boxen__env_script ( "postgresql" )
18
+ should contain_file ( "/Library/LaunchDaemons/dev.postgresql.plist" )
19
+ end
20
+
21
+ context "Ubuntu" do
22
+ let ( :facts ) { default_test_facts . merge ( :operatingsystem => "Ubuntu" ) }
23
+
24
+ it do
25
+ should_not include_class ( "boxen::config" )
26
+
27
+ should_not contain_boxen__env_script ( "postgresql" )
28
+ should_not contain_file ( "/Library/LaunchDaemons/dev.postgresql.plist" )
29
+ end
30
+ end
31
+ end
Original file line number Diff line number Diff line change
1
+ require "spec_helper"
2
+
3
+ describe "postgresql::package" do
4
+ let ( :facts ) { default_test_facts }
5
+
6
+ it do
7
+ should contain_homebrew__formula ( "postgresql" )
8
+
9
+ should contain_package ( "boxen/brews/postgresql" )
10
+ end
11
+
12
+ context "Ubuntu" do
13
+ let ( :facts ) { default_test_facts . merge ( :operatingsystem => "Ubuntu" ) }
14
+
15
+ it do
16
+ should_not contain_homebrew__formula ( "postgresql" )
17
+
18
+ should contain_package ( "postgresql-server-9.1" )
19
+ end
20
+ end
21
+ end
22
+
Original file line number Diff line number Diff line change
1
+ require "spec_helper"
2
+
3
+ describe "postgresql::service" do
4
+ let ( :facts ) { default_test_facts }
5
+
6
+ it do
7
+ should contain_service ( "com.boxen.postgresql" ) . with_ensure ( :stopped )
8
+
9
+ should contain_exec ( "init-postgresql-db" ) . with_creates ( "/test/boxen/data/postgresql/PG_VERSION" )
10
+ should contain_service ( "dev.postgresql" ) . with_ensure ( :running )
11
+ should contain_exec ( "wait-for-postgresql" ) . with_unless ( "nc -z 127.0.0.1 15432" )
12
+ end
13
+
14
+ context "Ubuntu" do
15
+ let ( :facts ) { default_test_facts . merge ( :operatingsystem => "Ubuntu" ) }
16
+
17
+ it do
18
+ should_not contain_service ( "com.boxen.postgresql" )
19
+
20
+ should contain_exec ( "init-postgresql-db" ) . with_creates ( "/var/lib/postgresql/PG_VERSION" )
21
+ should contain_service ( "postgresql-9.1" ) . with_ensure ( :running )
22
+ should contain_exec ( "wait-for-postgresql" ) . with_unless ( "nc -z 127.0.0.1 5432" )
23
+ end
24
+ end
25
+ end
26
+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4
4
let ( :facts ) { default_test_facts }
5
5
6
6
it do
7
-
7
+ should contain_class ( "postgresql::config" )
8
+ should contain_class ( "postgresql::package" )
9
+ should contain_class ( "postgresql::service" )
8
10
end
9
11
end
Original file line number Diff line number Diff line change 9
9
10
10
def default_test_facts
11
11
{
12
- :boxen_home => "/test/boxen" ,
13
- :boxen_user => "testuser"
12
+ :boxen_home => "/test/boxen" ,
13
+ :boxen_user => "testuser" ,
14
+ :ipaddress_lo0 => "127.0.0.1" ,
15
+ :operatingsystem => "Darwin" ,
14
16
}
15
17
end
You can’t perform that action at this time.
0 commit comments