【问题标题】:Chef Inspec - How to Read Custom Properties in FilesChef Inspec - 如何读取文件中的自定义属性
【发布时间】:2022-11-11 12:39:49
【问题描述】:

我目前正在使用 Chef Inspec 并想阅读我的一些 SH 文件中的内容。如何让 ChefInspec 读取其中包含的一些属性:

前任:

ex_sh_file = location/ex_file.sh'
describe bash(ex_sh_file) do
   it { should be_writable }
   its('custom property' ) { should eq 5 }
end

InSpec 有没有办法重新配置它?我是否必须从 JSON 文件中读取它?

【问题讨论】:

  • 你好。欢迎到这里。请编辑问题并将其设为mcve。这是good question 的重要要求之一。

标签: chef-infra inspec


【解决方案1】:

InSpec 仅支持 bash 资源的 3 个属性,即 stdout、stderr 和 exit_status。 https://docs.chef.io/inspec/resources/bash/#properties

您能否举一个您正在尝试测试的自定义属性的示例?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-09
    • 2019-06-07
    • 1970-01-01
    • 1970-01-01
    • 2016-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多