Skip to content

Commit 4cd351a

Browse files
committed
fix(freebsd): add openssl pkg and update all default tests
1 parent 1e5cd11 commit 4cd351a

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

nginx/map.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
'server_enabled': '/usr/local/etc/nginx/sites-enabled',
106106
'snippets_dir': '/usr/local/etc/nginx/snippets',
107107
'server_use_symlink': True,
108+
'openssl_package': 'openssl',
108109
'pid_file': '/var/run/nginx.pid',
109110
},
110111
}, default='Debian' ),

test/integration/default/controls/config.rb

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,36 @@
22

33
# Set defaults, use debian as base
44

5-
server_available = '/etc/nginx/sites-available'
6-
server_enabled = '/etc/nginx/sites-enabled'
7-
85
# Override by platform family
9-
case platform[:family]
10-
when 'redhat', 'fedora'
11-
server_available = '/etc/nginx/conf.d'
12-
server_enabled = '/etc/nginx/conf.d'
13-
when 'suse'
14-
server_available = '/etc/nginx/vhosts.d'
15-
server_enabled = '/etc/nginx/vhosts.d'
16-
end
6+
server_available, server_enabled =
7+
case platform[:family]
8+
when 'redhat', 'fedora'
9+
%w[/etc/nginx/conf.d /etc/nginx/conf.d]
10+
when 'suse'
11+
%w[/etc/nginx/vhosts.d /etc/nginx/vhosts.d]
12+
when 'bsd'
13+
%w[/usr/local/etc/nginx/sites-available /usr/local/etc/nginx/sites-enabled]
14+
else
15+
%w[/etc/nginx/sites-available /etc/nginx/sites-enabled]
16+
end
17+
18+
nginx_conf, snippets_letsencrypt_conf, file_owner, file_group =
19+
case platform[:family]
20+
when 'bsd'
21+
%w[/usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/snippets/letsencrypt.conf
22+
root wheel]
23+
else
24+
%w[/etc/nginx/nginx.conf /etc/nginx/snippets/letsencrypt.conf root root]
25+
end
1726

1827
control 'Nginx configuration' do
1928
title 'should match desired lines'
2029

2130
# main configuration
22-
describe file('/etc/nginx/nginx.conf') do
31+
describe file(nginx_conf) do
2332
it { should be_file }
24-
it { should be_owned_by 'root' }
25-
it { should be_grouped_into 'root' }
33+
it { should be_owned_by file_owner }
34+
it { should be_grouped_into file_group }
2635
its('mode') { should cmp '0644' }
2736
its('content') do
2837
# rubocop:disable Metrics/LineLength
@@ -34,10 +43,10 @@
3443
end
3544

3645
# snippets configuration
37-
describe file('/etc/nginx/snippets/letsencrypt.conf') do
46+
describe file(snippets_letsencrypt_conf) do
3847
it { should be_file }
39-
it { should be_owned_by 'root' }
40-
it { should be_grouped_into 'root' }
48+
it { should be_owned_by file_owner }
49+
it { should be_grouped_into file_group }
4150
its('mode') { should cmp '0644' }
4251
its('content') { should include 'location ^~ /.well-known/acme-challenge/ {' }
4352
its('content') { should include 'proxy_pass http://localhost:9999;' }
@@ -52,8 +61,8 @@
5261

5362
describe file "#{dir}/mysite" do
5463
it { should be_file }
55-
it { should be_owned_by 'root' }
56-
it { should be_grouped_into 'root' }
64+
it { should be_owned_by file_owner }
65+
it { should be_grouped_into file_group }
5766
its('mode') { should cmp '0644' }
5867
its('content') { should include 'server_name localhost;' }
5968
its('content') { should include 'listen 80 default_server;' }

0 commit comments

Comments
 (0)