BREAK IT.

Inspec

Inspec

+

describe port(9200) do
  it { should be_listening }
end

describe command('curl "127.0.0.1:9200/_cluster/health?pretty" > cluster_health.json') do
  its('exit_status') { should eq 0 }
end

describe json('/home/vagrant/cluster_health.json') do
  its('cluster_name') { should eq 'dk_cluster' }
  its('number_of_nodes') { should eq 3 }
  its('number_of_data_nodes') { should eq 3 }
  its('status') { should eq 'green' }
end

Inspec

+

describe apt('http://nginx.org/packages/ubuntu/') do
  it { should exist }
  it { should be_enabled }
end

describe packages(/nginx/) do
  its('statuses') { should cmp 'installed' }
  its('architectures') { should include 'amd64' }
end

describe directory('/var/www/java/') do
  it { should exist }
end

describe service('nginx') do
  it { should be_running }
end

describe service('nginx'), :skip do
  it { should be_enabled }
end

describe port(80) do
  it { should be_listening }
end

Inspec

https://github.com/inspec/inspec-gcp

+

Inspec

+

title 'sample gcp test section'

PROJECT_NUMBER = attribute('project_number', description: 'gcp project number')

control 'gcp-1' do
  impact 0.7
  title 'Check development project'
  describe google_project(project: PROJECT_NUMBER) do
    it { should exist }
    its('name') { should eq 'inspec-gcp' }
    its('project_number') { should cmp PROJECT_NUMBER }
    its('lifecycle_state') { should eq 'ACTIVE' }
  end
end

Test Kitchen

driver:
  name: vagrant

provisioner:
  name: chef_zero
  always_update_cookbooks: true

verifier:
  name: inspec

platforms:
  - name: ubuntu-14.04

suites:
  - name: server
    driver:
      network:
      - ["private_network", {ip: "172.16.0.91"}]
    run_list:
      - recipe[dk_nginx]
      - recipe[dk_oracle_java::repo]
    verifier:
      inspec_tests:
        - test/smoke/server
  - name: client
    driver:
      network:
      - ["private_network", {ip: "172.16.0.92"}]
    run_list:
      - recipe[dk_oracle_java::default]
    verifier:
      inspec_tests:
        - test/smoke/client
    attributes:
      dk_oracle_java:
        local_repo: 172.16.0.91

Test Kitchen

https://github.com/test-kitchen/kitchen-google

+

Test Kitchen

https://github.com/coderanger/kitchen-kubernetes

+

BUILD IT.

Magic Modules

DSL for All

Iggy

https://github.com/inspec/inspec-iggy

CHANGE IT.

Editors

VS Code

Workstation

Chef WorkStation

Monitor CI

Hygieia

Hygieia

Hygieia

deck

By Joaquín Menchaca

deck

Cool Stuff

  • 618