aboutsummaryrefslogtreecommitdiff
path: root/spec
AgeCommit message (Collapse)Author
2023-12-04(PA-5954) Add Amazon linux to install the 'cronie' (instead of cron) module ↵Shubham Shinde
used in rpm based platforms
2023-11-22Convert ProcessOutput to String explicitlyJosh Cooper
The `filetype` provider executes `crontab` using Puppet's execution API, which returns ProcessOutput objects that inherit from String. See puppetlabs/puppet@732d450 The provider later uses String#gsub to strip off the HEADER. In Ruby 2.7, the gsub method returns a new instance of ProcessOutput: irb(main):002:0> Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class => Puppet::Util::Execution::ProcessOutput If you later serialize the crontab entries to YAML using `puppet resource`, then puppet warns about serializing unknown data types: # puppet resource cron --to_yaml Warning: Cron[unmanaged:/etc/init.d/script.sh-1]['command'] contains a Puppet::Util::Execution::ProcessOutput value. It will be converted to the String '/etc/init.d/script.sh' This wasn't an issue with Ruby 3.2, because String#gsub always returns a String: irb(main):002:0> Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class => String This commit explicitly converts the ProcessOutput to a String so the provider behaves consistently on all Ruby versions. Fixes #61
2023-02-17(MODULES-11371) Updates legacy factsMichael Hashizume
Legacy facts are removed in Puppet 8. This commit updates a spec file from using legacy facts to using structured facts.
2023-02-14(MODULES-11371) Add Vox Beaker gemMichael Hashizume
In acb57af, we updated the module according to PDK template 7.2.1, which updated puppetlabs_spec_helper. The updated version of puppetlabs_spec_helper removed the Beaker rake task, which we use for acceptance testing. This commit adds the voxpupuli-acceptance gem, which re-adds the Beaker rake task.
2023-02-10(maint) Rubocop implicit begin fixMichael Hashizume
This commit addresses the Rubocop Style/RedundantBegin cop and removes an explicit `begin` block in favor of implicit syntax.
2021-10-01(MODULES-11197) Update to pdk-templates 2.2.0Gabriel Nagy
Includes REFERENCE.md ToC fixes for MODULES-8183.
2021-08-17(maint) Fix rubocop errorsJosh Cooper
Took the safest route and disabled cops either globally in .rubocop.yml for just for specific cases in lib/
2021-08-17(maint) Update to pdk templates 2.2.0Josh Cooper
Generated using: $ pdk --version 2.2.0 $ pdk update --template-ref 2.2.0
2021-03-11(maint) Switch to rspec-mocksGabriel Nagy
2020-08-10(MODULES-7786) Allow leading zeroes for cron paramsDorin Pleava
When applying a cron manigest that contains leading zeroes in a periodic attribute (hour, minute, month, monthday, weekday), puppet will strip down the zeroes even if they are accepted by the system cron. Now puppet will only convert to integer the periodic attributes when validating them, but will not change the input from the manifest.
2020-05-06(MODULES-8603) Ignore .keep_* filesEwoud Kohl van Wijngaarden
On Gentoo there's always a .keep_<package>-<slot> (e.g., .keep_cronbase-0) file inside the cron directory to ensure it's not removed with rmdir. Since usernames are very unlikely to start with .keep_, we can safely filter out these hidden files.
2019-10-24(maint) Update module using PDK 1.14.0mihaibuzgau
2019-02-05(maint) pdksync_1.9.0-0-g7281db5octavianlarion
This is required to keep in line with our module release process.
2019-01-09(MODULES-7789) Don't run new tests on older agentsEnis Inan
We only want to run these tests on agents that shipped with PUP-9217's changes. These are any agents newer than 5.5.8 in the 5.y release stream, and any agents newer than 6.0.4 in the 6.y release stream.
2019-01-09(maint) Simplify the confine in the unauthorized users acceptance testEnis Inan
2019-01-09(MODULES-7789) Port over the PUP-9217 changesEnis Inan
PUP-9217 introduced the :raise_prefetch_errors option to the ParsedFile provider base class that, when set, will fail any resources associated with a failed prefetch target. Thus, when a file read error does occur, Puppet will fail all of the resources associated with the failed crontab (target). This means that the failed crontab will not be overwritten, thus fixing the issue described in the ticket. For more details, please refer to https://github.com/puppetlabs/puppet/commit/5b0fa987e5b7b27839e424ff16d59c7bf081c73a
2019-01-09(maint) Add more crontab provider testsEnis Inan
This commit adds the following tests to the cron resource: * A test to ensure that the crontab provider writes the crontab file of a new user * A test to ensure that the crontab provider fails to write the crontab file of a nonexistent user * A test to ensure that the crontab provider writes an originally unauthorized user's crontab file _if_ Puppet authorizes them in the middle of the run These tests are part of the crontab provider's specifications and should have been added before.
2019-01-08(maint) Update to PDK 1.8.0; update all templatesEnis Inan
2019-01-07(maint) Enable cron tests on Fedora 28, 29 using cronieEnis Inan
2018-12-07(MODULES-8306) Port over the crontab filetypes from PuppetEnis Inan
2018-11-28Update tests to pass on puppet 4Josh Cooper
2018-11-27(MODULES-8301) Update the unit tests with the crontab filetype fixEnis Inan
Commit 420049f2 in Puppet fixed the crontab filetype's #read method to use Puppet::Util::Execution.execute instead of %x. This commit updates the unit tests to account for this change.
2018-08-23Clean up newly broken cops since importJorie Tappa
2018-08-23Remove common_utils.rb, all used items were added to spec_helper_acceptance.Jorie Tappa
2018-08-23Fix acceptance testsJorie Tappa
2018-08-21Convert acceptance tests to RspecJorie Tappa
2018-08-09Add common_utils.rbJorie Tappa
2018-08-09Add spec_helper_accceptance.rbJorie Tappa
2018-08-08Fix Layout/CommentIndentation violationJorie Tappa
2018-08-01Fix Lint/EndAlignment violationsJorie Tappa
2018-08-01Disable Lint/HandleExceptionsJorie Tappa
2018-08-01Fix Lint/AssignmentInCondition violations.Jorie Tappa
2018-08-01Disable Style/GlobalVars violationsJorie Tappa
2018-08-01Fix Performance/Caller violationJorie Tappa
2018-08-01Disable RSpec/AnyInstanceJorie Tappa
2018-08-01Fix RSpec/DescribeMethod violation.Jorie Tappa
2018-08-01Fix Style/RegexpLiteral violationsJorie Tappa
2018-08-01Fix RSpec/InstanceVariable violationsJorie Tappa
2018-08-01Fix RSpec/RepeatedExample violationsJorie Tappa
2018-08-01Disable Security/YAMLLoadJorie Tappa
2018-08-01Fix Lint/AmbiguousBlockAssociation violationJorie Tappa
2018-08-01Fix Lint/ScriptPermission violationsJorie Tappa
2018-08-01Apply automatic pdk validate fixesJorie Tappa
2018-07-31Initial cron import from puppet 7a4c5f07bdf61a7bc7aa32a50e99489a604eac52Jorie Tappa
2018-07-19Install pdkJorie Tappa