Skip to content

Commit

Permalink
kitchen-inspec working via bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean OMeara committed Nov 10, 2015
1 parent ffb9305 commit 4f96569
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 30 deletions.
12 changes: 10 additions & 2 deletions .kitchen.cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ provisioner:
name: chef_zero
require_chef_omnibus: true

# verifier:
# name: inspec
verifier:
name: inspec

platforms:
- name: centos-6.5
Expand All @@ -23,6 +23,7 @@ platforms:
image: centos-6-5-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[yum-docker]
Expand All @@ -34,6 +35,7 @@ platforms:
image: centos-7-0-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[yum-docker]
Expand All @@ -43,6 +45,7 @@ platforms:
# driver_config:
# image_id: ami-9a6ed3f2
# username: ec2-user
# transport:
# ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
# run_list:
# - recipe[yum-docker]
Expand All @@ -54,6 +57,7 @@ platforms:
image: fedora-21-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[yum-docker]
Expand All @@ -78,6 +82,7 @@ platforms:
image: ubuntu-12-04-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
Expand All @@ -90,6 +95,7 @@ platforms:
image: ubuntu-14-04-x64
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
Expand All @@ -103,6 +109,8 @@ platforms:
region: <%= ENV['DIGITALOCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITALOCEAN_SSH_KEYS'] %>
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
transport:
ssh_key: <%= ENV['DIGITALOCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
- recipe[apt-docker]
Expand Down
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem 'kitchen-digitalocean', path: '../../kitchen-digitalocean'
gem 'kitchen-ec2'
gem 'kitchen-sync'
gem 'berkshelf'
gem 'kitchen-inspec'

Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require 'serverspec'

set :backend, :exec
puts "os: #{os}"
#

docker_version_string = command('docker -v').stdout
docker_version = docker_version_string.split(/\s/)[2].split(',')[0]
Expand Down Expand Up @@ -96,7 +93,7 @@

describe file('/hello-world.tar') do
it { should be_file }
it { should be_mode 644 }
it { should be_mode 0644 }
end

# docker_image[image-1]
Expand Down Expand Up @@ -762,10 +759,10 @@
its(:stdout) { should match(/Exited \(137\)/) }
end

kill_after_start = `docker inspect -f '{{.State.StartedAt}}' kill_after`
kill_after_start = command("docker inspect -f '{{.State.StartedAt}}' kill_after").stdout
kill_after_start = DateTime.parse(kill_after_start).to_time.to_i

kill_after_finish = `docker inspect -f '{{.State.FinishedAt}}' kill_after`
kill_after_finish = command("docker inspect -f '{{.State.FinishedAt}}' kill_after").stdout
kill_after_finish = DateTime.parse(kill_after_finish).to_time.to_i

kill_after_run_time = kill_after_finish - kill_after_start
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require 'serverspec'

set :backend, :exec
puts "os: #{os}"
#

docker_version_string = command('docker -v').stdout
docker_version = docker_version_string.split(/\s/)[2].split(',')[0]
Expand Down Expand Up @@ -96,7 +93,7 @@

describe file('/hello-world.tar') do
it { should be_file }
it { should be_mode 644 }
it { should be_mode 0644 }
end

# docker_image[image-1]
Expand Down Expand Up @@ -762,10 +759,10 @@
its(:stdout) { should match(/Exited \(137\)/) }
end

kill_after_start = `docker inspect -f '{{.State.StartedAt}}' kill_after`
kill_after_start = command("docker inspect -f '{{.State.StartedAt}}' kill_after").stdout
kill_after_start = DateTime.parse(kill_after_start).to_time.to_i

kill_after_finish = `docker inspect -f '{{.State.FinishedAt}}' kill_after`
kill_after_finish = command("docker inspect -f '{{.State.FinishedAt}}' kill_after").stdout
kill_after_finish = DateTime.parse(kill_after_finish).to_time.to_i

kill_after_run_time = kill_after_finish - kill_after_start
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require 'serverspec'

set :backend, :exec
puts "os: #{os}"
#

docker_version_string = command('docker -v').stdout
docker_version = docker_version_string.split(/\s/)[2].split(',')[0]
Expand Down Expand Up @@ -96,7 +93,7 @@

describe file('/hello-world.tar') do
it { should be_file }
it { should be_mode 644 }
it { should be_mode 0644 }
end

# docker_image[image-1]
Expand Down Expand Up @@ -762,10 +759,10 @@
its(:stdout) { should match(/Exited \(137\)/) }
end

kill_after_start = `docker inspect -f '{{.State.StartedAt}}' kill_after`
kill_after_start = command("docker inspect -f '{{.State.StartedAt}}' kill_after").stdout
kill_after_start = DateTime.parse(kill_after_start).to_time.to_i

kill_after_finish = `docker inspect -f '{{.State.FinishedAt}}' kill_after`
kill_after_finish = command("docker inspect -f '{{.State.FinishedAt}}' kill_after").stdout
kill_after_finish = DateTime.parse(kill_after_finish).to_time.to_i

kill_after_run_time = kill_after_finish - kill_after_start
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require 'serverspec'

set :backend, :exec
puts "os: #{os}"
#

docker_version_string = command('docker -v').stdout
docker_version = docker_version_string.split(/\s/)[2].split(',')[0]
Expand Down Expand Up @@ -96,7 +93,7 @@

describe file('/hello-world.tar') do
it { should be_file }
it { should be_mode 644 }
it { should be_mode 0644 }
end

# docker_image[image-1]
Expand Down Expand Up @@ -762,10 +759,10 @@
its(:stdout) { should match(/Exited \(137\)/) }
end

kill_after_start = `docker inspect -f '{{.State.StartedAt}}' kill_after`
kill_after_start = command("docker inspect -f '{{.State.StartedAt}}' kill_after").stdout
kill_after_start = DateTime.parse(kill_after_start).to_time.to_i

kill_after_finish = `docker inspect -f '{{.State.FinishedAt}}' kill_after`
kill_after_finish = command("docker inspect -f '{{.State.FinishedAt}}' kill_after").stdout
kill_after_finish = DateTime.parse(kill_after_finish).to_time.to_i

kill_after_run_time = kill_after_finish - kill_after_start
Expand Down

0 comments on commit 4f96569

Please sign in to comment.