A Test Kitchen Driver for OpenStack.
This driver uses the fog gem to provision and destroy nova instances. Use an OpenStack cloud for your infrastructure testing!
Shamelessly copied from Fletcher Nichol's awesome work on an EC2 driver, and Adam Leff's amazing work on an VRO driver.
This software project is actively maintained by the OSU Open Source Lab.
There are no external system requirements for this driver. However you will need access to an OpenStack cloud.
This plugin ships out of the box with Chef Workstation, which is the easiest way to make sure you always have the latest testing dependencies in a single package.
Download Chef Workstation to get started
Add this line to your application's Gemfile:
gem 'kitchen-openstack'And then execute:
bundleOr install it yourself as:
gem install kitchen-openstackSee https://kitchen.ci/docs/drivers/openstack/ for documentation.
This driver supports OpenStack's standard
clouds.yaml
client configuration file. This allows you to use the same credentials and
endpoint configuration that other OpenStack tools (like the openstack CLI)
already use, instead of duplicating them in kitchen.yml.
The driver searches for clouds.yaml in the standard locations:
OS_CLIENT_CONFIG_FILEenvironment variable (if set)clouds_yaml_pathdriver config option (if set)- Current directory (
./clouds.yaml) ~/.config/openstack/clouds.yaml/etc/openstack/clouds.yaml
The first file found is used. A secure.yaml file in the same search
locations is also loaded and merged, so you can split secrets out of
clouds.yaml following the
standard convention.
Specify which cloud entry to use in one of two ways:
- Set
openstack_cloudinkitchen.yml(takes precedence) - Set the
OS_CLOUDenvironment variable
driver:
name: openstack
openstack_cloud: mycloud
image_ref: ubuntu-22.04
flavor_ref: m1.small
key_name: my-keypairOr, relying entirely on OS_CLOUD:
export OS_CLOUD=myclouddriver:
name: openstack
image_ref: ubuntu-22.04
flavor_ref: m1.small
key_name: my-keypairSettings specified in kitchen.yml always take precedence over values from
clouds.yaml. For example, you can override just the region:
driver:
name: openstack
openstack_cloud: mycloud
openstack_region: RegionTwoThe driver recognizes the standard OpenStack OS_* environment variables
(e.g. from an openrc file). This means you can source your OpenStack
credentials and use them directly without any extra configuration in
kitchen.yml:
source openrc.shdriver:
name: openstack
image_ref: ubuntu-22.04
flavor_ref: m1.small
key_name: my-keypairThe supported environment variables are:
| Env var | Maps to |
|---|---|
OS_AUTH_URL |
openstack_auth_url |
OS_USERNAME |
openstack_username |
OS_PASSWORD |
openstack_api_key |
OS_PROJECT_NAME |
openstack_project_name |
OS_PROJECT_ID |
openstack_project_id |
OS_USER_DOMAIN_NAME |
openstack_user_domain |
OS_USER_DOMAIN_ID |
openstack_user_domain_id |
OS_PROJECT_DOMAIN_NAME |
openstack_project_domain |
OS_PROJECT_DOMAIN_ID |
openstack_project_domain_id |
OS_DOMAIN_ID |
openstack_domain_id |
OS_DOMAIN_NAME |
openstack_domain_name |
OS_REGION_NAME |
openstack_region |
OS_INTERFACE |
openstack_endpoint_type |
OS_IDENTITY_API_VERSION |
openstack_identity_api_version |
OS_APPLICATION_CREDENTIAL_ID |
openstack_application_credential_id |
OS_APPLICATION_CREDENTIAL_SECRET |
openstack_application_credential_secret |
OS_CACERT |
ssl_ca_file |
The driver follows the upstream OpenStack SDK precedence order:
kitchen.yml— explicit driver config always winsOS_*env vars — overrideclouds.yamlvaluesclouds.yaml(merged withsecure.yaml) — base configuration
| Option | Default | Description |
|---|---|---|
openstack_cloud |
nil |
Name of the cloud entry in clouds.yaml. Falls back to the OS_CLOUD env var. |
clouds_yaml_path |
nil |
Explicit path to a clouds.yaml file, inserted into the search path. |
Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature) - Run the tests and rubocop,
bundle exec rake specandbundle exec rake rubocop - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Created by Jonathan Hartman
Apache 2.0 (see LICENSE.txt file)