forked from chr4-cookbooks/sshd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
driver_plugin: vagrant | ||
driver_config: | ||
require_chef_omnibus: true | ||
|
||
platforms: | ||
- name: ubuntu-13.04 | ||
driver_config: | ||
box: opscode-ubuntu-13.04 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-13.04_provisionerless.box | ||
|
||
- name: ubuntu-12.10 | ||
driver_config: | ||
box: opscode-ubuntu-12.10 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.10_provisionerless.box | ||
|
||
- name: ubuntu-12.04 | ||
driver_config: | ||
box: opscode-ubuntu-12.04 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box | ||
|
||
- name: debian-7.1.0 | ||
driver_config: | ||
box: opscode-debian-7.1.0 | ||
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_debian-7.1.0_provisionerless.box | ||
|
||
- name: centos-6.4 | ||
driver_config: | ||
box: opscode-centos-6.4 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box | ||
|
||
- name: centos-5.9 | ||
driver_config: | ||
box: opscode-centos-5.9 | ||
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box | ||
|
||
|
||
suites: | ||
- name: custom_port | ||
run_list: | ||
- recipe[minitest-handler] | ||
- recipe[sshd::default] | ||
attributes: | ||
sshd: | ||
sshd_config: | ||
Port: 1234 | ||
|
||
- name: conditional_block | ||
run_list: | ||
- recipe[minitest-handler] | ||
- recipe[sshd::default] | ||
attributes: | ||
sshd: | ||
sshd_config: | ||
Port: 1234 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
site :opscode | ||
|
||
metadata | ||
|
||
group :integration do | ||
cookbook 'minitest-handler' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Cookbook Name:: sshd | ||
# Test:: default | ||
# | ||
# Copyright 2013, Chris Aumann | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
require File.expand_path('../support/helpers', __FILE__) | ||
|
||
describe 'sshd::default' do | ||
include Helpers::TestHelper | ||
|
||
it 'should install openssh-server' do | ||
package(node['sshd']['package']).must_be_installed | ||
end | ||
|
||
it 'should create sshd_config according to specifications' do | ||
file(node['sshd']['config_file']).must_include('Port 1234') | ||
end | ||
|
||
it 'should start openssh-server service' do | ||
service(node['sshd']['service_name']).must_be_running | ||
end | ||
|
||
it 'should enable openssh-server service' do | ||
service(node['sshd']['service_name']).must_be_enabled | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Cookbook Name:: sshd | ||
# | ||
# Copyright 2012, Opscode, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
module Helpers | ||
module TestHelper | ||
require 'chef/mixin/shell_out' | ||
include Chef::Mixin::ShellOut | ||
include MiniTest::Chef::Assertions | ||
include MiniTest::Chef::Context | ||
include MiniTest::Chef::Resources | ||
end | ||
end |