浏览代码

test(refactor): split tests (config/package/service)

tags/v0.4.0
Nicolas Rodriguez 5 年前
父节点
当前提交
b7fac62ef3
共有 4 个文件被更改,包括 34 次插入17 次删除
  1. +18
    -0
      test/integration/default/controls/config_spec.rb
  2. +7
    -0
      test/integration/default/controls/package_spec.rb
  3. +9
    -0
      test/integration/default/controls/service_spec.rb
  4. +0
    -17
      test/integration/default/controls/syslog_ng.rb

+ 18
- 0
test/integration/default/controls/config_spec.rb 查看文件

@@ -0,0 +1,18 @@
control 'SyslogNG configuration' do
title 'should match desired lines'

describe file('/etc/syslog-ng/syslog-ng.conf') do
# # Default config
# its('content') { should include '[inputs.diskio]' }
# its('content') { should include '[inputs.kernel]' }
# its('content') { should include '[inputs.mem]' }
# its('content') { should include '[inputs.processes]' }
# its('content') { should include '[inputs.swap]' }
# its('content') { should include '[inputs.system]' }

# # Custom config from pillar (default: nothing)
# its('content') { should include '[outputs.discard]' }

it { should exist }
end
end

+ 7
- 0
test/integration/default/controls/package_spec.rb 查看文件

@@ -0,0 +1,7 @@
control 'SyslogNG package' do
title 'should be installed'

describe package('syslog-ng') do
it { should be_installed }
end
end

+ 9
- 0
test/integration/default/controls/service_spec.rb 查看文件

@@ -0,0 +1,9 @@
control 'SyslogNG service' do
title 'should be running and enabled'

describe service('syslog-ng') do
it { should be_enabled }
it { should be_running }
end

end

+ 0
- 17
test/integration/default/controls/syslog_ng.rb 查看文件

@@ -1,17 +0,0 @@
# encoding: utf-8

title 'Test SyslogNG installation'

describe package('syslog-ng') do
it { should be_installed }
end

describe file('/etc/syslog-ng/syslog-ng.conf') do
it { should exist }
end

describe sysv_service('syslog-ng') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end

正在加载...
取消
保存