【问题标题】:Chef: use kitchen input value in inspec command test厨师:在检查命令测试中使用厨房输入值
【发布时间】:2021-07-08 12:32:16
【问题描述】:

我正在尝试在这样的 Inspec 测试中使用来自 .kitchen.yml 的输入值:

/.kitchen.yml

- inputs:
  my_service: some_service_name

/tests/my_test.rb

describe command('/bin/some_app status (input('my_service'))')
  its('stdout') { should include 'foo' }
end

不幸的是,当我尝试kitchen verify 套件时,我遇到了语法错误。 目标是测试/bin/some_app status my_service 的输出是否包含foo

【问题讨论】:

  • 您用来提供输入的命令是什么?您是否尝试在外部范围内使用input()

标签: chef-infra inspec


【解决方案1】:

找到语法问题的解决方案。正确的语法:

describe command("/bin/some_app status " + input("my_service"))
  its('stdout') { should include 'foo' }
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-21
    • 2017-03-15
    • 1970-01-01
    • 2016-08-02
    相关资源
    最近更新 更多