-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jhoblitt/system-tests
System tests
- Loading branch information
Showing
13 changed files
with
186 additions
and
30 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
fixtures: | ||
repositories: | ||
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" | ||
stdlib: | ||
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git' | ||
ref: '3.0.0' | ||
symlinks: | ||
"policykit": "#{source_dir}" | ||
policykit: "#{source_dir}" |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
pkg/ | ||
spec/fixtures/ | ||
Gemfile.lock | ||
*.orig | ||
*.rej | ||
*.patch | ||
pkg/ | ||
*.rej | ||
.rspec_system/ | ||
spec/fixtures/manifests/ | ||
spec/fixtures/modules/ | ||
*.swp |
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,62 @@ | ||
--- | ||
default_set: 'centos-64-x64' | ||
sets: | ||
'centos-58-x64': | ||
nodes: | ||
"main": | ||
prefab: 'centos-58-x64' | ||
'centos-59-x64': | ||
nodes: | ||
"main": | ||
prefab: 'centos-59-x64' | ||
'centos-63-x64': | ||
nodes: | ||
"main": | ||
prefab: 'centos-63-x64' | ||
'centos-64-x64': | ||
nodes: | ||
"main": | ||
prefab: 'centos-64-x64' | ||
'fedora-18-x64': | ||
nodes: | ||
"main": | ||
prefab: 'fedora-18-x64' | ||
'debian-606-x64': | ||
nodes: | ||
"main": | ||
prefab: 'debian-606-x64' | ||
'debian-607-x64': | ||
nodes: | ||
"main": | ||
prefab: 'debian-607-x64' | ||
'debian-70rc1-x64': | ||
nodes: | ||
"main": | ||
prefab: 'debian-70rc1-x64' | ||
'ubuntu-server-1004-x64': | ||
nodes: | ||
"main": | ||
prefab: 'ubuntu-server-1004-x64' | ||
'ubuntu-server-10044-x64': | ||
nodes: | ||
"main": | ||
prefab: 'ubuntu-server-10044-x64' | ||
'ubuntu-server-1204-x64': | ||
nodes: | ||
"main": | ||
prefab: 'ubuntu-server-1204-x64' | ||
'ubuntu-server-12042-x64': | ||
nodes: | ||
"main": | ||
prefab: 'ubuntu-server-12042-x64' | ||
'sles-11sp1-x64': | ||
nodes: | ||
"main": | ||
prefab: 'sles-11sp1-x64' | ||
'centos-64-x64-multi': | ||
default_node: 'first' | ||
nodes: | ||
"first": | ||
prefab: 'centos-64-x64' | ||
"second": | ||
prefab: 'centos-64-x64' |
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
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
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
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
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
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
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
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,25 @@ | ||
require 'rspec-system/spec_helper' | ||
require 'rspec-system-puppet/helpers' | ||
require 'rspec-system-serverspec/helpers' | ||
|
||
include RSpecSystemPuppet::Helpers | ||
|
||
RSpec.configure do |c| | ||
# Project root | ||
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) | ||
|
||
# Enable colour | ||
c.tty = true | ||
|
||
c.include RSpecSystemPuppet::Helpers | ||
|
||
# This is where we 'setup' the nodes before running our tests | ||
c.before :suite do | ||
# Install puppet | ||
puppet_install | ||
|
||
# Install modules and dependencies | ||
puppet_module_install(:source => proj_root, :module_name => 'policykit') | ||
shell('puppet module install puppetlabs-stdlib') | ||
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,29 @@ | ||
require 'spec_helper_system' | ||
|
||
describe 'policykit::localauthority define' do | ||
describe 'running puppet code' do | ||
# Using puppet_apply as a helper | ||
it 'should work with no errors' do | ||
pp = <<-EOS | ||
policykit::localauthority { 'disable suspend': | ||
identity => 'unix-user:*', | ||
action => 'org.freedesktop.upower.suspend', | ||
result_active => 'no', | ||
result_any => 'no', | ||
result_inactive => 'no', | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
puppet_apply(pp) do |r| | ||
r.exit_code.should_not == 1 | ||
r.refresh | ||
r.exit_code.should be_zero | ||
end | ||
end | ||
end | ||
|
||
describe file('/etc/polkit-1/localauthority/50-local.d/disable_suspend.pkla') do | ||
it { should be_file } | ||
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,32 @@ | ||
require 'spec_helper_system' | ||
|
||
describe 'policykit class' do | ||
case node.facts['osfamily'] | ||
when 'RedHat', 'Debian' | ||
package_name = 'polkit' | ||
end | ||
|
||
describe 'running puppet code' do | ||
# Using puppet_apply as a helper | ||
it 'should work with no errors' do | ||
pp = <<-EOS | ||
include policykit | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
puppet_apply(pp) do |r| | ||
r.exit_code.should_not == 1 | ||
r.refresh | ||
r.exit_code.should be_zero | ||
end | ||
end | ||
end | ||
|
||
describe package(package_name) do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/polkit-1/localauthority/50-local.d') do | ||
it { should be_directory } | ||
end | ||
end |