WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Beaker should keep tempfiles for inspection on failed test runs #1969

@marcusdots

Description

@marcusdots

If I run Beaker with docker hypervisor for acceptance tests and the test fails, the container is left over, but its content, the manifest package, gets deleted.

Example:

puppet-wildfly.git $
BEAKER_DESTROY=onpass BEAKER_color=no BEAKER_SETFILE="centos9-64{hostname=centos9-64-openvox8.example.com}" BEAKER_HYPERVISOR=docker bundle exec rake beaker
...
Hypervisor for centos9-64-openvox8.example.com is docker
Beaker::Hypervisor, found some docker boxes to create
Provisioning docker
provisioning centos9-64-openvox8.example.com
Creating image
Dockerfile is FROM quay.io/centos/centos:stream9
ENV container docker
RUN dnf clean all && dnf install -y sudo openssh-server openssh-clients iputils && ssh-keygen -A && sed 's@session *required *pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*
RUN mkdir -p /var/run/sshd && echo root:root | chpasswd
RUN sed -ri -e 's/^#?PermitRootLogin .*/PermitRootLogin yes/' -e 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' -e 's/^#?UseDNS .*/UseDNS no/' -e 's/^#?UsePAM .*/UsePAM no/' -e 's/^#?MaxAuthTries.*/MaxAuthTries 1000/' /etc/ssh/sshd_config $(compgen -G '/etc/ssh/sshd_config.d/*' || echo '')
RUN cp /bin/true /sbin/agetty
RUN dnf install -y cronie crontabs initscripts iproute openssl wget which glibc-langpack-en hostname
EXPOSE 22
CMD ["/sbin/init"]
Docker build buildargs: {}
post
/build
{:rm=>true, :buildargs=>"{}"}
Dockerfile0000640000000000000000000000140302263773600013307 0ustar00wheelwheel00000000000000FROM quay.io/centos/centos:stream9
ENV container docker
RUN dnf clean all && dnf install -y sudo openssh-server openssh-clients iputils && ssh-keygen -A && sed 's@session *required *pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*
RUN mkdir -p /var/run/sshd && echo root:root | chpasswd
RUN sed -ri -e 's/^#?PermitRootLogin .*/PermitRootLogin yes/' -e 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' -e 's/^#?UseDNS .*/UseDNS no/' -e 's/^#?UsePAM .*/UsePAM no/' -e 's/^#?MaxAuthTries.*/MaxAuthTries 1000/' /etc/ssh/sshd_config $(compgen -G '/etc/ssh/sshd_config.d/*' || echo '')
RUN cp /bin/true /sbin/agetty
RUN dnf install -y cronie crontabs initscripts iproute openssl wget which glibc-langpack-en hostname
EXPOSE 22
...
centos9-64-openvox8.example.com executed in 0.08 seconds
localhost $ scp /tmp/beaker20251111-214833-1tj0il centos9-64-openvox8.example.com:/tmp/apply_manifest_102836136.jD4JzZ.pp {:ignore => }

centos9-64-openvox8.example.com 10:28:36$ puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_102836136.jD4JzZ.pp
  Info: Loading facts
  Warning: Facter: Container runtime, 'docker', is unsupported, setting to 'container_other'
  Warning: This function is deprecated, please use stdlib::fqdn_rand_string instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 110]:["/tmp/apply_ma
nifest_102836136.jD4JzZ.pp", 0]
     (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation')
  Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetl
abs/code/environments/production/modules/wildfly/manifests/init.pp", 133]
     (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation')
  Notice: Compiled catalog for centos9-64-openvox8.example.com in environment production in 0.07 seconds
  Info: Using environment 'production'
  Info: Applying configuration version '1762853317'
  Warning: Private key for 'centos9-64-openvox8.example.com' does not exist
  Warning: Client certificate for 'centos9-64-openvox8.example.com' does not exist
  Notice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running'
  Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly]
  Notice: Applied catalog in 18.31 seconds

centos9-64-openvox8.example.com executed in 19.85 seconds
Exited: 2

centos9-64-openvox8.example.com 10:28:56$ rm -rf /tmp/apply_manifest_102836136.jD4JzZ.pp


  1) install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently
     Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0])
     Beaker::Host::CommandFailure:
       Host 'centos9-64-openvox8.example.com' exited with 2 running:
        puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_102836136.jD4JzZ.pp

To debug the issue, I need access to the tests manifest file. It should be kept.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions