Skip to content

InSpec plugin to query Test Kitchen information from within instances under test

Notifications You must be signed in to change notification settings

tecracer-chef/inspec-tkinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inspec-tkinfo

InSpec plugin to retrieve Test Kitchen data as inputs.

Use Case

In some cases you want to get info about the Test Kitchen environment that your InSpec verifier is running in. This plugin offers some insight into instance name, platform name and suite name.

Installation

Simply execute inspec plugin install inspec-tkinfo, which will get the plugin from RubyGems and install/register it with InSpec.

You can verify successful installation via inspec plugin list

Usage

You have three input names available:

  • KITCHEN_INSTANCE_NAME ('default-amazon2')
  • KITCHEN_SUITE_NAME ('default')
  • KITCHEN_PLATFORM_NAME ('amazon2')

Use them in your InSpec tests like this:

instance_name = input('KITCHEN_INSTANCE_NAME')

describe file("/etc/#{instance_name}") do
  it { should exist }
end

About

InSpec plugin to query Test Kitchen information from within instances under test

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages