One of the most important things of continuous delivery process is to run tests. To run test with Chef we have Test Kitchen. Test Kitchen is a tool to execute test on one o more platforms. Test Kitchen have drivers to execute test on differents platforms like Vagrant, AWS, Rackspace, Azure and more.
Create a IAM user in your AWS account, and download the access credentials. I use the "arn:aws:iam::aws:policy/AmazonEC2FullAccess” policy.
Add a credentials profile in .aws/credentials file:
- Create a ec2 key pair and save in $HOME/.ec2/ directory.
Create a ec2 security group.
Install and init kitchen-ec2 driver:
- Edit kitchen.yml file:
To view what means each option, visit kitchen-ec2
- Run kitchen
After update kitchen to 1.7.3 version, when run a kitchen test there are next error:
-----> Starting Kitchen (v1.7.3) -----> Creating <aws-testing-ubuntu-trusty64>... If you are not using an account that qualifies under the AWS free-tier, you may be charged to run these suites. The charge should be minimal, but neither Test Kitchen nor its maintainers are responsible for your incurred costs. >>>>>> ------Exception------- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: Failed to complete #create action: [parameter validator found 3 errors: - unexpected value at params[:block_device_mappings][:ebs_device_name] - unexpected value at params[:block_device_mappings][:ebs_volume_size] - unexpected value at params[:block_device_mappings][:ebs_delete_on_termination]] >>>>>> ---------------------- >>>>>> Please see .kitchen/logs/kitchen.log for more details >>>>>> Also try running `kitchen diagnose --all` for configuration
In new kitchen versions the EBS configuration have changed. The new configuration is:
block_device_mappings: - device_name: /dev/sda1 ebs: volume_size: 50 delete_on_termination: true
Create a Vagrant box from existing one