puppetlabs / beaker-puppet Goto Github PK
View Code? Open in Web Editor NEWBeaker's puppet-specific helper library
License: Apache License 2.0
Beaker's puppet-specific helper library
License: Apache License 2.0
We use the install_puppet_agent_pe_promoted_repo_on method to test installing older puppet-agents and test them out against new PE environments setup with newer puppetservers.
A recent change to the install_puppet_agent_pe_promoted_repo_on recently broke installing older agents (pre PE 2019.0 at least).
I believe the break down is in the method we changed how the puppet_collection is set.
We use to use the install path as this when the agent version is puppet_agent_version=>"5.5.3":
/root/repos/el/7/PC1/x86_64/puppet-agent-*.rpm
Which use to work, but now when we attempt to install we're using this:
/root/repos/el/7/puppet5/x86_64/puppet-agent-*.rpm
Notice the change from PC1 to puppet5, which looks to break things.
If the git clone operation fails this method does not raise an exception.
This gem was migrated together with all other beaker gems. Back then it was used by Vox Pupuli, but now we've migrated to beaker_puppet_helpers which is a really stripped down version of this gem.
beaker-puppet contains a lot of logic to test puppetserver and the only user of that is puppetlabs. That's why I'm proposing to migrate it back.
The inifile gem is used a few places (puppet-helpers and tk-helpers) in beaker-puppet to generate INI files.
This gem is unmaintained and quite old (last commits were ~8 years ago). inifile uses taint methods, which were deprecated in Ruby 2.7 and completely removed in Ruby 3.2 (see https://bugs.ruby-lang.org/issues/16131).
beaker-puppet should drop its dependency on inifile to avoid incompatibility with these methods and any potential future issues.
When running the ci:test:aio
rake task (with retries disabled), if any test fails, then the post-suite
is skipped:
Lines 320 to 323 in 5f0984a
This is because beaker(:exec, ...)
raises if any test fails and the post-suite
isn't in an ensure block.
However, ci:test:aio[true]
(with retries enabled) does execute the post-suite, because it's been moved to the ensure
block.
Lines 348 to 349 in 5f0984a
The post-suite
should always be executed irrespective of whether retries are enabled or not.
Also if the post-suite
fails/raises, then we should ensure hosts are still destroyed too
Steps to reproduce the behavior:
git clone https://github.com/puppetlabs/facter
cd facter
patch -p1 << 'EOF'
diff --git a/acceptance/tests/load_libfacter.rb b/acceptance/tests/load_libfacter.rb
index 1bc61ffd1..fe93a25bb 100644
--- a/acceptance/tests/load_libfacter.rb
+++ b/acceptance/tests/load_libfacter.rb
@@ -2,6 +2,8 @@
test_name 'C100161: Ruby can load libfacter without raising an error' do
tag 'risk:high'
+ raise "Whoops"
+
require 'puppet/acceptance/common_utils'
extend Puppet::Acceptance::CommandUtils
EOF
cd acceptance
bundle install
bundle exec rake ci:test:aio SHA=8.4.0 TESTS=tests/load_libfacter.rb HOSTS=redhat8-64a
...
...notice `bundle exec beker exec post-suite` is never executed
...
But when retries are enabled, the post-suite is executed:
bundle exec rake 'ci:test:aio[true]' SHA=8.4.0 TESTS=tests/load_libfacter.rb HOSTS=redhat8-64a
bundle exec gem list
*** LOCAL GEMS ***
ansi (1.5.0)
ast (2.4.2)
bcrypt_pbkdf (1.1.0)
beaker (4.41.2)
beaker-abs (0.11.0)
beaker-hostgenerator (2.9.0)
beaker-puppet (1.29.0)
beaker-vagrant (0.7.1)
beaker-vmpooler (1.4.0)
bundler (2.4.19)
commander (4.6.0)
deep_merge (1.2.2)
ed25519 (1.3.0)
faraday (1.10.3)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
highline (2.0.3)
hocon (1.4.0)
in-parallel (0.1.17)
inifile (3.0.0)
minitar (0.9)
minitest (5.21.2)
multi_json (1.15.0)
multipart-post (2.3.0)
net-scp (4.0.0)
net-ssh (7.2.1)
oga (3.4)
rake (13.1.0)
rexml (3.2.6)
rsync (1.0.9)
ruby-ll (2.1.3)
ruby2_keywords (default: 0.0.5)
stringify-hash (0.0.2)
thor (1.3.0)
vmfloaty (1.8.1)
I want to use the cmdline_args parameter of the host.install_package method on install_puppet_agent_on to inject the argument "-o Dpkg::Options::='--force-confold'".
I have some files already present that are also inside the puppet agent package and right now beaker gets stuck on the interactive apt install dialog where it asks me if it is okay to overwrite these files.
It is the second parameter of this method call:
https://github.com/voxpupuli/beaker-puppet/blob/0d4080c8f3c57dbcb87cc296a3164b006b7b3eea/lib/beaker-puppet/install_utils/foss_utils.rb#L437
Currently the string PATH
is being prepended to the PATH environment variable on SUTs.
This can be seen in pry
:
> fact_on(host, 'path')
=> "PATH:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
I believe I've tracked this down to https://github.com/voxpupuli/beaker-puppet/blob/ce5afbd0c239c99d963b63ac61558733f5dc9da6/lib/beaker-puppet/install_utils/puppet_utils.rb#L59.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.