summaryrefslogtreecommitdiff
path: root/spec/unit/provider
Commit message (Collapse)AuthorAgeFilesLines
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-111-2/+2
| | | | | | | In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
* Merge pull request #4321 from chef/service_userMatt Wrock2015-12-291-27/+18
|\ | | | | fix run_as_user of windows_service
| * fixes #3521 correcting format of user name passed to policy apis and does ↵Matt Wrock2015-12-291-27/+18
| | | | | | | | not clobber existing service rights of other users
* | Added profile provider for OS XNate Walck2015-12-171-0/+267
| | | | | | | | Fixed resource to use let
* | Merge pull request #4320 from chef/jk/fix-package-nil-warningJay Mundrawala2015-12-161-5/+1
|\ \ | |/ |/| Fix failing package unit test
| * Fix failing package unit testjk/fix-package-nil-warningJohn Keiser2015-12-161-5/+1
| |
* | fixing post merge test breaksMatt Wrock2015-12-151-2/+2
| |
* | non msi packages must explicitly provide a source attribute on installMatt Wrock2015-12-151-5/+15
|/
* Use properties in package resourcesjk/package-propertiesJohn Keiser2015-12-152-2/+0
|
* Merge pull request #4193 from chef/mwrock/packageSalim Alam2015-12-083-36/+572
|\ | | | | adds support for installer types inno, nsis, wise and installshield to windows_package resource
| * adds support to installer types inno, nsis, wise and installshield top the ↵Matt Wrock2015-12-073-36/+572
| | | | | | | | windows_package resource
* | restore handling of dpkg -s returns codes (w/tests)lcg/dpkg-s-return-codesLamont Granquist2015-12-071-3/+38
|/ | | | | | | | | | | | | | | | Previously dpkg -s would allow a 0 or 1 exit status and it wasn't entirely clear why this was so either from the code or the tests. This restores throwing an exception if we are outside of the [0,1] range, and then adds tests for both behaviors: - on old ubuntu/debian we get an exit(0) and output on stdout if the file is not installed - on newer ubuntu/debian we get an exit(1) and output on stderr if the file is not installed Added tests for both those cases, and the case where dpkg -s does some other kind of exitcode barf and we should raise.
* add unit test for a_to_sLamont Granquist2015-12-021-0/+4
|
* dpkg multipackage and bonus fixesLamont Granquist2015-12-022-50/+43
| | | | | | | | - multipackages dpkg_package - fixes edge conditions in load-current-resource around purging/removing packages that threw errors before - fixes the ability to purge packages that have been removed - adds a lot of functional tests for dpkg_package
* Correcting regex for upstart_stateJustin Seubert2015-11-231-0/+19
|
* dpkg provider cleanupLamont Granquist2015-11-201-85/+138
| | | | | | | | | | | | | | - :update and :install are now treated the same way and throw the same exceptions - :remove and :purge don't require the source at all, so don't do any checking on that - fix some convoluted side-effecty logic in load_current_resource - load_current_resource now correctly gets the dpkg state on :remove and :purge when the file does not exist (pretty sure the old logic did not) - fixed the FIXME about using en_US.UTF-8 (the default for shell_out!) - just use shell_out! to throw exceptions - clean up all the specs and remove all the instance vars from the code
* WMF 5 RTM and Win 10 Threshold 2 allow the RefreshMode to be enabled.Steven Murawski2015-11-181-41/+62
|
* Add reboot notification to dsc_resourceSteven Murawski2015-11-181-3/+21
|
* base package provider fixesLamont Granquist2015-11-172-366/+499
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * removes the mutation of the new_resource.version * adds package_class_supports_arrays for multipackage providers * cleans up the package resource initializer and sets the package_name correctly through the accessor method. By mutating new_resource.version we were destroying the original intent of what the user was requesting. This is a bug that must be fixed. Generally, subclasses will be able to get the correct information they need through either the version argument they were passed in install_package(name, version) instead, or through their `#target_version_array` method. If this breaks anything then those providers need bugfixes as well (since this is a change to an internal API accessible only to subclassing, and there are backwards compatible and correct ways to get the information, this is *not* a SemVer violating change). See the fix I made to the OpenBSD provider to preserve the same semantics, avoid using new_resource.version where it was inappropriate, and make the code more symmetrical where before substantially different looking code in install_package and remove_package had exactly the same ultimate effect. The package_class_supports_arrays 'DSL' for writing multipackage providers coerces the arguments to the virtual methods (e.g. install_package) into arrays, even if the user is only requesting a single package install. This removes most of the `is_a?(Array)` checks from the implementation subclasses. The cleanup of the initializer is similarly necessary so that we can use Chef 12.5 coercions to make the package_name and version arguments accept string, but always be Arrays. This should eliminate the rest of the need to write `is_a?(Array)` code all over the package provider implementations.
* Merge pull request #4040 from chef/tm/live_execute_streamingThom May2015-11-122-36/+94
|\ | | | | Implement live streaming for execute resources
| * respond to review commentsThom May2015-11-091-64/+70
| | | | | | | | | | | | | | | | | | | | the logic is now: if the resource is not sensitive, and if it's explicitly requested to be streamed or if the log level is info or debug, then we'll consider streaming it. If we're configured to send the output to the events stream, we'll do so. Otherwise, if we're not daemonized and have a TTY, we'll go to STDOUT
| * Implement code review comments and fix failing testsThom May2015-11-091-2/+2
| |
| * Implement live streaming for execute resourcesAdam Jacob2015-11-092-26/+78
| | | | | | | | | | | | | | | | | | | | This brings live streaming of execute resource output to the output formatters. It also adds a mechanism for checking to see if an output formatter is in use through the event dispatch system. It adds a new configuration option, "always_stream_execute", which does what it says on the tin.
* | Merge pull request #3991 from chef/jdm/remote-file-sha2Thom May2015-11-121-36/+62
|\ \ | | | | | | Modify remote_file cache_control_data to use sha256 for its name
| * | Update cache_control_data_ specs to use sha256 for path namejdm/remote-file-sha2Jay Mundrawala2015-09-281-36/+62
| | |
* | | Use the proper python interpretor for yum-dump.py on Fedora 21+Tim Smith2015-11-051-0/+6
| |/ |/| | | | | | | | | | | | | | | | | | | Fedora 21+ use dnf as the primary package manager. Lamont added code in 12.5 to allow for a yum compat mode. This doesn't entirely work though as we need yum-dump.py to correctly run. We were parsing the shabang in the yum binary to find the path to python. On a dnf system the yum binary is a bash script though so we were trying to run yum-dump.py using bash which obviously fails. I added a fallback method to use python if the shebang parsing returns bash. With this in place AND the yum package installed you can use the package resource on Fedora.
* | fix tests for my changeAubrey Holland2015-10-241-1/+1
| |
* | add spec for stdout/stderr suppresion in error of sensitive execute resourceRanjib Dey2015-10-241-0/+9
| |
* | provider/user/dscl: Set "comment" default valueMikhail Zholobov2015-10-241-0/+7
| | | | | | | | | | "comment" attribute should be defined to create user account properly on OS X. Otherwise, the RealName will be empty.
* | provider/user/dscl: Set default gid to 20Mikhail Zholobov2015-10-231-0/+7
| | | | | | | | | | gid should always be defined to create user account properly on OS X. "staff" (gid 20) is a default group for regular user accounts.
* | overhaul solaris SMF service providerlcg/3187Dave Eddy2015-10-231-39/+110
| |
* | Merge pull request #3119 from cmluciano/cml/bug1586Phil Dibowitz2015-10-201-0/+9
|\ \ | | | | | | Fix condition of removing a group before user error.
| * | Add recommended test from btmChristopher M. Luciano2015-10-121-0/+9
| | |
* | | fix unit testsMatt Wrock2015-10-081-2/+2
| | |
* | | Quote paths.mcquin/chef-3883Claire McQuin2015-10-061-2/+12
| | |
* | | Merge pull request #4016 from chef/mcquin/nano-ps-scriptClaire McQuin2015-10-021-26/+42
|\ \ \ | | | | | | | | Use -Command flag on Nano
| * | | Use -Command flag on NanoClaire McQuin2015-10-011-26/+42
| | |/ | |/|
* | | Merge pull request #4005 from chef/salam/template-fixSalim Alam2015-10-011-2/+52
|\ \ \ | | | | | | | | Use Chef::FileContentManagement::Tempfile to create temp file
| * | | Fix AppVeyorsalam/template-fixSalim Alam2015-10-011-1/+1
| | | |
| * | | Clean up tests, fix bug in tempfile_openSalim Alam2015-09-301-8/+12
| | | |
| * | | Get rid of truthy/falseySalim Alam2015-09-301-8/+8
| | | |
| * | | Use Chef::FileContentManagement::Tempfile to create temp fileSalim Alam2015-09-291-0/+46
| |/ /
* | | Use much simpler regex for determining the rpm versionIrving Popovetsky2015-09-291-1/+18
|/ /
* | Remove pesky whitespacemcquin/remove-constClaire McQuin2015-09-211-1/+0
| |
* | Remove should from spec textClaire McQuin2015-09-211-28/+28
| |
* | Use letClaire McQuin2015-09-211-169/+170
| |
* | Safely clean up Win32 namespace after specsClaire McQuin2015-09-211-3/+14
| |
* | Rename refresh_mode_disabled? to dsc_refresh_mode_disabled?mcquin/dsc_resource_specClaire McQuin2015-09-081-3/+3
| |
* | Skip tests unless RefreshMode is DisabledClaire McQuin2015-09-081-10/+3
| |
* | refactor remote_directory providerLamont Granquist2015-09-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Huge speed and memory perf boost. In the prior code if you were copying 10 dotfiles to a home directory with a million files in it, would slurp all million files into a ruby Set object even if you were not ultimately going to purge the unmanaged files. This code inverts the logic and tracks managed files and then iterates through the filesystem without slurping a list into memory. - Only do file purging logic if purging is set. - Fixes mutation of new_resource.overwrite. - Fixes mutation of new_resource.rights (subtle). - Adds helper delegators to the new_resource properties. - Deprecates (instead of removes) now-unused methods. - Renamed a method (with deprecated alias preserved) for consistency. - Adds YARD for everything. - Changes protected to private because protected is largely useless in ruby. - Removes whyrun_supported? because the superclass sets that.