Skip to content

Commit 99505c6

Browse files
Merge pull request #1395 from justinstoller/maint-security-enhance
(maint) test updates - trust local repos & update dependencies
2 parents eb69bf7 + 3268f82 commit 99505c6

File tree

3 files changed

+62
-27
lines changed

3 files changed

+62
-27
lines changed

integration/Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ def location_for(place, fake_version = nil)
1010
end
1111
end
1212

13-
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 4.5')
14-
gem 'beaker-pe', '~> 2.0'
15-
gem 'beaker-answers'
13+
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 4.40')
14+
gem 'beaker-pe', '~> 3.0'
1615
gem 'beaker-hostgenerator', *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || '~> 1.1')
1716
gem 'beaker-abs', *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.4')
18-
gem 'rototiller', '= 0.1.0'
17+
gem 'rototiller', '= 1.0'
1918
gem 'beaker-qa-i18n'

integration/Rakefile

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@ end
2020
desc 'The acceptance tests for r10k, run in the beaker framework'
2121
rototiller_task :beaker => [:beaker_hostgenerator] do |t|
2222

23-
common_setup = <<-EOS
24-
pre-suite/00_pe_install.rb,
25-
component/pre-suite/05_install_dev_r10k.rb,
26-
pre-suite/10_git_config.rb,
27-
pre-suite/20_pe_r10k.rb,
28-
EOS
29-
common_setup.gsub!("\n", '')
30-
31-
flags = [
32-
{:name => '--hosts', :default => 'configs/generated', :override_env => 'BEAKER_HOST'},
33-
{:name => '--keyfile', :default => "#{ENV['HOME']}/.ssh/id_rsa-acceptance", :override_env => 'BEAKER_KEYFILE'},
34-
{:name => '--load-path', :default => 'lib'},
35-
{:name => '--pre-suite', :default => @acceptance_pre_suite || common_setup, :override_env => 'BEAKER_PRE_SUITE'},
36-
{:name => '--tests', :default => 'tests', :override_env => 'BEAKER_TESTS'},
37-
{:name => '--preserve-hosts', :default => 'onfail', :override_env => 'BEAKER_PRESERVE_HOSTS'},
38-
]
39-
t.add_flag(*flags)
40-
4123
t.add_env do |env|
4224
env.name = 'PE_FAMILY'
4325
env.message = 'The puppet enterprise major branch to install from'
@@ -54,7 +36,62 @@ EOS
5436
env.message = 'The git provider that r10k should use on a SUT'
5537
end
5638

57-
t.add_command({:name => 'beaker --debug', :override_env => 'BEAKER_EXECUTABLE'})
39+
t.add_command do |cmd|
40+
cmd.name = 'beaker --debug'
41+
42+
common_setup = <<-EOS
43+
pre-suite/00_pe_install.rb,
44+
component/pre-suite/05_install_dev_r10k.rb,
45+
pre-suite/10_git_config.rb,
46+
pre-suite/20_pe_r10k.rb,
47+
EOS
48+
common_setup.gsub!("\n", '')
49+
50+
cmd.add_option do |opt|
51+
opt.name = '--hosts'
52+
opt.add_argument do |arg|
53+
arg.name = 'configs/generated'
54+
arg.add_env({name: 'BEAKER_HOST'})
55+
end
56+
end
57+
58+
cmd.add_option do |opt|
59+
opt.name = '--keyfile'
60+
opt.add_argument do |arg|
61+
arg.name = "#{ENV['HOME']}/.ssh/id_rsa-acceptance"
62+
arg.add_env({name: 'BEAKER_KEYFILE'})
63+
end
64+
end
65+
66+
cmd.add_option do |opt|
67+
opt.name = '--pre-suite'
68+
opt.add_argument do |arg|
69+
arg.name = @acceptance_pre_suite || common_setup
70+
arg.add_env({name: 'BEAKER_PRE_SUITE'})
71+
end
72+
end
73+
74+
cmd.add_option do |opt|
75+
opt.name = '--tests'
76+
opt.add_argument do |arg|
77+
arg.name = 'tests'
78+
arg.add_env({name: 'BEAKER_TESTS'})
79+
end
80+
end
81+
82+
cmd.add_option do |opt|
83+
opt.name = '--preserve-hosts'
84+
opt.add_argument do |arg|
85+
arg.name = 'onfail'
86+
arg.add_env({name: 'BEAKER_PRESERVE_HOSTS'})
87+
end
88+
end
89+
90+
cmd.add_option do |opt|
91+
opt.name = '--load-path'
92+
opt.add_argument({name: 'lib'})
93+
end
94+
end
5895
end
5996

6097
desc 'Generate a host configuration used by Beaker'
@@ -64,12 +101,10 @@ rototiller_task :beaker_hostgenerator do |t|
64101
t.add_command do |c|
65102
c.name = 'beaker-hostgenerator'
66103
c.argument = '> configs/generated'
104+
c.add_option(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET')
105+
c.add_option(:name => '--global-config', :default => '{forge_host=forgeapi.puppet.com}', :override_env => 'BHG_GLOBAL_CONFIG')
67106
end
68107

69-
# This is a hack :(
70-
t.add_flag(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET')
71-
72-
t.add_flag(:name => '--global-config', :default => '{forge_host=forgeapi.puppet.com}', :override_env => 'BHG_GLOBAL_CONFIG')
73108
end
74109
end
75110

integration/pre-suite/10_git_config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
on(master, puppet('apply'), :stdin => git_manifest, :acceptable_exit_codes => [0,2]) do |result|
3737
assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
3838
end
39+
on(master, 'git config --system --add safe.directory "*"')
3940

4041
step 'Create "production" Environment on Git'
4142
init_r10k_source_from_prod(master, git_repo_path, git_repo_name, git_environments_path, 'production')

0 commit comments

Comments
 (0)