Skip to content

Commit b257997

Browse files
author
Stephen
committed
Add acceptance tests for redhat
1 parent c492b84 commit b257997

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
centos-64-x64.local:
3+
roles:
4+
- master
5+
platform: el-6-x86_64
6+
box : centos-64-x64-vbox4210-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
master:
3+
roles:
4+
- default
5+
platform: el-7-x86_64
6+
box : jayunit100/centos7
7+
hypervisor : vagrant
8+
CONFIG:
9+
log_level : debug
10+
type: foss

spec/spec_helper_acceptance.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@
1212
hosts.each do |host|
1313
# Install puppet
1414
install_puppet()
15-
1615
osfamily = on(host, facter('osfamily')).stdout.strip
16+
osrelease = on(host, facter('operatingsystemmajrelease')).stdout.strip
1717

1818
puppet_module_install(:source => proj_root, :module_name => 'puppet')
1919
# Install dependencies from Modulefile
2020
shell("echo '127.0.0.1 master.test.local' >> /etc/hosts")
2121
shell('hostname master.test.local')
22-
shell('puppet module install puppetlabs-inifile')
23-
shell('puppet module install puppetlabs-apache')
24-
shell('puppet module install puppetlabs-puppetdb')
25-
shell('puppet module install puppetlabs-stdlib')
22+
on host, puppet('module', 'install', 'puppetlabs-inifile'), { :acceptable_exit_codes => [0,1] }
23+
on host, puppet('module', 'install', 'puppetlabs-apache'), { :acceptable_exit_codes => [0,1] }
24+
on host, puppet('module', 'install', 'puppetlabs-puppetdb'), { :acceptable_exit_codes => [0,1] }
25+
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
2626
if osfamily == 'Debian'
2727
shell('puppet module install puppetlabs-apt')
2828
end
2929
# puppetlabs-apache requires EPEL for mod_passenger
3030
if osfamily == 'RedHat'
31-
shell('puppet module install stahnma-epel')
32-
apply_manifest_on agent, 'class {"epel": }', { :catch_failures => true }
31+
on host, puppet('module', 'install', 'stahnma-epel'), { :acceptable_exit_codes => [0,1] }
32+
on host, puppet('apply', '-e', '"class {epel:}"'), { :acceptable_exit_codes => [0] }
33+
shell("rpm -iv http://yum.theforeman.org/releases/latest/el#{osrelease}/x86_64/foreman-release.rpm")
3334
end
3435
end
3536
end

0 commit comments

Comments
 (0)