beaker-puppet 1.29.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +28 -7
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +842 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +5 -20
- data/Rakefile +64 -169
- data/acceptance/config/acceptance-options.rb +3 -3
- data/acceptance/config/gem/acceptance-options.rb +8 -8
- data/acceptance/config/git/acceptance-options.rb +8 -8
- data/acceptance/config/pkg/acceptance-options.rb +7 -7
- data/acceptance/pre_suite/gem/install.rb +6 -6
- data/acceptance/pre_suite/git/install.rb +22 -22
- data/acceptance/pre_suite/pkg/install.rb +3 -3
- data/acceptance/tests/backwards_compatible.rb +6 -7
- data/acceptance/tests/clone_git_repo_on_test.rb +12 -13
- data/acceptance/tests/create_tmpdir_on_test.rb +13 -9
- data/acceptance/tests/install_smoke_test.rb +5 -4
- data/acceptance/tests/stub_host.rb +11 -10
- data/acceptance/tests/web_helpers_test.rb +11 -10
- data/beaker-puppet.gemspec +16 -23
- data/bin/beaker-puppet +2 -4
- data/lib/beaker-puppet/helpers/facter_helpers.rb +9 -7
- data/lib/beaker-puppet/helpers/host_helpers.rb +10 -7
- data/lib/beaker-puppet/helpers/puppet_helpers.rb +151 -160
- data/lib/beaker-puppet/helpers/rake_helpers.rb +1 -1
- data/lib/beaker-puppet/helpers/tk_helpers.rb +22 -28
- data/lib/beaker-puppet/install_utils/aio_defaults.rb +39 -43
- data/lib/beaker-puppet/install_utils/ezbake_utils.rb +34 -42
- data/lib/beaker-puppet/install_utils/foss_defaults.rb +134 -138
- data/lib/beaker-puppet/install_utils/foss_utils.rb +293 -320
- data/lib/beaker-puppet/install_utils/module_utils.rb +58 -70
- data/lib/beaker-puppet/install_utils/puppet5.rb +30 -35
- data/lib/beaker-puppet/install_utils/puppet_utils.rb +58 -68
- data/lib/beaker-puppet/install_utils/windows_utils.rb +34 -36
- data/lib/beaker-puppet/version.rb +1 -1
- data/lib/beaker-puppet/wrappers.rb +13 -14
- data/lib/beaker-puppet.rb +4 -5
- data/setup/aio/010_Install_Puppet_Agent.rb +5 -6
- data/setup/common/000-delete-puppet-when-none.rb +2 -4
- data/setup/common/003_solaris_cert_fix.rb +74 -70
- data/setup/common/005_redhat_subscription_fix.rb +3 -2
- data/setup/common/011_Install_Puppet_Server.rb +7 -9
- data/setup/common/012_Finalize_Installs.rb +5 -5
- data/setup/common/025_StopFirewall.rb +1 -1
- data/setup/common/030_StopSssd.rb +2 -2
- data/setup/common/040_ValidateSignCert.rb +10 -12
- data/setup/common/045_EnsureMasterStarted.rb +2 -2
- data/setup/gem/010_GemInstall.rb +5 -4
- data/setup/git/000_EnvSetup.rb +48 -48
- data/setup/git/010_TestSetup.rb +13 -12
- data/setup/git/020_PuppetUserAndGroup.rb +3 -2
- data/setup/git/060_InstallModules.rb +14 -14
- data/setup/git/070_InstallCACerts.rb +82 -82
- data/spec/beaker-puppet/helpers/facter_helpers_spec.rb +22 -24
- data/spec/beaker-puppet/helpers/host_helpers_spec.rb +10 -6
- data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +506 -517
- data/spec/beaker-puppet/helpers/tk_helpers_spec.rb +20 -24
- data/spec/beaker-puppet/install_utils/ezbake_utils_spec.rb +86 -90
- data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +636 -599
- data/spec/beaker-puppet/install_utils/module_utils_spec.rb +125 -116
- data/spec/beaker-puppet/install_utils/puppet5_spec.rb +159 -165
- data/spec/beaker-puppet/install_utils/puppet_utils_spec.rb +92 -77
- data/spec/beaker-puppet/install_utils/windows_utils_spec.rb +101 -89
- data/spec/beaker-puppet/wrappers_spec.rb +10 -10
- data/spec/helpers.rb +85 -91
- data/tasks/ci.rake +171 -179
- metadata +33 -62
- data/setup/common/020_InstallCumulusModules.rb +0 -13
- data/setup/common/021_InstallAristaModuleMasters.rb +0 -12
- data/setup/common/022_InstallAristaModuleAgents.rb +0 -13
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,37 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [2.0.0](https://github.com/voxpupuli/beaker-puppet/tree/2.0.0) (2023-05-05)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.29.0...2.0.0)
|
8
|
+
|
9
|
+
**Breaking changes:**
|
10
|
+
|
11
|
+
- Drop Ruby 2.4/2.5/2.6 & GCG: Add faraday-retry dep [\#218](https://github.com/voxpupuli/beaker-puppet/pull/218) ([bastelfreak](https://github.com/bastelfreak))
|
12
|
+
- add support for recent FreeBSD versions; Drop FreeBSD 9/10 support [\#207](https://github.com/voxpupuli/beaker-puppet/pull/207) ([evgeni](https://github.com/evgeni))
|
13
|
+
- Removes deprecated network device platforms [\#205](https://github.com/voxpupuli/beaker-puppet/pull/205) ([mhashizume](https://github.com/mhashizume))
|
14
|
+
|
15
|
+
**Implemented enhancements:**
|
16
|
+
|
17
|
+
- Implement RuboCop [\#212](https://github.com/voxpupuli/beaker-puppet/pull/212) ([bastelfreak](https://github.com/bastelfreak))
|
18
|
+
- \(maint\) Call `exist?` instead of `exists?` [\#204](https://github.com/voxpupuli/beaker-puppet/pull/204) ([mhashizume](https://github.com/mhashizume))
|
19
|
+
|
20
|
+
**Fixed bugs:**
|
21
|
+
|
22
|
+
- configure defaults on FreeBSD [\#210](https://github.com/voxpupuli/beaker-puppet/pull/210) ([evgeni](https://github.com/evgeni))
|
23
|
+
|
24
|
+
**Merged pull requests:**
|
25
|
+
|
26
|
+
- Update fakefs requirement from \>= 0.6, \< 2.0 to \>= 0.6, \< 3.0 [\#222](https://github.com/voxpupuli/beaker-puppet/pull/222) ([dependabot[bot]](https://github.com/apps/dependabot))
|
27
|
+
- rubocop: fix layout cops [\#221](https://github.com/voxpupuli/beaker-puppet/pull/221) ([bastelfreak](https://github.com/bastelfreak))
|
28
|
+
- rubocop: fix style violations [\#220](https://github.com/voxpupuli/beaker-puppet/pull/220) ([bastelfreak](https://github.com/bastelfreak))
|
29
|
+
- CI: Build gems with strictness and verbosity & dependencies: Add version constraints [\#219](https://github.com/voxpupuli/beaker-puppet/pull/219) ([bastelfreak](https://github.com/bastelfreak))
|
30
|
+
- CI: apply Vox Pupuli best practices [\#217](https://github.com/voxpupuli/beaker-puppet/pull/217) ([bastelfreak](https://github.com/bastelfreak))
|
31
|
+
- Drop in-parallel dependency [\#214](https://github.com/voxpupuli/beaker-puppet/pull/214) ([ekohl](https://github.com/ekohl))
|
32
|
+
- Bump actions/checkout from 2 to 3 [\#211](https://github.com/voxpupuli/beaker-puppet/pull/211) ([dependabot[bot]](https://github.com/apps/dependabot))
|
33
|
+
- tests: Always set the platform as a Beaker::Platform instance [\#209](https://github.com/voxpupuli/beaker-puppet/pull/209) ([ekohl](https://github.com/ekohl))
|
34
|
+
- dependabot: check for github actions [\#208](https://github.com/voxpupuli/beaker-puppet/pull/208) ([bastelfreak](https://github.com/bastelfreak))
|
35
|
+
|
5
36
|
## [1.29.0](https://github.com/voxpupuli/beaker-puppet/tree/1.29.0) (2022-11-02)
|
6
37
|
|
7
38
|
[Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.28.0...1.29.0)
|
data/Gemfile
CHANGED
@@ -1,28 +1,13 @@
|
|
1
|
-
source ENV['GEM_SOURCE'] ||
|
1
|
+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
def location_for(place, fake_version = nil)
|
6
|
-
if place =~ /^(git:[^#]*)#(.*)/
|
7
|
-
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
|
8
|
-
elsif place =~ /^file:\/\/(.*)/
|
9
|
-
['>= 0', { :path => File.expand_path($1), :require => false }]
|
10
|
-
else
|
11
|
-
[place, { :require => false }]
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
group :test do
|
17
|
-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || ['>= 4.30.0', '< 5.0.0'])
|
18
|
-
gem "beaker-abs", *location_for(ENV['ABS_VERSION'] || '~> 0.4.0')
|
19
|
-
end
|
20
|
-
|
21
5
|
group :release do
|
6
|
+
gem 'faraday-retry', require: false
|
22
7
|
gem 'github_changelog_generator', require: false
|
23
8
|
end
|
24
9
|
|
25
|
-
group :coverage, optional: ENV['COVERAGE']!='yes' do
|
26
|
-
gem '
|
27
|
-
gem '
|
10
|
+
group :coverage, optional: ENV['COVERAGE'] != 'yes' do
|
11
|
+
gem 'codecov', require: false
|
12
|
+
gem 'simplecov-console', require: false
|
28
13
|
end
|
data/Rakefile
CHANGED
@@ -2,74 +2,69 @@ require 'rspec/core/rake_task'
|
|
2
2
|
require 'securerandom'
|
3
3
|
require 'beaker-hostgenerator'
|
4
4
|
|
5
|
-
|
6
5
|
namespace :test do
|
7
|
-
|
8
6
|
namespace :spec do
|
9
|
-
|
10
|
-
desc "Run spec tests"
|
7
|
+
desc 'Run spec tests'
|
11
8
|
RSpec::Core::RakeTask.new(:run) do |t|
|
12
9
|
t.rspec_opts = ['--color']
|
13
10
|
t.pattern = 'spec/'
|
14
11
|
end
|
15
12
|
|
16
|
-
desc
|
13
|
+
desc 'Run spec tests with coverage'
|
17
14
|
RSpec::Core::RakeTask.new(:coverage) do |t|
|
18
15
|
ENV['BEAKER_PUPPET_COVERAGE'] = 'y'
|
19
16
|
t.rspec_opts = ['--color']
|
20
17
|
t.pattern = 'spec/'
|
21
18
|
end
|
22
|
-
|
23
19
|
end
|
24
20
|
|
25
21
|
namespace :acceptance do
|
26
|
-
USAGE =
|
27
|
-
You may set BEAKER_HOSTS=config/nodes/foo.yaml or include it in an acceptance-options.rb for Beaker,
|
28
|
-
or specify TEST_TARGET in a form beaker-hostgenerator accepts, e.g. ubuntu1504-64a.
|
29
|
-
You may override the default master test target by specifying MASTER_TEST_TARGET.
|
30
|
-
You may set TESTS=path/to/test,and/more/tests.
|
31
|
-
You may set additional Beaker OPTIONS='--more --options'
|
32
|
-
If there is a Beaker options hash in a ./acceptance/local_options.rb, it will be included.
|
33
|
-
Commandline options set through the above environment variables will override settings in this file.
|
22
|
+
USAGE = <<~EOS
|
23
|
+
You may set BEAKER_HOSTS=config/nodes/foo.yaml or include it in an acceptance-options.rb for Beaker,
|
24
|
+
or specify TEST_TARGET in a form beaker-hostgenerator accepts, e.g. ubuntu1504-64a.
|
25
|
+
You may override the default master test target by specifying MASTER_TEST_TARGET.
|
26
|
+
You may set TESTS=path/to/test,and/more/tests.
|
27
|
+
You may set additional Beaker OPTIONS='--more --options'
|
28
|
+
If there is a Beaker options hash in a ./acceptance/local_options.rb, it will be included.
|
29
|
+
Commandline options set through the above environment variables will override settings in this file.
|
34
30
|
EOS
|
35
31
|
|
36
|
-
desc
|
37
|
-
Run the puppet beaker acceptance tests on a puppet gem install.
|
38
|
-
#{USAGE}
|
32
|
+
desc <<~EOS
|
33
|
+
Run the puppet beaker acceptance tests on a puppet gem install.
|
34
|
+
#{USAGE}
|
39
35
|
EOS
|
40
|
-
task :
|
36
|
+
task gem: 'gen_hosts' do
|
41
37
|
beaker_test(:gem)
|
42
38
|
end
|
43
39
|
|
44
|
-
desc
|
45
|
-
Run the puppet beaker acceptance tests on a puppet git install.
|
46
|
-
#{USAGE}
|
40
|
+
desc <<~EOS
|
41
|
+
Run the puppet beaker acceptance tests on a puppet git install.
|
42
|
+
#{USAGE}
|
47
43
|
EOS
|
48
|
-
task :
|
44
|
+
task git: 'gen_hosts' do
|
49
45
|
beaker_test(:git)
|
50
46
|
end
|
51
47
|
|
52
|
-
desc
|
53
|
-
Run the puppet beaker acceptance tests on a puppet package install.
|
54
|
-
#{USAGE}
|
48
|
+
desc <<~EOS
|
49
|
+
Run the puppet beaker acceptance tests on a puppet package install.
|
50
|
+
#{USAGE}
|
55
51
|
EOS
|
56
|
-
task :
|
52
|
+
task pkg: 'gen_hosts' do
|
57
53
|
beaker_test(:pkg)
|
58
54
|
end
|
59
55
|
|
60
|
-
desc
|
61
|
-
Run the puppet beaker acceptance tests on a base system (no install).
|
62
|
-
#{USAGE}
|
56
|
+
desc <<~EOS
|
57
|
+
Run the puppet beaker acceptance tests on a base system (no install).
|
58
|
+
#{USAGE}
|
63
59
|
EOS
|
64
|
-
task :
|
65
|
-
beaker_test
|
60
|
+
task base: 'gen_hosts' do
|
61
|
+
beaker_test
|
66
62
|
end
|
67
63
|
|
68
64
|
desc 'Generate Beaker Host Config File'
|
69
65
|
task :gen_hosts do
|
70
|
-
if hosts_file_env
|
71
|
-
|
72
|
-
end
|
66
|
+
next if hosts_file_env
|
67
|
+
|
73
68
|
cli = BeakerHostGenerator::CLI.new([test_targets])
|
74
69
|
FileUtils.mkdir_p('tmp') # -p ignores when dir already exists
|
75
70
|
File.open("tmp/#{HOSTS_FILE}", 'w') do |fh|
|
@@ -77,20 +72,18 @@ Run the puppet beaker acceptance tests on a base system (no install).
|
|
77
72
|
end
|
78
73
|
end
|
79
74
|
|
80
|
-
def hosts_opt(use_preserved_hosts=false)
|
75
|
+
def hosts_opt(use_preserved_hosts = false)
|
81
76
|
if use_preserved_hosts
|
82
77
|
"--hosts=#{HOSTS_PRESERVED}"
|
78
|
+
elsif hosts_file_env
|
79
|
+
"--hosts=#{hosts_file_env}"
|
83
80
|
else
|
84
|
-
|
85
|
-
"--hosts=#{hosts_file_env}"
|
86
|
-
else
|
87
|
-
"--hosts=tmp/#{HOSTS_FILE}"
|
88
|
-
end
|
81
|
+
"--hosts=tmp/#{HOSTS_FILE}"
|
89
82
|
end
|
90
83
|
end
|
91
84
|
|
92
85
|
def hosts_file_env
|
93
|
-
ENV
|
86
|
+
ENV.fetch('BEAKER_HOSTS', nil)
|
94
87
|
end
|
95
88
|
|
96
89
|
def agent_target
|
@@ -106,53 +99,52 @@ Run the puppet beaker acceptance tests on a base system (no install).
|
|
106
99
|
end
|
107
100
|
|
108
101
|
HOSTS_FILE = "#{test_targets}-#{SecureRandom.uuid}.yaml"
|
109
|
-
HOSTS_PRESERVED
|
102
|
+
HOSTS_PRESERVED = 'log/latest/hosts_preserved.yml'
|
110
103
|
|
111
104
|
def beaker_test(mode = :base, options = {})
|
112
|
-
|
113
105
|
preserved_hosts_mode = options[:hosts] == HOSTS_PRESERVED
|
114
106
|
final_options = HarnessOptions.final_options(mode, options)
|
115
107
|
|
116
|
-
options_opt
|
108
|
+
options_opt = ''
|
117
109
|
# preserved hosts can not be used with an options file (BKR-670)
|
118
110
|
# one can still use OPTIONS
|
119
111
|
|
120
|
-
|
112
|
+
unless preserved_hosts_mode
|
121
113
|
options_file = 'merged_options.rb'
|
122
114
|
options_opt = "--options-file=#{options_file}"
|
123
115
|
File.open(options_file, 'w') do |merged|
|
124
|
-
merged.puts
|
125
|
-
# Copy this file to local_options.rb and adjust as needed if you wish to run
|
126
|
-
# with some local overrides.
|
116
|
+
merged.puts <<~EOS
|
117
|
+
# Copy this file to local_options.rb and adjust as needed if you wish to run
|
118
|
+
# with some local overrides.
|
127
119
|
EOS
|
128
120
|
merged.puts(final_options)
|
129
121
|
end
|
130
122
|
end
|
131
123
|
|
132
|
-
tests = ENV['TESTS'] || ENV
|
133
|
-
tests_opt =
|
124
|
+
tests = ENV['TESTS'] || ENV.fetch('TEST', nil)
|
125
|
+
tests_opt = ''
|
134
126
|
tests_opt = "--tests=#{tests}" if tests
|
135
127
|
|
136
128
|
overriding_options = ENV['OPTIONS'].to_s
|
137
129
|
|
138
130
|
args = [options_opt, hosts_opt(preserved_hosts_mode), tests_opt,
|
139
|
-
*overriding_options.split(' ')].compact
|
131
|
+
*overriding_options.split(' '),].compact
|
140
132
|
|
141
|
-
sh(
|
133
|
+
sh('beaker', *args)
|
142
134
|
end
|
143
135
|
|
144
136
|
module HarnessOptions
|
145
137
|
defaults = {
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
138
|
+
tests: ['tests'],
|
139
|
+
log_level: 'debug',
|
140
|
+
preserve_hosts: 'onfail',
|
149
141
|
}
|
150
142
|
|
151
143
|
DEFAULTS = defaults
|
152
144
|
|
153
145
|
def self.get_options(file_path)
|
154
146
|
puts "Attempting to merge config file: #{file_path}"
|
155
|
-
if File.
|
147
|
+
if File.exist? file_path
|
156
148
|
options = eval(File.read(file_path), binding)
|
157
149
|
else
|
158
150
|
puts "No options file found at #{File.expand_path(file_path)}... skipping"
|
@@ -175,11 +167,8 @@ Run the puppet beaker acceptance tests on a base system (no install).
|
|
175
167
|
final_options.merge!(intermediary_options)
|
176
168
|
final_options.merge!(local_overrides)
|
177
169
|
end
|
178
|
-
|
179
170
|
end
|
180
|
-
|
181
171
|
end
|
182
|
-
|
183
172
|
end
|
184
173
|
|
185
174
|
# namespace-named default tasks.
|
@@ -189,124 +178,30 @@ task 'test:spec' => 'test:spec:run'
|
|
189
178
|
task 'test:acceptance' => 'test:acceptance:quick'
|
190
179
|
|
191
180
|
# global defaults
|
192
|
-
task :
|
193
|
-
task :
|
194
|
-
|
195
|
-
###########################################################
|
196
|
-
#
|
197
|
-
# Documentation Tasks
|
198
|
-
#
|
199
|
-
###########################################################
|
200
|
-
DOCS_DAEMON = "yard server --reload --daemon --server thin"
|
201
|
-
FOREGROUND_SERVER = 'bundle exec yard server --reload --verbose --server thin lib/beaker'
|
202
|
-
|
203
|
-
def running?( cmdline )
|
204
|
-
ps = `ps -ef`
|
205
|
-
found = ps.lines.grep( /#{Regexp.quote( cmdline )}/ )
|
206
|
-
if found.length > 1
|
207
|
-
raise StandardError, "Found multiple YARD Servers. Don't know what to do."
|
208
|
-
end
|
209
|
-
|
210
|
-
yes = found.empty? ? false : true
|
211
|
-
return yes, found.first
|
212
|
-
end
|
213
|
-
|
214
|
-
def pid_from( output )
|
215
|
-
output.squeeze(' ').strip.split(' ')[1]
|
216
|
-
end
|
217
|
-
|
218
|
-
desc 'Start the documentation server in the foreground'
|
219
|
-
task :docs => 'docs:clear' do
|
220
|
-
original_dir = Dir.pwd
|
221
|
-
Dir.chdir( File.expand_path(File.dirname(__FILE__)) )
|
222
|
-
sh FOREGROUND_SERVER
|
223
|
-
Dir.chdir( original_dir )
|
224
|
-
end
|
225
|
-
|
226
|
-
namespace :docs do
|
227
|
-
|
228
|
-
desc 'Clear the generated documentation cache'
|
229
|
-
task :clear do
|
230
|
-
original_dir = Dir.pwd
|
231
|
-
Dir.chdir( File.expand_path(File.dirname(__FILE__)) )
|
232
|
-
sh 'rm -rf docs'
|
233
|
-
Dir.chdir( original_dir )
|
234
|
-
end
|
235
|
-
|
236
|
-
desc 'Generate static documentation'
|
237
|
-
task :gen => 'docs:clear' do
|
238
|
-
original_dir = Dir.pwd
|
239
|
-
Dir.chdir( File.expand_path(File.dirname(__FILE__)) )
|
240
|
-
output = `bundle exec yard doc`
|
241
|
-
puts output
|
242
|
-
if output =~ /\[warn\]|\[error\]/
|
243
|
-
fail "Errors/Warnings during yard documentation generation"
|
244
|
-
end
|
245
|
-
Dir.chdir( original_dir )
|
246
|
-
end
|
247
|
-
|
248
|
-
desc 'Run the documentation server in the background, alias `bg`'
|
249
|
-
task :background => 'docs:clear' do
|
250
|
-
yes, output = running?( DOCS_DAEMON )
|
251
|
-
if yes
|
252
|
-
puts "Not starting a new YARD Server..."
|
253
|
-
puts "Found one running with pid #{pid_from( output )}."
|
254
|
-
else
|
255
|
-
original_dir = Dir.pwd
|
256
|
-
Dir.chdir( File.expand_path(File.dirname(__FILE__)) )
|
257
|
-
sh "bundle exec #{DOCS_DAEMON}"
|
258
|
-
Dir.chdir( original_dir )
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
task(:bg) { Rake::Task['docs:background'].invoke }
|
263
|
-
|
264
|
-
desc 'Check the status of the documentation server'
|
265
|
-
task :status do
|
266
|
-
yes, output = running?( DOCS_DAEMON )
|
267
|
-
if yes
|
268
|
-
pid = pid_from( output )
|
269
|
-
puts "Found a YARD Server running with pid #{pid}"
|
270
|
-
else
|
271
|
-
puts "Could not find a running YARD Server."
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
desc "Stop a running YARD Server"
|
276
|
-
task :stop do
|
277
|
-
yes, output = running?( DOCS_DAEMON )
|
278
|
-
if yes
|
279
|
-
pid = pid_from( output )
|
280
|
-
puts "Found a YARD Server running with pid #{pid}"
|
281
|
-
`kill #{pid}`
|
282
|
-
puts "Stopping..."
|
283
|
-
yes, output = running?( DOCS_DAEMON )
|
284
|
-
if yes
|
285
|
-
`kill -9 #{pid}`
|
286
|
-
yes, output = running?( DOCS_DAEMON )
|
287
|
-
if yes
|
288
|
-
puts "Could not Stop Server!"
|
289
|
-
else
|
290
|
-
puts "Server stopped."
|
291
|
-
end
|
292
|
-
else
|
293
|
-
puts "Server stopped."
|
294
|
-
end
|
295
|
-
else
|
296
|
-
puts "Could not find a running YARD Server"
|
297
|
-
end
|
298
|
-
end
|
299
|
-
end
|
181
|
+
task test: 'test:spec'
|
182
|
+
task default: :test
|
300
183
|
|
301
184
|
begin
|
302
185
|
require 'github_changelog_generator/task'
|
303
|
-
|
186
|
+
rescue LoadError
|
187
|
+
# GCG is an optional group
|
188
|
+
else
|
304
189
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
305
190
|
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
|
306
|
-
config.exclude_labels = %w
|
191
|
+
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog]
|
307
192
|
config.user = 'voxpupuli'
|
308
193
|
config.project = 'beaker-puppet'
|
309
194
|
config.future_release = "#{Gem::Specification.load("#{config.project}.gemspec").version}"
|
310
195
|
end
|
196
|
+
end
|
197
|
+
|
198
|
+
begin
|
199
|
+
require 'rubocop/rake_task'
|
311
200
|
rescue LoadError
|
201
|
+
# RuboCop is an optional group
|
202
|
+
else
|
203
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
204
|
+
# These make the rubocop experience maybe slightly less terrible
|
205
|
+
task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
|
206
|
+
end
|
312
207
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
|
-
:
|
3
|
-
:
|
4
|
-
:
|
2
|
+
load_path: File.join('acceptance', 'lib'),
|
3
|
+
ssh: {
|
4
|
+
keys: ['id_rsa_acceptance', "#{ENV.fetch('HOME', nil)}/.ssh/id_rsa-acceptance"],
|
5
5
|
},
|
6
6
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}.merge(eval
|
2
|
+
type: 'foss',
|
3
|
+
add_el_extras: 'true',
|
4
|
+
is_puppetserver: false,
|
5
|
+
puppetservice: 'puppet.service',
|
6
|
+
pre_suite: 'acceptance/pre_suite/gem/install.rb',
|
7
|
+
tests: 'acceptance/tests',
|
8
|
+
'master-start-curl-retries': 30,
|
9
|
+
}.merge(eval(File.read('acceptance/config/acceptance-options.rb')))
|
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}.merge(eval
|
2
|
+
type: 'foss',
|
3
|
+
add_el_extras: 'true',
|
4
|
+
is_puppetserver: false,
|
5
|
+
puppetservice: 'puppet.service',
|
6
|
+
pre_suite: 'acceptance/pre_suite/git/install.rb',
|
7
|
+
tests: 'acceptance/tests',
|
8
|
+
'master-start-curl-retries': 30,
|
9
|
+
}.merge(eval(File.read('acceptance/config/acceptance-options.rb')))
|
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}.merge(eval
|
2
|
+
type: 'foss',
|
3
|
+
is_puppetserver: false,
|
4
|
+
puppetservice: 'puppet.service',
|
5
|
+
pre_suite: 'acceptance/pre_suite/pkg/install.rb',
|
6
|
+
tests: 'acceptance/tests',
|
7
|
+
'master-start-curl-retries': 30,
|
8
|
+
}.merge(eval(File.read('acceptance/config/acceptance-options.rb')))
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'beaker-puppet'
|
2
2
|
|
3
3
|
hosts.each do |host|
|
4
|
-
install_puppet_from_gem(host, {:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
install_puppet_from_gem(host, { version: '3.8.7' })
|
5
|
+
next if host['platform'] =~ /windows/
|
6
|
+
|
7
|
+
on(host, "touch #{File.join(host.puppet['confdir'], 'puppet.conf')}")
|
8
|
+
on(host, puppet('resource user puppet ensure=present'))
|
9
|
+
on(host, puppet('resource group puppet ensure=present'))
|
10
10
|
end
|
@@ -5,27 +5,27 @@ test_name 'Puppet git pre-suite'
|
|
5
5
|
install = [
|
6
6
|
'facter#2.1.0',
|
7
7
|
'hiera#1.3.4',
|
8
|
-
'puppet#3.8.7'
|
8
|
+
'puppet#3.8.7',
|
9
9
|
]
|
10
10
|
|
11
11
|
PACKAGES = {
|
12
|
-
:
|
12
|
+
redhat: [
|
13
13
|
'git',
|
14
14
|
'ruby',
|
15
15
|
'rubygem-json', # :add_el_extras is required to find this package
|
16
16
|
],
|
17
|
-
:
|
18
|
-
[
|
17
|
+
debian: [
|
18
|
+
%w[git git-core],
|
19
19
|
'ruby',
|
20
20
|
],
|
21
|
-
:
|
21
|
+
debian_ruby18: [
|
22
22
|
'libjson-ruby',
|
23
23
|
],
|
24
|
-
:
|
24
|
+
solaris_11: [
|
25
25
|
['git', 'developer/versioning/git'],
|
26
26
|
['ruby', 'runtime/ruby-18'],
|
27
27
|
],
|
28
|
-
:
|
28
|
+
solaris_10: [
|
29
29
|
'coreutils',
|
30
30
|
'curl', # update curl to fix "CURLOPT_SSL_VERIFYHOST no longer supports 1 as value!" issue
|
31
31
|
'git',
|
@@ -33,16 +33,16 @@ PACKAGES = {
|
|
33
33
|
'ruby19_dev',
|
34
34
|
'gcc4core',
|
35
35
|
],
|
36
|
-
:
|
36
|
+
windows: [
|
37
37
|
'git',
|
38
|
-
|
38
|
+
# there isn't a need for json on windows because it is bundled in ruby 1.9
|
39
39
|
],
|
40
|
-
:
|
40
|
+
sles: [
|
41
41
|
'git-core',
|
42
|
-
]
|
42
|
+
],
|
43
43
|
}
|
44
44
|
|
45
|
-
install_packages_on(hosts, PACKAGES, :
|
45
|
+
install_packages_on(hosts, PACKAGES, check_if_exists: true)
|
46
46
|
|
47
47
|
hosts.each do |host|
|
48
48
|
case host['platform']
|
@@ -57,11 +57,11 @@ hosts.each do |host|
|
|
57
57
|
end
|
58
58
|
|
59
59
|
step "#{host} Install ruby from git using revision #{revision}"
|
60
|
-
# TODO remove this step once we are installing puppet from msi packages
|
61
|
-
install_from_git(host,
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
60
|
+
# TODO: remove this step once we are installing puppet from msi packages
|
61
|
+
install_from_git(host, '/opt/puppet-git-repos',
|
62
|
+
name: 'puppet-win32-ruby',
|
63
|
+
path: build_giturl('puppet-win32-ruby'),
|
64
|
+
rev: revision)
|
65
65
|
on host, 'cd /opt/puppet-git-repos/puppet-win32-ruby; cp -r ruby/* /'
|
66
66
|
on host, 'cd /lib; icacls ruby /grant "Everyone:(OI)(CI)(RX)"'
|
67
67
|
on host, 'cd /lib; icacls ruby /reset /T'
|
@@ -85,9 +85,9 @@ hosts.each do |host|
|
|
85
85
|
repos.each do |repo|
|
86
86
|
install_from_git(host, SourcePath, repo)
|
87
87
|
end
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
88
|
+
next if host['platform'] =~ /windows/
|
89
|
+
|
90
|
+
on(host, "touch #{File.join(host.puppet['confdir'], 'puppet.conf')}")
|
91
|
+
on(host, puppet('resource user puppet ensure=present'))
|
92
|
+
on(host, puppet('resource group puppet ensure=present'))
|
93
93
|
end
|
@@ -4,9 +4,9 @@ require 'beaker-puppet'
|
|
4
4
|
# all versions are required for osx
|
5
5
|
hosts.each do |host|
|
6
6
|
install_puppet_on(host, {
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
version: ENV['BEAKER_PUPPET_VERSION'] || '5.5.20',
|
8
|
+
puppet_agent_version: ENV['BEAKER_PUPPET_AGENT_VERSION'] || '5.5.20',
|
9
|
+
})
|
10
10
|
|
11
11
|
on(host, puppet('resource user puppet ensure=present'))
|
12
12
|
on(host, puppet('resource group puppet ensure=present'))
|
@@ -1,19 +1,18 @@
|
|
1
1
|
test_name 'backwards compatible test' do
|
2
|
-
|
3
2
|
step 'calls the new FOSSUtils even if I require & include the old path' do
|
4
3
|
require 'beaker/dsl/install_utils/foss_utils'
|
5
|
-
assert(
|
6
|
-
assert(
|
4
|
+
assert(!Beaker::DSL::InstallUtils::FOSSUtils::SourcePath.nil?)
|
5
|
+
assert(Beaker::DSL::InstallUtils::FOSSUtils.method_defined?(:lookup_in_env))
|
7
6
|
end
|
8
7
|
|
9
8
|
step 'require old Helpers path, get helpers from new location' do
|
10
9
|
require 'beaker/dsl/helpers/puppet_helpers'
|
11
|
-
assert(
|
12
|
-
assert(
|
10
|
+
assert(Beaker::DSL::Helpers::PuppetHelpers.method_defined?(:puppet_user))
|
11
|
+
assert(Beaker::DSL::Helpers::PuppetHelpers.method_defined?(:resolve_hostname_on))
|
13
12
|
end
|
14
13
|
|
15
14
|
step 'require old Helpers module, get from new location' do
|
16
15
|
require 'beaker/dsl/helpers'
|
17
|
-
assert(
|
16
|
+
assert(Beaker::DSL::Helpers.is_a?(Module))
|
18
17
|
end
|
19
|
-
end
|
18
|
+
end
|