Test-kitchen includes two provisioners for Chef, chef_solo and chef_zero, which support nearly identical options.

  name: chef_zero # chef_solo or chef_zero
  data_path: test/data # Path to directory of files to copy to instance
  data_bags_path: test/data_bags # Path to directory containing data_bags
  environments_path: test/envs # Path to directory containing environments
  encrypted_data_bag_secret_key_path: test/secret_key # Path to secret file
  nodes_path: test/nodes # Path to directory containing nodes
  roles_path: test/roles # Path to directory containing roles
  profile_ruby: false # true enables chef's Ruby profiling
  deprecations_as_errors: false # true configures chef to exception on deprecation warnings
  client_rb: # use solo_rb when chef_solo is used
    environment: kitchen # requires a corresponding file in environments_path
    silence_deprecation_warnings: # true for all or an array of deprecations to silence
    - deploy_resource # deprecation key name
    - chef-23 # deprecation numeric ID
    - recipes/install.rb:22 # specific line in a file
  product_name: chef # which package to install chef || chefdk
  product_version: latest # 'latest', partial, or full version number
  channel: stable # stable, current or unstable
  install_strategy: once # once (install only if needed), always, skip (don't install)
  checksum: <SHA256> # used in conjunction with download_url to validate

  - name: ubuntu-16.04
        attr_b: "value"

  - name: default
        attr_c: "value"
      - role[role_a] # requires a corresponding file in roles_path
      - recipe[cookbook_a]
      - recipe[cookbook_b::recipe_c]

If not explicitly set, the following keys:

  • data_path
  • data_bags_path
  • encrypted_data_bag_secret_key_path
  • environments_path
  • nodes_path
  • roles_path

Will be set to the first match, in the following order:

  1. test/integration/$SUITE/$KEY
  2. test/integration/$KEY
  3. $KEY

Where $KEY corresponds to a folder named data, data_bags, environments, nodes, roles - the exception being encrypted_data_bag_secret_key_path which looks for a file named encrypted_data_bag_secret_key.