summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Integrate ruby 3.1 into buildsJohn McCrae2022-08-231-2/+2
| | | | | | | | | 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>
* 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 #12278 from chef/use-powershell-exec-in-powershell-resourceLamont Granquist2021-11-301-114/+114
|\
| * update tests for powershell packagerishichawda2021-11-181-114/+114
| | | | | | | | Signed-off-by: rishichawda <rishichawda@users.noreply.github.com>
* | Rubygems 3.2.x spec fixeslcg/rubygems-3.2-fixesLamont Granquist2021-11-291-0/+3
| | | | | | | | | | | | Needed for ruby-3.0.3 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Unit fixes and :all_actions support for DRR fixeslcg/define-resource-requirements-fixLamont Granquist2021-11-152-0/+2
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix all the string errorsexpeditor/chef/chefstyle_b5c712d298e240493020b8d5977f03172cc65e17Tim Smith2021-10-222-6/+6
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Pass new_resource.version as nil and expect stubbed versiongscho2021-07-081-1/+2
| | | | Signed-off-by: gscho <greg.c.schofield@gmail.com>
* Add user provided options to powershell_package commandsgscho2021-07-081-12/+73
| | | | Signed-off-by: gscho <greg.c.schofield@gmail.com>
* Really fix the DNF spec testsLamont Granquist2021-05-071-1/+1
| | | | | | The rspec expectation is remaining attached to the singleton Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Reset the DNF helper to greenify testsLamont Granquist2021-05-071-0/+1
| | | | | | More stable helper now survives the func tests and now throws this test off. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix yum specsLamont Granquist2021-05-041-0/+1
| | | | | | | | | Reset the singleton instance before starting the test, because singletons. Also better clears up some internal state when the daemon gets reaped Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Update to use chef-workstation instead of chefdkLance Albertson2021-04-091-3/+3
| | | | Signed-off-by: Lance Albertson <lance@osuosl.org>
* Fix the ruby-3 omnibus builds/testsLamont Granquist2021-03-221-1/+1
| | | | | | This switches omnibus to using the post-bundle-install hook Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* ruby 3.0 fixes and post-bundle-install hookLamont Granquist2021-03-181-15/+13
| | | | | | | | | | | | | | | Mostly this is all fixes necessary for ruby 3.0 There's the addition of the appbundle hook which lets us better pull git gems into appbundler Note carefully how after adding the post-bundle-install.rb that trying to pre appbundle-update ohai pulls in chef/chef as bundle installed git gem which fails to install so we go back to only using one appbundle-update on chef/chef and removing the chef/ohai one (which may fix other bugs). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Move idempotency logs to debugPhil Dibowitz2021-03-062-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This was discussed in the last Chef Triage meeting. In the great move to trace logging, which is great, idempotency check logs moved to trace, which defeats the purpose. The goal is to keep "internal chef" logging in trace so that when users are trying to figure out why their cookbook isn't acting as expected they can look at debug without having to see all the other cruft. But "here's why I didn't install the package you said to install" is table-steaks "I'm trying to debug my cookbook." This moves those logs back to debug. There were a variety of cases where logging was pretty nonstandard in other ways, but to keep this PR scoped, I didn't change those. I did fix a few related logging issues: * A few warns that should have been debug in windows_task * A few places where there was basically no logging whatsoever, I put a few of the "I did X" logs to 'debug' (from trace). It coudl be argued some of those should be 'info', but that's a bigger change that I didn't want to put into this PR Signed-off-by: Phil Dibowitz <phil@ipom.com>
* Fix downgrades in apt_package (#10993)Phil Dibowitz2021-02-081-16/+82
| | | | | | | | | | | | | | | | | | | | `apt_package` never even looks at `new_resource.version` when deciding what version to install. That's silly. This fixes that. It requires the version be exact (as the `yum_package` did for most of Chef's history), and if you specify a non-existent version, it'll raise an exception. The unit tests for this provider are a bit of a mess, so I kinda stuck in the tests where I could. ``` [2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] installed version for hub is 2.14.2-1vcrs.1 [2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] candidate version for hub is 2.14.2-1vcrs.1 [2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] hub 2.14.2-1vcrs.1 needs updating to 2.7.0~ds1-1vcrs.1 [2021-02-07T15:59:38-08:00] INFO: apt_package[hub] installed hub at 2.7.0~ds1-1vcrs.1 ``` Signed-off-by: Phil Dibowitz <phil@ipom.com>
* Fix DNF version comparison buglcg/dnf-fix-tweakLamont Granquist2021-01-281-1/+7
| | | | | | | Also suppresses a version comparison that normally fails when it is called on the dnf provider which was ignorable. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge remote-tracking branch 'origin/master' into mrtazz/pkgng-exit-code-fixDaniel Schauenberg2021-01-0733-4333/+4028
|\ | | | | | | Signed-off-by: Daniel Schauenberg <d@unwiredcouch.com>
| * Stub http requests in rubygems tests.Pete Higgins2020-12-281-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org> This commit includes a trimmed version of rubygems.org API output. To recreate this file: * Download the file from rubygems.org: curl "https://rubygems.org/latest_specs.4.8.gz" * Read the file, uncompress it, filter for the data you want, and reverse the process: File.write("latest_specs.4.8.gz", Gem::Util.gzip(Marshal.dump(Marshal.load(Gem::Util.gunzip(File.read("latest_specs.4.8.gz"))).select {|m| m.first == "sexp_processor" })))
| * Merge pull request #10379 from chef/rubygems_18Tim Smith2020-12-181-14/+4
| |\ | | | | | | Chef 17: Assume Rubygems 1.8 in the rubygems provider / specs
| | * Assume Rubygems 1.8 in the rubygems provider / specsrubygems_18Tim Smith2020-09-021-14/+4
| | | | | | | | | | | | | | | | | | | | | Rubygems 1.8 came out May 4, 2011 and we're still checking for rubygems older than that. Signed-off-by: Tim Smith <tsmith@chef.io>
| * | update zypper_packageLamont Granquist2020-11-111-25/+0
| | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | convert most internal powershell_out to powershell_execmwrock2020-10-281-2/+1
| | | | | | | | | | | | Signed-off-by: mwrock <matt@mattwrock.com>
| * | ensure powershell_package commands are run with tls 1.2mwrock2020-10-201-95/+87
| | | | | | | | | | | | Signed-off-by: mwrock <matt@mattwrock.com>
| * | Resolve RuboCop Style/RedundantInterpolation warningsTim Smith2020-09-081-1/+1
| |/ | | | | | | | | | | Resolve the issues that pete pointed out plus a few others Signed-off-by: Tim Smith <tsmith@chef.io>
| * Add unit and integration testing back to omnibus testersLamont Granquist2020-08-172-2/+5
| | | | | | | | | | | | It is slow but it does catch real bugs Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * Merge pull request #10148 from chef/fix-spec_helper-requiresTim Smith2020-07-151-1/+1
| |\ | | | | | | Avoid requiring spec_helper more than once
| | * The spec/ directory is in the path.fix-spec_helper-requiresPete Higgins2020-07-131-1/+1
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Change non-default rubygems URL to default one for failing test.Pete Higgins2020-07-151-14/+1
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Workaround SSL cert verification failure in test.fix-rubygems-ssl-test-failurePete Higgins2020-07-141-0/+4
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Turn off ssl certificate verification in failing test.Pete Higgins2020-07-141-0/+9
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Factor out common test setup.Pete Higgins2020-07-141-9/+4
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Don't run the dnf test that Windows doesn't like on Windows.Pete Higgins2020-07-131-1/+1
| |/ | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Fix windows package tests.fix-windows-unit-testssnehaldwivedi2020-07-101-8/+13
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Refer to the new_resource directly.Pete Higgins2020-07-071-5/+5
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Update test for Windows package installer_type since the resource behavior ↵Pete Higgins2020-07-071-3/+3
| | | | | | | | | | | | changed. Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Update tests to match how Windows package checksums are done.Pete Higgins2020-07-071-38/+10
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Remove other top-level methods defined in tests and do a little cleanup.other-test-cleanupPete Higgins2020-06-241-20/+17
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Fix some odd whitespacing in tests.Pete Higgins2020-06-242-4/+4
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Add kitchen tests for snapdPhil Dibowitz2020-06-141-1/+1
| | | | | | | | Signed-off-by: Phil Dibowitz <phil@ipom.com>
| * Fixed Powershell_Package does not throw error when it cannot connect to ↵sanga172020-06-021-86/+95
| | | | | | | | | | | | powershell gallery Signed-off-by: sanga17 <sausekar@msystechnologies.com>
| * Get lib/ free of spelling violations.Pete Higgins2020-05-182-3/+3
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Align all our comments with the codeTim Smith2020-05-061-3/+3
| | | | | | | | | | | | Autocorrected with chefstyle after enabling that cop. It was very hard to read some complex autocorrected blocks w/o this. Signed-off-by: Tim Smith <tsmith@chef.io>
| * Fix for Chocolate_resource options causing extra quotesKapil/Github-9413_Chocolate_resource_options_causing_extra_quotesKapil Chouhan2020-04-231-1/+1
| | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>