Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 8f891b9

Browse files
adding tests
1 parent 7967bff commit 8f891b9

File tree

7 files changed

+64
-5
lines changed

7 files changed

+64
-5
lines changed

.kitchen.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
driver:
3+
# using docker to test
4+
name: docker
5+
privileged: true
6+
7+
provisioner:
8+
# use an ansible playbook to provision our server
9+
name: ansible_playbook
10+
# name of the host
11+
hosts: test-kitchen
12+
13+
platforms:
14+
- name: ubuntu-14.04
15+
16+
suites:
17+
# suites found at /test/integration/$test-name
18+
- name: default

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
sudo: required
3+
# docker is required to run tests
4+
services: docker
5+
6+
install:
7+
- bundle install
8+
9+
script:
10+
# run kitchen tests (destroy, create, converge, setup, verify and destroy)
11+
- bundle exec kitchen test
12+
13+
notifications:
14+
slack:
15+
secure: MwE/AEu48AT3Wm15rfQmoZCDW1ZP/72uMqbyO86BBSbc650iIeGF6oU1nm7NNo8YWfadRoSRKxmLf64hpS5OAEUL4aoYt2mElDO+p5fdYzNwx7xaI+Lr8+YVOBfrPY19I101L0/p6NgoQZko4uFKtT3Jrzkm8FJQHyQtJdclHhMKOfH+MYR7fhJ+n8BFBnoiT6PT1M3zfleo6LfDvLxj3S9cgAYxA2q37OiMOPF+0NrAIU8/TLg1RomH225S5AZp04zT8B2+xa/LY5w9gVbEReH9Lk/CobiQ5Vj+PFbSuKaxiCV/s57jypZvKIVxKIpzYUWliUMLo6Ym12Z0yvqVZVMp0ovxS50mz9nYneowcX7c0UcY1eLBvXgmVnpvvBW4RgP6nnVViQ7WtYlV4aKdZpsi/4zVNH71R/ZcLndwZ6KUqk8wMn8eiPC++WhxdJ+zYimZLiTIP5dwY5dCl7F1F/TNSEWSFzxvtCHVl6E+9W7XmR7sxLwQRX2nrxqlquabhsM58HkNLZMfIoG9/0WQ815FuhsEQNAEIag0ockpZX7IdWOEt0sTyClpdX7be+xlXzgNgd6YFdMwYgzel44YvABOwt4TeVzCoPEVdw58GQsO+xe19/kEHIrPIHUULAyxJBZLCB4VxLyKmPvXgylYvYR61uNXRWClu9Wc/h7htKE=

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'test-kitchen'
4+
gem 'serverspec'
5+
gem 'kitchen-ansible'
6+
gem 'kitchen-docker'

tasks/main.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020
action: ec2_facts
2121

2222
- name: Get CodeDeploy | s3
23-
s3:
24-
mode: get
25-
region: "{{ ansible_ec2_placement_region }}"
26-
bucket: "aws-codedeploy-{{ ansible_ec2_placement_region }}"
27-
object: /latest/install
23+
get_url:
24+
url: "https://aws-codedeploy-{{ ansible_ec2_placement_region }}.s3.amazonaws.com/latest/install"
2825
dest: /tmp/codedeploy-install
2926

3027
- name: Codedeploy Install Binary | Permission Executable

test/integration/default/default.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# host to test against
3+
- hosts: test-kitchen
4+
remote_user: root
5+
6+
roles:
7+
# name of role to test
8+
- role: ansible-codedeploy-agent
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'spec_helper'
2+
3+
describe 'ansible-codedeploy-agent::default' do
4+
5+
describe service('codedeploy-agent') do
6+
it { should be_enabled }
7+
it { should be_running }
8+
end
9+
10+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'serverspec'
2+
3+
# :backend can be either :exec or :ssh
4+
# since we are running local we use :exec
5+
set :backend, :exec

0 commit comments

Comments
 (0)