Skip to content

Commit e61abd7

Browse files
authored
(maint) Add some new optional parameters for puppetserver testing (#65)
(maint) Add some new optional parameters for puppetserver testing / switch to Ubuntu agent container for testing
2 parents 49b3707 + 4deb920 commit e61abd7

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

gem/lib/pupperware/spec_helper.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ def wait_on_puppetdb_status(seconds = 240)
216216
# Puppetserver Helpers
217217
######################################################################
218218

219-
def wait_on_puppetserver_status(seconds = 180)
219+
def wait_on_puppetserver_status(seconds = 180, service_name = 'puppet')
220220
# puppetserver has a healthcheck, we can let that deal with timeouts
221221
return retry_block_up_to_timeout(seconds) do
222-
status = get_container_status(get_service_container('puppet'))
222+
status = get_container_status(get_service_container(service_name))
223223
(status == 'healthy' || status == "'healthy'") ? 'healthy' :
224224
raise("puppetserver stuck in #{status}")
225225
end
@@ -237,11 +237,19 @@ def clean_certificate(agent_name)
237237
# Puppet Agent Helpers
238238
######################################################################
239239

240-
def run_agent(agent_name, network, server = get_container_hostname(get_service_container('puppet')))
240+
# When testing with the `puppet/puppet-agent-alpine` image on windows
241+
# systems with LCOW we had intermittent failures in DNS resolution that
242+
# occurred fairly regularly. It seems to be specifically interaction
243+
# between the base alpine (3.8 and 3.9) images with windows/LCOW.
244+
#
245+
# Two issues related to this issue are
246+
# https://github.com/docker/libnetwork/issues/2371 and
247+
# https://github.com/Microsoft/opengcs/issues/303
248+
def run_agent(agent_name, network, server = get_container_hostname(get_service_container('puppet')), ca = get_container_hostname(get_service_container('puppet')))
241249
# setting up a Windows TTY is difficult, so we don't
242250
# allocating a TTY will show container pull output on Linux, but that's not good for tests
243251
STDOUT.puts("running agent #{agent_name} in network #{network} against #{server}")
244-
result = run_command("docker run --rm --network #{network} --name #{agent_name} --hostname #{agent_name} puppet/puppet-agent-alpine agent --verbose --onetime --no-daemonize --summarize --server #{server}")
252+
result = run_command("docker run --rm --network #{network} --name #{agent_name} --hostname #{agent_name} puppet/puppet-agent-ubuntu agent --verbose --onetime --no-daemonize --summarize --server #{server} --ca_server #{ca}")
245253
return result[:status].exitstatus
246254
end
247255

0 commit comments

Comments
 (0)