Chef infra serverspec在一个且仅一个文件上不断失败
我有一本食谱,是关于建立一个Splunk货代的。我已经为配置文件创建了许多integration-serverspec测试。特别是其中一个文件,Chef infra serverspec在一个且仅一个文件上不断失败,chef-infra,serverspec,Chef Infra,Serverspec,我有一本食谱,是关于建立一个Splunk货代的。我已经为配置文件创建了许多integration-serverspec测试。特别是其中一个文件,/opt/splunkforwarder/etc/apps/search/local/inputs.conf总是无法通过其他文件通过的所有测试。我的代码如下所示: require 'spec_helper' describe file('/opt/splunkforwarder/etc/apps/search/local/') do it { sh
/opt/splunkforwarder/etc/apps/search/local/inputs.conf
总是无法通过其他文件通过的所有测试。我的代码如下所示:
require 'spec_helper'
describe file('/opt/splunkforwarder/etc/apps/search/local/') do
it { should be_directory }
it { should be_owned_by 'nobody' }
it { should be_mode 755 }
end
describe file('/opt/splunkforwarder/etc/system/local/') do
it { should be_directory }
it { should be_owned_by 'nobody' }
it { should be_mode 755 }
end
describe file('/opt/splunkforwarder/etc/system/local/outputs.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
describe file('/opt/splunkforwarder/etc/system/local/inputs.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
describe file('/opt/splunkforwarder/etc/apps/search/local/inputs.conf}') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
describe file('/opt/splunkforwarder/etc/apps/SplunkUniversalForwarder/default/limits.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 444 }
end
describe file('/opt/splunkforwarder/etc/system/local/web.conf') do
it { should exist }
it { should be_owned_by 'nobody' }
it { should be_mode 600 }
end
除了/opt/splunkforwarder/etc/apps/search/local/inputs.conf
,此规范文件中的每个文件和目录都会通过。我正在使用Docker实例和Test Kitchen,因此当我登录时,我发现:
我不知道为什么考试不及格。我怀疑考试中的打字错误是你的敌人
描述文件('/opt/splunkforwarder/etc/apps/search/local/inputs.conf
}')do
尝试删除该括号并再次运行测试。该测试的详细失败输出是什么?是否启用并强制执行SELinux?如果是,audit.log中是否有inputs.conf的条目?