Skip to content

Commit 6818669

Browse files
authored
Merge pull request #34 from melissa/maint/master/skip-master-tests
Maint/master/skip master tests
2 parents 41a80c7 + cff7ed0 commit 6818669

12 files changed

+52
-24
lines changed

setup/aio/011_Install_Puppet_Server.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
extend Beaker::DSL::InstallUtils::FOSSUtils
33

44
test_name "Install Puppet Server" do
5+
skip_test "not testing with puppetserver" unless @options['is_puppetserver']
6+
57
server_version = ENV['SERVER_VERSION'] || 'latest'
68
release_stream = ENV['RELEASE_STREAM'] || 'puppet'
79
nightly_builds_url = ENV['NIGHTLY_BUILDS_URL'] || 'http://nightlies.puppet.com'

setup/aio/020_InstallCumulusModules.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
platforms = hosts.map{|val| val[:platform]}
22
skip_test "No cumulus hosts present" unless platforms.any? { |val| /cumulus/ =~ val }
3+
skip_test "not testing with puppetserver" unless @options['is_puppetserver']
34
confine :to, {}, hosts.select { |host| host[:roles].include?('master') }
45

56
step 'install Cumulus Modules on masters' do
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
platforms = hosts.map{|val| val[:platform]}
2+
skip_test "No arista hosts present" unless platforms.any? { |val| /^eos-/ =~ val }
3+
skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
4+
test_name 'Arista Switch Pre-suite' do
5+
masters = select_hosts({:roles => ['master', 'compile_master']})
6+
7+
step 'install Arista Module on masters' do
8+
masters.each do |node|
9+
on(node, puppet('module','install','aristanetworks-netdev_stdlib_eos'))
10+
end
11+
end
12+
end

setup/aio/021_InstallAristaModule.rb renamed to setup/aio/022_InstallAristaModuleAgents.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
platforms = hosts.map{|val| val[:platform]}
22
skip_test "No arista hosts present" unless platforms.any? { |val| /^eos-/ =~ val }
33
test_name 'Arista Switch Pre-suite' do
4-
masters = select_hosts({:roles => ['master', 'compile_master']})
54
switchs = select_hosts({:platform => ['eos-4-i386']})
65

7-
step 'install Arista Module on masters' do
8-
masters.each do |node|
9-
on(node, puppet('module','install','aristanetworks-netdev_stdlib_eos'))
10-
end
11-
end
12-
136
step 'add puppet user to switch' do
147
switchs.each do |switch|
158
on(switch, "useradd -U puppet")
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
on(master, puppet('resource', 'service', master['puppetservice'], "ensure=running"))
1+
test_name "Ensure the master is running"
2+
skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
3+
4+
on(master, puppet('resource', 'service', master['puppetservice'], "ensure=running", "enable=true"))

setup/common/025_StopFirewall.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_name "Stop firewall" do
2+
skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
23
hosts.each do |host|
34
case host['platform']
45
when /debian/

setup/common/040_ValidateSignCert.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_name "Validate Sign Cert" do
2+
skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
23
hostname = on(master, 'facter hostname').stdout.strip
34
fqdn = on(master, 'facter fqdn').stdout.strip
45

setup/git/010_TestSetup.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,6 @@
7777
end
7878
end
7979

80-
step "Hosts: create basic puppet.conf" do
81-
hosts.each do |host|
82-
confdir = host.puppet['confdir']
83-
on host, "mkdir -p #{confdir}"
84-
puppetconf = File.join(confdir, 'puppet.conf')
85-
86-
if host['roles'].include?('agent')
87-
on host, "echo '[agent]' > '#{puppetconf}' && " +
88-
"echo server=#{master} >> '#{puppetconf}'"
89-
else
90-
on host, "touch '#{puppetconf}'"
91-
end
92-
end
93-
end
94-
9580
step "Hosts: create environments directory like AIO does" do
9681
hosts.each do |host|
9782
codedir = host.puppet['codedir']

setup/git/011_SetMaster.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
test_name 'Hosts: create basic puppet.conf' do
2+
skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
3+
hosts.each do |host|
4+
confdir = host.puppet['confdir']
5+
on host, "mkdir -p #{confdir}"
6+
puppetconf = File.join(confdir, 'puppet.conf')
7+
8+
if host['roles'].include?('agent')
9+
on host, "echo '[agent]' > '#{puppetconf}' && " +
10+
"echo server=#{master} >> '#{puppetconf}'"
11+
else
12+
on host, "touch '#{puppetconf}'"
13+
end
14+
end
15+
end

setup/git/030_PuppetMasterSanity.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
test_name "Puppet Master sanity checks: PID file and SSL dir creation"
22

3+
skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
4+
35
hostname = on(master, 'facter hostname').stdout.strip
46
fqdn = on(master, 'facter fqdn').stdout.strip
57

0 commit comments

Comments
 (0)