Skip to content

Commit

Permalink
Merge pull request #65 from nicklewis/BKR-1085-sign-certs-before-stop…
Browse files Browse the repository at this point in the history
…ping-agent

(BKR-1085) Sign certs *before* stopping agent service
  • Loading branch information
kevpl authored Mar 29, 2017
2 parents 0784adc + 3b5208e commit e1b6d13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 4 additions & 4 deletions lib/beaker-pe/install/pe_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,15 @@ def simple_monolithic_install(master, agents, opts={})
end
end

step "Stop puppet agents to avoid interfering with tests" do
stop_agent_on(all_hosts, :run_in_parallel => true)
end

step "Sign agent certificates" do
# This will sign all cert requests
sign_certificate_for(agents)
end

step "Stop puppet agents to avoid interfering with tests" do
stop_agent_on(all_hosts, :run_in_parallel => true)
end

step "Run puppet to setup mcollective and pxp-agent" do
on all_hosts, puppet_agent('-t'), :acceptable_exit_codes => [0,2], :run_in_parallel => true

Expand Down
12 changes: 3 additions & 9 deletions spec/beaker-pe/install/pe_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1293,16 +1293,10 @@ def slice_installer_options(host)
subject.simple_monolithic_install(monolithic, [el_agent, el_agent, deb_agent, deb_agent])
end

it 'signs all certificates at once' do
it 'signs certificates then stops agents to avoid interference with tests' do
agents = [el_agent, el_agent, deb_agent, deb_agent]
expect(subject).to receive(:sign_certificate_for).with(agents)

subject.simple_monolithic_install(monolithic, agents)
end

it 'stops the agents in parallel to avoid interference with tests' do
agents = [el_agent, el_agent, deb_agent, deb_agent]
expect(subject).to receive(:stop_agent_on).with([monolithic, *agents], :run_in_parallel => true)
expect(subject).to receive(:sign_certificate_for).with(agents).ordered
expect(subject).to receive(:stop_agent_on).with([monolithic, *agents], :run_in_parallel => true).ordered

subject.simple_monolithic_install(monolithic, agents)
end
Expand Down

0 comments on commit e1b6d13

Please sign in to comment.