summaryrefslogtreecommitdiff
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
* feat(apt_repository): Allow specifying arbitrary options (#13728)Thayne McCombs2023-05-032-7/+22
| | | | | | | | | This allows specifying additional options to apt repositories, in addition to `trusted` and `arch`. By using an array of strings we also allow using multivalue operators like -= and += Fixes: #13727 Signed-off-by: Thayne McCombs <thayne@lucid.co>
* zypper_package: Fix idempotency issue (#13691)Lance Albertson2023-04-181-0/+10
| | | | | | | | | | | | Installing the apache2-mod_wsgi-python3 package is not idempotent due to the fact that zypper will also return the apache2-mod_wsgi package. The resolve_available_version method, incorrectly assumes this will only return one item, but in this case it returns four items and will pick the first package listed. To work around this, we should verify that the package name listed in the output matches what we are expecting to install. Signed-off-by: Lance Albertson <lance@osuosl.org>
* Correcting a typo in the resource and now the tests as wellJohn2023-03-311-4/+4
| | | | Signed-off-by: John <john.mccrae@progress.com>
* set default values for user and host on userdefaults (#12791)Rishi Kumar Chawda2023-03-071-4/+4
| | | | | | * set default values for user and host on userdefaults Signed-off-by: rishichawda <rishichawda@users.noreply.github.com>
* Add selinux_user and selinux_login resources (#13511)wheatevo2023-03-072-0/+165
| | | | | | | | | * Add `selinux_user` resource to manage SELinux users. * Add `selinux_login` resource to manage OS login to SELinux user mapping. Related to PR https://github.com/sous-chefs/selinux/pull/92 Signed-off-by: Matthew Newell <matthew.newell@oracle.com>
* Merge pull request #13552 from chef/jfm/chef18_cert_retrieval2John McCrae2023-03-022-13/+90
|\ | | | | Correcting cert retrieval issues for multiple user scenarios
| * Correcting cert retrieval issues for multiple user scenariosJohn McCrae2023-02-282-13/+90
| | | | | | | | Signed-off-by: John McCrae <mccrae@progress.com>
* | fix(apt_repository): Detect changes to expiration in key (#13535)Thayne McCombs2023-02-071-5/+26
|/ | | | | | | | | This makes it so that the apt keys are updated if the expiration of a key is updated without changing the fingerprint. See: https://gitlab.com/gitlab-cookbooks/cookbook-gitlab-runner/-/merge_requests/37/diffs#35cd6a49d9e22469db42af7a30c5f3a76487e3c7 Fixes: #13308 Signed-off-by: Thayne McCombs <thayne@lucid.co>
* add missing compliance phase test (#13471)Corey Hemminger2023-01-311-0/+8
| | | | | | | * add missing test Customer ran into this scenario where audit cookbook is present due to base dependencies, profiles are set to pull from automate. CB is using policyfile and setting in kitchen.yml attributes: audit: compliance_phase: false to avoid run failures in test-kitchen. Compliance phase still runs though. Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
* Adds 'makecache_fast' property to `yum_repository` minimise cached repodata ↵Stuart Sears2023-01-031-0/+4
| | | | | | | | | | (#12915) * Adds 'makecache_fast' property to minimise cached repodata * add makecache_fast property to unit test * no makecache fast on dnf systems * correct property in unit test Signed-off-by: Stuart Sears <stuart@sjsears.com>
* updating file_system to send back the copy status (#13107)Vinay Satish2023-01-031-0/+2
| | | | | | * updating file_system to send back the copy status * Updating Gemfile.lock for cheffish bump Signed-off-by: Vinay Satish <vinay.satish@progress.com>
* Squashed commit of the following: (#13069)Steve Abatangle2022-11-221-0/+30
| | | | | | | | | Res validation should be aware of action prop reqs. The get and set methods in the Property class (for resource validation) check that a property is required if its value is nil. However, they don't check to see whether the property was required for the specific action the resource is using, so any use of get and set will throw an exception if used with a resource that doesn't use a required property, even when the property is not required for that action. What I'm describing is easier to understand with an example: the current version of the chef-client cookbook has a recipe (cron.rb) with a resource that uses the :delete action. When you try to get that resource, it throws an exception, explaining that :command is a required property—but it's only required for the :create action, not for :delete. Co-authored-by: Steve Abatangle <steve_abatangle@gap.com>
* Fix false updates on cron resource when using integers (#13147)Jeremy Kimber2022-11-081-0/+36
| | | | | | | | | | | | | | | | * Fix false updates on cron resource when using integers Signed-off-by: Jeremy Kimber <kimbernator@state.local> * move new cron idempotency test to provider spec and coerce data to string in provider Signed-off-by: Jeremy Kimber <kimbernator@state.local> * Compare cron variables by class Signed-off-by: Jeremy Kimber <kimbernator@state.local> Signed-off-by: Jeremy Kimber <kimbernator@state.local> Co-authored-by: Jeremy Kimber <kimbernator@state.local>
* Bugfix: checksum validation (#13210)Joseph Larionov2022-11-011-0/+28
| | | | | | | | | | * Add a case-insensitive helper to determine if two checksums match * Use case-insensitive checksum match helper for checksum validation This fixes a bug where checksum validation fails because the two checksums are in different letter cases. The existing checksum validation logic was using case sensitive equality checks. Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
* Add linux_only: true to new linux user specs (#13252)tpowell-progress2022-10-181-1/+1
| | | | | | * Add linux_only: true to new linux user specs * Address Trailing Comma and nonexisting group in SLES 15 Signed-off-by: Thomas Powell <powell@progress.com>
* Merge pull request #13223 from fretb/bug/linux-user-comparetpowell-progress2022-10-141-0/+45
|\ | | | | Fixes bug in compare_user on Linux systems
| * Fixes bug in compare_user on Linux systemsFrederik Thuysbaert2022-10-071-0/+45
| | | | | | | | | | | | | | | | d4c3b8ad111ec7ff6b32ebccf9edd1b6a2f9e8e2 introduced a bug making `compare_user` on Linux systems return `%i{expire_date inactive}` instead of wether `@change_desc` is empty. Signed-off-by: Frederik Thuysbaert <frederik.thuysbaert@combell.group>
* | Merge pull request #13229 from chef/mp/pipeline-workaround-server2012-2Marc A. Paradise2022-10-101-4/+0
|\ \ | | | | | | Do not raise if we can't close win resource handle
| * | Allow dsc_refresh_mode_disabled to be invoked in testMarc A. Paradise2022-10-071-4/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | Currently we're failing this test on a pre-emptive direct execution of Get-LocalDscConfigurationManager that we're doing in the test. It is not returning the expected result, but it's hiding the errors. Instead, we'll let the actual thing we want to test occur (dsc_refresh_mode_disabled) - because it runs the same command, and raises an error if it fails. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Fix term and privilege related broken tests in Solaris build (#13230)tpowell-progress2022-10-071-5/+1
|/ | | | | | INFC-274 Fix Solaris tests * Do not match on OS specific message, only on generic description. * Update omnibus version to fix read_shared_libs * Force `ENV["TERM"]` to `"vt100"` for tests
* Allow user providers to declare no support for ruby-shadowMarc A. Paradise2022-09-281-6/+24
| | | | | | | | | | | | | The AIX platform does not support ruby-shadow, but we always attempt to load it. The load fails on the AIX platform, which later causes our requirement assertion that `@shadow_lib_ok` be true to fail. Instead we allow user resource providers to override `supports_ruby_shadow?` if they do not support it, so that we don't assert that it is required in those cases. We default the return value to `true` because most platforms are supported by this gem. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Integrate ruby 3.1 into buildsJohn McCrae2022-08-232-3/+3
| | | | | | | | | This is a combination of 64 commits, the originals were mostly repeating one-line messages so that history has not been kept here. Signed-off-by: Thomas Powell <thomas.powell@progress.com> Signed-off-by: Marc Paradise <marc@chef.io> Signed-off-by: John McCrae <john.mccrae@progress.com>
* Merge pull request #13118 from tmccombs/sysctl-newlineMarc A. Paradise2022-08-161-2/+2
|\ | | | | | | | | Add newline to end of sysctl files Current pipeline failures are environmental and not related to this change. Failing tests are kitchen, which does not have coverage for this resource.
| * Add newline to end of sysctl filesThayne McCombs2022-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | If the sysctl file doesn't end with a newline, then Ubuntu's CIS audit won't correctly detect the sysctl configuration. Also, it is UNIX best practice to include a newline at the end of the last line of text files. Obvious fix. Signed-off-by: Thayne McCombs <thayne@lucid.co>
* | add splay 0 test to chef_client_scheduled_taskCorey Hemminger2022-08-021-0/+5
| | | | | | | | Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
* | Update chef_client_systemd_timer_spec.rbCorey Hemminger2022-08-021-5/+0
| |
* | testCorey Hemminger2022-08-021-10/+1
| | | | | | | | Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
* | add tests for splay 0Corey Hemminger2022-07-263-1/+25
|/ | | | Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
* Fixed test case property name code styleBapu L2022-06-221-6/+6
| | | | Signed-off-by: Bapu L <bapu.labade@progress.com>
* Fixed code style issueBapu L2022-06-221-3/+6
| | | | Signed-off-by: Bapu L <bapu.labade@progress.com>
* Fixed build issuesBapu L2022-06-211-3/+3
|
* test case description changesBapu L2022-06-211-2/+2
|
* Doc string message changes, test case cleanupBapu L2022-06-211-1/+8
|
* Property values should be suppressed irrespective of desired stateBapu L2022-06-211-6/+16
|
* Merge pull request #12182 from chef/manick/11638_zypper_package_source_additionJohn McCrae2022-06-141-0/+32
|\
| * Missing source path unit and functional specspratixha2022-05-251-1/+12
| | | | | | | | Signed-off-by: pratixha <pratiksha.prajapati@msystechnologies.com>
| * Fixed functional and unit testspratixha2022-05-251-2/+2
| | | | | | | | Signed-off-by: pratixha <pratiksha.prajapati@msystechnologies.com>
| * Addressed source_file_exist and uri_scheme related changesManick Vel2022-05-251-7/+7
| | | | | | | | Signed-off-by: Manick Vel <mkumaravel@msystechnologies.com>
| * Fixed chefstyle related issueManick Vel2022-05-251-2/+2
| |
| * Made source addition to zypper package and added specs tooManick Vel2022-05-251-0/+21
| |
* | Merge pull request #11626 from ↵John McCrae2022-06-141-0/+10
|\ \ | | | | | | | | | MsysTechnologiesllc/smriti/3884_mounting_cifs_shares_with_spaces
| * | Mount: device name space character substituted with ascii valuesmriti2022-04-061-0/+10
| | | | | | | | | | | | Signed-off-by: smriti <sgarg@msystechnologies.com>
* | | Limit cron_d job name validation to linux platformMario Haustein2022-05-311-7/+35
| | | | | | | | | | | | Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
* | | Fix cron_d job name character setMario Haustein2022-05-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit restrict the cron_d job name property to the character set according to the cron specification: > Additionally, cron reads the files in /etc/cron.d [...] Files must > conform to the same naming convention as used by run-parts(8): they > must consist solely of upper- and lower-case letters, digits, > underscores, and hyphens. closes #12165 Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
* | | refactored authenticator.rb to remove a redundant block that was causing ↵John McCrae2022-05-261-109/+109
| | | | | | | | | | | | | | | | | | tests to fail Signed-off-by: John McCrae <jmccrae@chf.io>
* | | refactored authenticator.rb to remove a redundant block that was causing ↵John McCrae2022-05-261-110/+111
| |/ |/| | | | | | | | | tests to fail Signed-off-by: John McCrae <jmccrae@chf.io>
* | Updated reviewd changes to add cookbook name in path in error msgsnehaldwivedi2022-05-241-1/+1
| | | | | | | | Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
* | Knife upload: bad error message when a recipe has a syntax errorsnehaldwivedi2022-05-241-0/+3
| | | | | | | | Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
* | add expire and inactive options to linux user resource (#11659)Corey Hemminger2022-05-032-0/+92
| | | | | | | | | | | | | | * add expire and inactive options to linux user resource * fix spell check * add tests Signed-off-by: Corey Hemminger <hemminger@hotmail.com>
* | SELinux integration to infra client (#12694)neha-p62022-04-117-0/+399
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 1. Add resources for SELlinux 2. Add common helper for SELinux under a new subdirectory 3. Wire files together with corresponding changes Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 3. Include SElinux CommonHelper under action_class for corresponding resources as it uses shell_out! 4. Add SELinux config file templates for debian and default versions Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 5.Add local mode true to correctly parse template from selinux_state resource Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 6. Remove SELinux cookbook dependency from kitchen-tests as SELinux resources are now part of core chef client, update linux.rb recipe to use corresponding SELinux resources instead of include_recipe Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 7. Add unit test cases for SELinux resources 8. Add documentation for SELinux resources Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 9. Obvious fix: code linting and spellcheck Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 10. Add code linting changes. 11. Add missing comma in cspell.json resulting in issue Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 12. Add linting and spellcheck changes Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 13. Add documentation for SELinux resources for all properties, actions with examples 14. Added permissive SELinux policy for en_to_end kitchen test Signed-off-by: Neha Pansare <neha.pansare@progress.com> * 15. Fix chefstyle linting 16. Update few shell_out calls to use array format of input parameters Signed-off-by: Neha Pansare <neha.pansare@progress.com>