1.

What is .kitchen.yml file? Why is it used?

Answer»

kitchen.yml file is the CONFIGURATION file for the Test Kitchen. All details needed to create a sandbox environment for testing our infrastructure using Chef is included in .kitchen.yml file

Syntax of a .kitchen.yml file is as follows:

The basic structure of a .kitchen.yml file is as follows:

driver:   name: driver_name provisioner:   name: provisioner_name verifier:   name: verifier_name transport:   name: transport_name platforms:   - name: platform-version     driver:       name: driver_name suites:   - name: suite_name     run_list:       - recipe[cookbook_name::recipe_name]

where

  • driver_name is the name of the driver used to create kitchen instances. For eg: kitchen-Dokken is used to create instances using Docker.
  • provisioner_name is used to denote how Chef Client is simulated in testing either as chef-solo or chef-zero.
  • verifier_name denotes the tool used to run the tests. Usually, InSpec is used.
  • transport_name specifies the transport used to EXECUTE commands on the kitchen instance. Normally ssh is used.
  • platform section in .kitchen.yml specifies the TYPE and version of the kitchen instance created.
  • suites_name represents the test suite run on the kitchen instance and it CONTAINS a run_list applied which is the list of recipes applied.


Discussion

No Comment Found