ソースを参照

test(requires): verify dependencies in vhosts

tags/v2.7.0
Javier Bértoli 3年前
コミット
64781431b9
5個のファイルの変更43行の追加0行の削除
  1. +4
    -0
      kitchen.yml
  2. +11
    -0
      test/integration/default/controls/config.rb
  3. +9
    -0
      test/integration/default/controls/file.rb
  4. +13
    -0
      test/salt/default/pillar/nginx.sls
  5. +6
    -0
      test/salt/default/states/test_dep/create_dependency_file.sls

+ 4
- 0
kitchen.yml ファイルの表示

@@ -309,9 +309,13 @@ verifier:
suites:
- name: default
provisioner:
dependencies:
- name: test_dep
path: test/salt/default/states
state_top:
base:
'*':
- test_dep.create_dependency_file
- nginx._mapdata
- nginx
pillars:

+ 11
- 0
test/integration/default/controls/config.rb ファイルの表示

@@ -71,5 +71,16 @@ control 'Nginx configuration' do
its('content') { should include 'try_files $uri $uri/ =404;' }
its('content') { should include 'include snippets/letsencrypt.conf;' }
end
describe file "#{dir}/mysite_with_require" do
it { should be_file }
it { should be_owned_by file_owner }
it { should be_grouped_into file_group }
its('mode') { should cmp '0644' }
its('content') { should include 'server_name with-deps;' }
its('content') { should include 'listen 80;' }
its('content') { should include 'index index.html index.htm;' }
its('content') { should include 'location ~ .htm {' }
its('content') { should include 'try_files $uri $uri/ =404;' }
end
end
end

+ 9
- 0
test/integration/default/controls/file.rb ファイルの表示

@@ -0,0 +1,9 @@
# frozen_string_literal: true

control 'Dependency test file' do
title 'should exist'

describe file('/tmp/created_to_test_dependencies') do
it { should be_file }
end
end

+ 13
- 0
test/salt/default/pillar/nginx.sls ファイルの表示

@@ -37,6 +37,19 @@ nginx:
- location ~ .htm:
- try_files: '$uri $uri/ =404'
- include: 'snippets/letsencrypt.conf'
mysite_with_require:
enabled: true
config:
- server:
- server_name: with-deps
- listen:
- '80'
- index: 'index.html index.htm'
- location ~ .htm:
- try_files: '$uri $uri/ =404'
requires:
file: created_to_test_dependencies

dh_param:
'mydhparam2.pem':
keysize: 2048

+ 6
- 0
test/salt/default/states/test_dep/create_dependency_file.sls ファイルの表示

@@ -0,0 +1,6 @@
## this state creates a file that is used to test vhosts dependencies
# (see https://github.com/saltstack-formulas/nginx-formula/pull/278)

created_to_test_dependencies:
file.managed:
- name: /tmp/created_to_test_dependencies

読み込み中…
キャンセル
保存