LoginSignup
6
5

More than 5 years have passed since last update.

test-kitchenでnodeをテストする.kitchen.ymlの設定

Last updated at Posted at 2014-07-18

test-kitchenで、nodesの内容に応じてテストする場合の.kitchen.ymlサンプル

<%
require 'json'

def suites(&block)
  Dir.glob(File.join(File.dirname(__FILE__), 'nodes', "*.json")) do |file|
    suite_name = File.basename(file, '.json')
    block.call(
      suite_name,
      JSON.parse(
        open(file).read
      )
    )
  end
end
%>

---

driver:
  name: vagrant

provisioner:
  name: chef_solo

platforms:
  - name: centos-6.4

suites:
<%
  suites do |name, json|
%>
  - name: <%= name %>
    run_list: <%= json["run_list"] %>
    attributes: <%= json["attributes"] %>
<%
  end
%>
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5