Testing for infra code using test-kitchen,docker,chef
Code Using Test-
kitchen, Docker & Chef-
Who Am I
I am an Infrastructure Automation Specialist and a Senior
Consultant with Thoughtworks. Started my career as a
System/Network Administrator for three years, continued the
journey in Infrastructure Automation and Configuration
Management across private and public clouds
(AWS, Openstack). Interested in Infrastructure and Application
Security, IaaS, PaaS and Continuous delivery and usually
present at various conferences.
Read me at : http://www.kamalika.net/
Topics to be covered
Why TDD for infra code
What is test-kitchen
Provision instances on demand => kitchen-docker
Configure the instances => Chef-zero
Test the infra code => Test-kitchen
What are we trying to solve
I. Manual setups per server.
Each Server becomes a
"work of art".
II. No track of what
changes were made
III. Code works in local host
, not in production.
IV. Testing takes forever.
I. Model server
configs, relationships with
other servers, packages in
II. Infra as Code, Code to be
III. Host production like
IV. Scalable Environment On
Infrastructure As Code
Treat your infrastructure as Code
Server configuration, packages installed, relationships with
other servers etc should be modeled with code to be
automated, removing manual steps prone to errors.
Use version controlling for that code.
For instance we can (and should!)
tag, branch and release the code that define our servers.
have a lifecycle that covers different stages through the
infrastructure code, ie. dev, QA, production.
continuously test our infrastructure as we make changes.
Why Test Driven Development for
Code works in my machine as well as in my
Quick feedback for testing Infra code.
Faster you test code , faster you deploy in
Shorter Release Cycle for apps.
Some Real World
Changing web ports
Adding new app metrics
Changing app user
Add a new user
Add basic authentication
Configuring a new machine
Adding additional node to cluster
Test Kitchen is a test harness tool to
execute your configured code on one or
more platforms in isolation.
Support for test
What do we achieve:
More stable and tested build .
Production like environment on your machine in minutes is a
Consistency across all environments.
Automated and Scalable Environment On Demand
Fully Tested Configuration management.
Production go live from 3 weeks to 1 week to multi
deployment per week.
Overall testing time reduction went down by multifold. Build
pipeline time cycle reduction.
Parece que tem um bloqueador de anúncios ativo. Ao listar o SlideShare no seu bloqueador de anúncios, está a apoiar a nossa comunidade de criadores de conteúdo.
Atualizámos a nossa política de privacidade.
Atualizámos a nossa política de privacidade de modo a estarmos em conformidade com os regulamentos de privacidade em constante mutação a nível mundial e para lhe fornecer uma visão sobre as formas limitadas de utilização dos seus dados.
Pode ler os detalhes abaixo. Ao aceitar, está a concordar com a política de privacidade atualizada.