20
TESTING INFRASTRUCTURE AUTOMATION

Testing infra automation

Embed Size (px)

Citation preview

Page 1: Testing infra automation

TESTING INFRASTRUCTURE AUTOMATION

Page 2: Testing infra automation

ABOUT ME

•http://testreflections.wordpress.com/

•@suryasreevedula

2

Page 3: Testing infra automation

AGENDA

•What is “Infrastructure As Code”

•Why test Infrastructure Code?

•How to test Infrastructure Code?

•Test First Infrastructure Using Chef

3

Page 4: Testing infra automation

WHAT IS “INFRASTRUCTURE

AS CODE”

4

Page 5: Testing infra automation

WHAT IS “INFRASTRUCTURE”?

•App Servers

•DB Servers

•Config Servers

5

Page 6: Testing infra automation

TRADITIONAL AUTOMATION

•Not Re-usable

•Changes not usually tracked

•Config Values are not usually externalized

•Not usually / frequently tested

•Not easily accessible to the developer teams

6

Page 7: Testing infra automation

INFRASTRUCTURE AS “CODE”

•Reusable, Maintainable, Extensible and Testable infrastructure.

•Modularize Building Blocks of Infrastructure

•Apply Dev Principles like Inheritance and Composition

•Make Testable

•Version Control Changes like patches, upgrades

•Share modules across the community

7

Page 8: Testing infra automation

BUILDING BLOCKS

8

Resources

Modules / Cookbooks

Nodes

Environments

Page 9: Testing infra automation

IAC FRAMEWORKS

9

Page 10: Testing infra automation

WHY TEST “INFRASTRUCTURE

CODE”

10

Page 11: Testing infra automation

WHY TEST?

•To avoid errors in setting up environments

•To ensure platform coverage

•To ensure different possible system configurations for each platform

11

Page 12: Testing infra automation

HOW TO TEST “INFRASTRUCTURE

CODE”

12

Page 13: Testing infra automation

Ubuntu 10.0.4

System Tests

Unit Tests

Ubuntu 12.0.4

Unit Tests

System Tests

CentOS 6.4

Unit Tests

System Tests

Page 14: Testing infra automation

TEST FIRST INFRASTRUCTURE

DEVELOPMENT

14

Page 15: Testing infra automation

15

Page 16: Testing infra automation

CHEF TESTING ECO-SYSTEM

•Unit Tests - ChefSpec

•System Tests - ServerSpec

•Platform Tests - Test Kitchen

16

Page 17: Testing infra automation

CHEF TESTING ECO-SYSTEM

•Unit Tests - ChefSpec

•System Tests - ServerSpec

•Platform Tests - Test Kitchen

17

Page 18: Testing infra automation

DEMO STAGES

18

Setup Platform

s

Write Server Tests

Add Infra Code

Add Unit Tests

Deploy on

Nodes

Page 19: Testing infra automation

RESOURCES

•<Github Link>

•<Blog Post Links>

19

Page 20: Testing infra automation

Reach me at: !

@suryasreevedula

THANK YOU