summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Chefstyle updatesTim Smith2020-05-271-1/+0
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #9833 from jaymzh/remote_file_sslTim Smith2020-05-271-0/+20
|\ | | | | Add ssl_verify option for remote_file
| * Add ssl_verify option for remote_filePhil Dibowitz2020-05-181-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Different servers have different https requirements and enforcing the API policy on all `remote_file` resources isn't reasonable. The logic around the HTTP clients and policies in Chef is... complex. This approach seemed like the best one, but I'm open to others. By default here if the user specifies nothing, `remote_file`'s http clients will fall back to the API policy, otherwise, it'll use whatever the specify. This fixes #8897 Signed-off-by: Phil Dibowitz <phil@ipom.com>
* | Merge pull request #9896 from damacus/resource/homebrew_updateTim Smith2020-05-271-0/+31
|\ \ | | | | | | Adds the homebrew_update resource
| * | Adds the homebrew_update resourceDan Webb2020-05-211-0/+31
| | | | | | | | | | | | Signed-off-by: Dan Webb <dan.webb@damacus.io>
* | | Merge pull request #9890 from chef/lcg/resource_name_fixesLamont Granquist2020-05-261-0/+14
|\ \ \
| * | | Chef-16.2 breaking changelcg/resource_name_fixesLamont Granquist2020-05-201-0/+14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a breaking change to fix a breaking change in Chef 16.0. The new behavior is that a resource which relies upon the reource_name statement to wire the resource up to the DSL will fail (although the very old wiring of the "<cookbook_name>_<resource filename>" continues to work). So for a resource which does not get its DSL wiring from the filename, only declaring a resource_name will fail: ``` resource_name :foo ``` This can be fixed by adding an explicit `provides` line (which is backwards compatible): ``` resource_name :foo provides :foo ``` If backwards compatibility is not a concern, then post-16.0 the resource_name call can be completely dropped: ``` provides :foo ``` This is a vastly simpler backwards compatibility break than the unintentional break in #9885, which is difficult to describe and to detect. The rules going forward are fairly simple to explain: 1. The resource_name now only sets the resource_name. 2. The old behavior of the fallback resource_name and DSL wiring based on the filename is preserved (unless the values are set). 3. In Chef 16, The first provides line will set the resource_name if it has not already been set, allowing the resource_name to be omitted. It is recommended that all resources only set provides lines, the use of the fallback filename-based wiring is discouraged and explicitly setting the resource_name is discouraged. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | Update our usage of OpenSSL::Digest to avoid Ruby 3 breaking changeopenssl_fixesTim Smith2020-05-222-5/+5
| | | | | | | | | | | | | | | | | | There's a RuboCop cop to fix these before Ruby 3 breaks it. Signed-off-by: Tim Smith <tsmith@chef.io>
* | | fix dnf testslcg/fix-dnf-testsLamont Granquist2020-05-211-2/+2
|/ / | | | | | | | | | | | | looks like the syntax for equality pinning to a version changed in fedora 31 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Get lib/ free of spelling violations.Pete Higgins2020-05-187-16/+16
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* | Replace nonsense word with other silly words.Pete Higgins2020-05-182-5/+5
|/ | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Fix ruby 2.7 keyword argument warnings.Pete Higgins2020-05-181-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* fix windows bootstrap; replicate https://github.com/chef/chef/pull/9839 by ↵Marc Chamberland2020-05-161-0/+6
| | | | | | | | | Chad Jessup This fixes bootstrapping on Windows. All credit goes to Chad Jessup <chad.jessup@gmail.com> but since the original PR was left without DCO I'm replicating it here, with valid DCO. Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
* Remove useless testLamont Granquist2020-05-131-42/+0
| | | | | | | | We broke this and they didn't fail, refactored the code and fixed it and now they're failing. We've got coverage of this in the functional tests now Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fixing testsLamont Granquist2020-05-131-56/+75
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fixes and tests for Chef-16 regression in launchdLamont Granquist2020-05-131-0/+213
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #9812 from chef/lcg/fix-unified-mode-launchdLamont Granquist2020-05-061-8/+8
|\
| * Update method name in launchd provider unit tests.lcg/fix-unified-mode-launchdPete Higgins2020-05-061-8/+8
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* | Align all our comments with the codeTim Smith2020-05-0619-66/+66
| | | | | | | | | | | | 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 windows_package not allowing version to be an arrayTim Smith2020-05-061-0/+10
|/ | | | | | | | Due to the way the resource is built we need to be able to store an array of current versions. I added some tests and comments so we don't refactor this away later. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove an unused spec helperTim Smith2020-04-301-13/+0
| | | | | | The code this was used with is long gone Signed-off-by: Tim Smith <tsmith@chef.io>
* OS X -> macOSTim Smith2020-04-302-4/+4
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix more ruby 2.7 warning logspamlcg/more-ruby-27-logging-suppressionLamont Granquist2020-04-289-87/+81
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #9751 from chef/lcg/chef-16-logging-fixedTim Smith2020-04-273-8/+7
|\ | | | | Rework logging to resolve STDOUT / log_location issues
| * Logging consistency fixes.lcg/chef-16-logging-fixedLamont Granquist2020-04-273-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The doc formatter is now Chef::Config[:log_location]-aware and will log to files as well - There is now consistency where doc formatter output never surprisingly changes to log formatter based on destination - The "cli" log_location and the "config" log_location are now treated separately, so a log_location in the client.rb will always force output to a logfile, in addition to output to STDOUT if necessary - The logic around STDOUT is now simplified, if its open we log to it, if its closed we don't, if you're daemonized we assume you're capturing STDOUT via your process manager - The log_location variables are now Arrays Things not done: - The cli can't specify an array, it would be nice to support an accumulator pattern here. Would also need to support disabling STDOUT logging though. - Using the syslog or winevt logging devices requires the use of the logger, which precludes using the formatter. - Some people may want to have log-formatter style output to the log file and doc formatter style output to STDOUT which is not very possible right now. Right now we are consistent in that you get either the logger both places or the formatter both places. This use case is complicated by the fact that they will want :info level logging for the logger, but :warn level logging for the doc formatter and that is another global. - To do that latter thing right would probably require sending log messages to the formatter, and supporting a different log level in the formatter vs. the logger and then supporting the STDOUT/cli loggging being the formatter, while the log_location/config logging being the logger. Those were way out of scope for what I could get done for Chef-16. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Merge pull request #9756 from chef/fix_specTim Smith2020-04-271-2/+2
|\ \ | | | | | | Fix the powershell spec to use the right method
| * | Fix the powershell spec to use the right methodfix_specTim Smith2020-04-271-2/+2
| | | | | | | | | | | | | | | | | | Running too fast here. Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Remove git func test for upstreamLamont Granquist2020-04-271-6/+0
|/ / | | | | | | | | | | | | | | | | | | | | The output of this command seems to vary too much over different git versions to make it reliable and actually work. We should find something here that works, but determining what git commands to use which are stable for parsing can be very difficult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Disable the windows_exec test for nowTim Smith2020-04-271-10/+11
| | | | | | | | | | | | | | | | This is breaking habitat and 32bit windows builds for now. It is 100% an issue, but it's always been an issue. For now we need a build and we'll track down those larger issues in future builds. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Fix typo in specpowershell_exec_bangTim Smith2020-04-261-1/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Add error! specTim Smith2020-04-261-0/+10
|/ | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #9648 from ↵Tim Smith2020-04-252-36/+12
|\ | | | | | | | | chef/Kapil/GitHub-9450_Update_the_locale_resource_to_support_Windows locale: Support setting locale on Windows
| * Update the locale resource to support WindowsKapil/GitHub-9450_Update_the_locale_resource_to_support_WindowsKapil Chouhan2020-04-222-36/+12
| | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* | Add specs for the timeout defaultssimpler_windows_timeoutTim Smith2020-04-242-0/+13
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Merge pull request #9726 from chef/lcg/chef-16-gitTim Smith2020-04-238-196/+338
|\ \ | | | | | | Refactor scm, git and subversion resources & fix longstanding git issues
| * | remove upstream test of deploy branchLamont Granquist2020-04-231-6/+1
| | | | | | | | | | | | | | | | | | | | | git isn't back consistent results for this API, i'm not sure what the correct stable API is to get this info from git. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | Chef-16 git provider fixesLamont Granquist2020-04-238-196/+343
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git provider now no longer checks out to a "deploy" branch by default and now checks out to the branch (with a remote upstream) or else checks out to a detatched head. The prior behavior can be restored by using "checkout branch 'deploy'". This also removes the SCM resource base class and replaces it with a resource partial and does some internal reorganization. It also introduces the RecipeDSLHelper for better functional tests and cleans up the functional tests of the git provider. Properties that were only ever implemented on the git provider were removed from the subversion provider where they had been inherited from the base class incorrectly. Some additional env var handling was added to the subversion handler in the process of sorting out the common properties, including HOME handling for alternative users. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Fix for Chocolate_resource options causing extra quotesKapil/Github-9413_Chocolate_resource_options_causing_extra_quotesKapil Chouhan2020-04-232-1/+30
|/ | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* Remove the unused simplecov depedencyTim Smith2020-04-211-11/+0
| | | | | | We're not actually running these coverage tests and even if we did they don't have high value since you can game the numbers without writing quality tests. Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #9663 from damacus/remove/chef-10-metadata-paramTim Smith2020-04-201-12/+0
|\ | | | | Remove deprecated Chef-10 constraint handling
| * Stop handling the deprecated Chef version constraintsDan Webb2020-04-201-12/+0
| | | | | | | | | | | | | | | | | | handle_deprecated_constraints has been a work around since Chef 10 Remove old specs that checked that the metadata was transformed correctly Signed-off-by: Daniel Webb <dan.webb@damacus.io>
* | added multipackage support for pacman resourceIngo Becker2020-04-201-147/+65
| | | | | | | | Signed-off-by: Ingo Becker <ingo@orgizm.net>
* | Merge pull request #9627 from ↵Tim Smith2020-04-201-0/+37
|\ \ | | | | | | | | | | | | chef/Kapil/GitHub-2860_exception_raised_in_define_resource_requirements git resource: Fix for exceptions raised in why-run mode
| * | Fix for exception raised in define resource requirementsKapil/GitHub-2860_exception_raised_in_define_resource_requirementsKapil Chouhan2020-04-171-0/+37
| | | | | | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* | | Merge pull request #7982 from chef/multi_packageTim Smith2020-04-171-174/+280
|\ \ \ | | | | | | | | Add multipackage support to homebrew
| * | | Use lamont's magic error handlingTim Smith2020-04-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tiny tweak to grab the first item so we actually get the hash back in the error handling. Given: ```ruby package %w{curl totally_junk_pkg} do action :upgrade end ``` ``` * No candidate version available for totally_junk_pkg ================================================================================ Error executing action `upgrade` on resource 'homebrew_package[curl, totally_junk_pkg]' ================================================================================ Chef::Exceptions::Package ------------------------- No candidate version available for totally_junk_pkg ``` Signed-off-by: Tim Smith <tsmith@chef.io>
| * | | Return empty hash from brew_info and avoid a bunch of nil checksmulti_packageTim Smith2020-04-171-5/+5
| | | | | | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * | | Properly handle unavailable packagesTim Smith2020-04-171-0/+10
| | | | | | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * | | Remove some empty specs I left behindTim Smith2020-04-171-38/+1
| | | | | | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * | | Fix the upgrade action specsTim Smith2020-04-171-25/+20
| | | | | | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>