浏览代码

test(inspec): add test for `log_format` #219

tags/v0.56.1
Imran Iqbal 5 年前
父节点
当前提交
4ed788e5c7
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. +3
    -0
      test/integration/default/controls/config.rb
  2. +8
    -0
      test/salt/default/pillar/nginx.sls

+ 3
- 0
test/integration/default/controls/config.rb 查看文件

@@ -22,6 +22,9 @@ control 'Nginx configuration' do
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
its('content') { should include %Q[ log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';] }
end

# snippets configuration

+ 8
- 0
test/salt/default/pillar/nginx.sls 查看文件

@@ -10,6 +10,14 @@ nginx:
letsencrypt:
- location ^~ /.well-known/acme-challenge/:
- proxy_pass: http://localhost:9999
server:
config:
http:
### module ngx_http_log_module example
log_format: |-
main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
servers:
managed:
default:

正在加载...
取消
保存