SlideShare a Scribd company logo
{
Testing in Infrastructure
Muhammet Arslan
Business Value of TestDriven
InfraStructure?
• Learn of problems earlier by Integrating CI with InfraStructure.
• Scripted InfraStructure becomes Documentations
• Know your newly changes won’t break the olders.
• Cut your non-used resources
• You will test your infrastructure daily.
• Check your system stability, security.
NGP Deployment Principles
How NGP Things are going on ?
Immutable Infrastructure
It means that once you deploy something, you don’t change it
When there is change, you rebuild it up from the host up,
Or the container up and then you tear down the old one altogether
Blue / Green Deployments
With a blue/green deployment, you provision a new set of instances on which
CodeDeploy installs the latest version of your application. CodeDeploy then
reroutes load balancer traffic from an existing set of instances running the previous
version of your application to the new set of instances running the latest version.
After traffic is rerouted to the new instances, the existing instances can be
terminated. Blue/green deployments allow you to test the new application version
before sending production traffic to it. If there is an issue with the newly deployed
application version, you can roll back to the previous version faster than with in-
place deployments. Additionally, the instances provisioned for the blue/green
deployment will reflect the most up-to-date server configurations since they are
new.
Automation ( On RoadMap)
What & Why is acceptance test ?
• Will run after servers have been provisioned.
• Will test the servers are ready for deployment ?
• Make you sure your resources has been successfully provisioned.
• Make sure your resources can connect with other resources
Thing about a small example, we are creating a folder in /opt to store some logs
In state A, but in state B we create a task to clear all /opt folder. Our
Deployment & Provision tool never throws an error, because it did it’s work, but
Because we missed a point, our deployment will fail, because logs couldn’t be stored.
But after provisioning, before deployment, with our acceptance tests we can easily
Check if our /opt/logs is persistent, so we can be sure our logs will be stored.
TestInfra
https://testinfra.readthedocs.io/en/latest/
With Testinfra you can write unit tests in Python to test actual state of your
servers configured by managements tools like Salt, Ansible, Puppet, Chef
and so on.
def test_nginx_running_and_enabled(Service):
nginx = Service("nginx")
assert nginx.is_running
assert nginx.is_enabled
Small Demo
def
test_if_spider_pctm_logs_folder_is_presen
t(File):
logsDirectory = '/spider/PCTM/logs/'
assert File(logsDirectory).is_directory
SimianArmy
Simian Army consists of services (Monkeys) in the cloud for generating various
kinds of failures, detecting abnormal conditions, and testing our ability to
survive them. The goal is to keep our cloud safe, secure, and highly available.
Currently the simians include Chaos Monkey, Janitor Monkey, and Conformity
Monkey.
ChaosMonkey
Chaos Monkey is a service which identifies groups of systems and
randomly terminates one of the systems in a group. The service operates at
a controlled time (does not run on weekends and holidays) and interval
(only operates during business hours).
Why Run ChaosMonkey ?
Failures happen, and they inevitably happen when least desired. If your
application can't tolerate a system failure would you rather find out by being
paged at 3am or after you are in the office having already had your morning
coffee? Even if you are confident that your architecture can tolerate a system
failure, are you sure it will still be able to next week, how about next month?
JanitorMonkey
Janitor Monkey is a service which runs in the Amazon Web Services (AWS)
cloud looking for unused resources to clean up. The design of Janitor Monkey
is flexible enough to allow extending it to work with other cloud providers
and cloud resources. The service is configured to run, by default, on non-
holiday weekdays at 11 AM. The schedule can be easily re-configured to fit
your business' need.
Confornity Monkey
Conformity Monkey is a service which runs in the Amazon Web Services
(AWS) cloud looking for instances that are not conforming to predefined
rules for the best practices. The design of Conformity Monkey is flexible
enough to allow extending it to work with other cloud providers and cloud
resources. By default, conformity checking is performed every hour. The
schedule can be easily re-configured to fit your business' need.

More Related Content

What's hot (16)

PPT
Continuous integration
Andrey Zhupanenko
 
PPT
Building Automated Infrastructures
elliando dias
 
PPTX
Compliance Automation with InSpec
Nathen Harvey
 
PPT
Building An Automated Infrastructure
elliando dias
 
PPTX
Developer day - AWS: Fast Environments = Fast Deployments
Matthew Cwalinski
 
PDF
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Domas Lasauskas
 
PDF
Ansible testing
Allan Denot
 
PDF
Puppet overview
joshbeard
 
PPTX
Chef Configuration Management With RightScale - RightScale Compute 2013
RightScale
 
PDF
Using the Terraform Enterprise GUI is perfect to start working with Terraform...
Mitchell Pronschinske
 
PPTX
Mastering Puppet Configuration Management in the Cloud - RightScale Compute 2013
RightScale
 
PDF
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
Puppet
 
PPTX
Windows Configuration Management: Managing Packages, Services, & Power Shell-...
Puppet
 
PDF
Ansible Integration in Foreman
Nikhil Kathole
 
PDF
Optimizing CakePHP 2.x Apps
Juan Basso
 
PPT
High Availability of Azure Applications
Mindfire Solutions
 
Continuous integration
Andrey Zhupanenko
 
Building Automated Infrastructures
elliando dias
 
Compliance Automation with InSpec
Nathen Harvey
 
Building An Automated Infrastructure
elliando dias
 
Developer day - AWS: Fast Environments = Fast Deployments
Matthew Cwalinski
 
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Domas Lasauskas
 
Ansible testing
Allan Denot
 
Puppet overview
joshbeard
 
Chef Configuration Management With RightScale - RightScale Compute 2013
RightScale
 
Using the Terraform Enterprise GUI is perfect to start working with Terraform...
Mitchell Pronschinske
 
Mastering Puppet Configuration Management in the Cloud - RightScale Compute 2013
RightScale
 
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
Puppet
 
Windows Configuration Management: Managing Packages, Services, & Power Shell-...
Puppet
 
Ansible Integration in Foreman
Nikhil Kathole
 
Optimizing CakePHP 2.x Apps
Juan Basso
 
High Availability of Azure Applications
Mindfire Solutions
 

Similar to Testing in Infrastructure (20)

PPTX
How to Adopt Infrastructure as Code
NGINX, Inc.
 
PDF
Mini-Training: Netflix Simian Army
Betclic Everest Group Tech Team
 
ODP
On the Importance of Infrastructure as Code
Kris Buytaert
 
ODP
Icinga Camp Amsterdam - Infrastructure as Code
Icinga
 
PDF
Infrastructure as code managing servers in the cloud Morris
habanbrino4l
 
PDF
Infrastructure as code managing servers in the cloud Morris
sahfthr3687
 
ODP
Continuous Delivery of (y)our infrastructure.
Kris Buytaert
 
ODP
When traditional configuration management is to slow for your needs
Kris Buytaert
 
PPTX
Chaos Engineering: Why Breaking Things Should Be Practised.
Adrian Hornsby
 
PDF
Pipeline as code for your infrastructure as Code
Kris Buytaert
 
PDF
Infrastructure as code managing servers in the cloud Morris 2024 scribd download
borrosmartdf
 
ODP
From Config Management Sucks to #cfgmgmtlove
Kris Buytaert
 
PPTX
Embracing Failure - Fault Injection and Service Resilience at Netflix
Josh Evans
 
PDF
Clearly, I Have Made Some Bad Decisions
Jonathan Hitchcock
 
PDF
OSMC 2017 | Building a Monitoring solution for modern applications by Martin ...
NETWAYS
 
PPTX
Devops architecture
Ojasvi Jagtap
 
PPTX
Introduction to DevOps
Dmitry Buzdin
 
PPTX
Reply Xchange Milan - Cloud Automation Services - How to Automate Cloud Servi...
Andrea Mercanti
 
PDF
Cloud infrastructure as code
Tomasz Cholewa
 
ODP
Automating MySQL operations with Puppet
Kris Buytaert
 
How to Adopt Infrastructure as Code
NGINX, Inc.
 
Mini-Training: Netflix Simian Army
Betclic Everest Group Tech Team
 
On the Importance of Infrastructure as Code
Kris Buytaert
 
Icinga Camp Amsterdam - Infrastructure as Code
Icinga
 
Infrastructure as code managing servers in the cloud Morris
habanbrino4l
 
Infrastructure as code managing servers in the cloud Morris
sahfthr3687
 
Continuous Delivery of (y)our infrastructure.
Kris Buytaert
 
When traditional configuration management is to slow for your needs
Kris Buytaert
 
Chaos Engineering: Why Breaking Things Should Be Practised.
Adrian Hornsby
 
Pipeline as code for your infrastructure as Code
Kris Buytaert
 
Infrastructure as code managing servers in the cloud Morris 2024 scribd download
borrosmartdf
 
From Config Management Sucks to #cfgmgmtlove
Kris Buytaert
 
Embracing Failure - Fault Injection and Service Resilience at Netflix
Josh Evans
 
Clearly, I Have Made Some Bad Decisions
Jonathan Hitchcock
 
OSMC 2017 | Building a Monitoring solution for modern applications by Martin ...
NETWAYS
 
Devops architecture
Ojasvi Jagtap
 
Introduction to DevOps
Dmitry Buzdin
 
Reply Xchange Milan - Cloud Automation Services - How to Automate Cloud Servi...
Andrea Mercanti
 
Cloud infrastructure as code
Tomasz Cholewa
 
Automating MySQL operations with Puppet
Kris Buytaert
 
Ad

Recently uploaded (20)

PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Ad

Testing in Infrastructure

  • 2. Business Value of TestDriven InfraStructure? • Learn of problems earlier by Integrating CI with InfraStructure. • Scripted InfraStructure becomes Documentations • Know your newly changes won’t break the olders. • Cut your non-used resources • You will test your infrastructure daily. • Check your system stability, security.
  • 4. How NGP Things are going on ?
  • 5. Immutable Infrastructure It means that once you deploy something, you don’t change it When there is change, you rebuild it up from the host up, Or the container up and then you tear down the old one altogether
  • 6. Blue / Green Deployments With a blue/green deployment, you provision a new set of instances on which CodeDeploy installs the latest version of your application. CodeDeploy then reroutes load balancer traffic from an existing set of instances running the previous version of your application to the new set of instances running the latest version. After traffic is rerouted to the new instances, the existing instances can be terminated. Blue/green deployments allow you to test the new application version before sending production traffic to it. If there is an issue with the newly deployed application version, you can roll back to the previous version faster than with in- place deployments. Additionally, the instances provisioned for the blue/green deployment will reflect the most up-to-date server configurations since they are new.
  • 7. Automation ( On RoadMap)
  • 8. What & Why is acceptance test ? • Will run after servers have been provisioned. • Will test the servers are ready for deployment ? • Make you sure your resources has been successfully provisioned. • Make sure your resources can connect with other resources Thing about a small example, we are creating a folder in /opt to store some logs In state A, but in state B we create a task to clear all /opt folder. Our Deployment & Provision tool never throws an error, because it did it’s work, but Because we missed a point, our deployment will fail, because logs couldn’t be stored. But after provisioning, before deployment, with our acceptance tests we can easily Check if our /opt/logs is persistent, so we can be sure our logs will be stored.
  • 9. TestInfra https://testinfra.readthedocs.io/en/latest/ With Testinfra you can write unit tests in Python to test actual state of your servers configured by managements tools like Salt, Ansible, Puppet, Chef and so on. def test_nginx_running_and_enabled(Service): nginx = Service("nginx") assert nginx.is_running assert nginx.is_enabled
  • 10. Small Demo def test_if_spider_pctm_logs_folder_is_presen t(File): logsDirectory = '/spider/PCTM/logs/' assert File(logsDirectory).is_directory
  • 11. SimianArmy Simian Army consists of services (Monkeys) in the cloud for generating various kinds of failures, detecting abnormal conditions, and testing our ability to survive them. The goal is to keep our cloud safe, secure, and highly available. Currently the simians include Chaos Monkey, Janitor Monkey, and Conformity Monkey.
  • 12. ChaosMonkey Chaos Monkey is a service which identifies groups of systems and randomly terminates one of the systems in a group. The service operates at a controlled time (does not run on weekends and holidays) and interval (only operates during business hours). Why Run ChaosMonkey ? Failures happen, and they inevitably happen when least desired. If your application can't tolerate a system failure would you rather find out by being paged at 3am or after you are in the office having already had your morning coffee? Even if you are confident that your architecture can tolerate a system failure, are you sure it will still be able to next week, how about next month?
  • 13. JanitorMonkey Janitor Monkey is a service which runs in the Amazon Web Services (AWS) cloud looking for unused resources to clean up. The design of Janitor Monkey is flexible enough to allow extending it to work with other cloud providers and cloud resources. The service is configured to run, by default, on non- holiday weekdays at 11 AM. The schedule can be easily re-configured to fit your business' need.
  • 14. Confornity Monkey Conformity Monkey is a service which runs in the Amazon Web Services (AWS) cloud looking for instances that are not conforming to predefined rules for the best practices. The design of Conformity Monkey is flexible enough to allow extending it to work with other cloud providers and cloud resources. By default, conformity checking is performed every hour. The schedule can be easily re-configured to fit your business' need.