summaryrefslogtreecommitdiff
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
* Structure deprecations with additional metadatatm/deprecation_with_urlThom May2016-11-1611-48/+87
| | | | | | | | This adds URLs to each class of deprecation, and correctly prints and formats them for maximum user efficiency. We also provide the URL to the data collector for Visibility to ingest. Signed-off-by: Thom May <thom@chef.io>
* Merge pull request #5541 from chef/lcg/node-immutable-array-sliceLamont Granquist2016-11-152-0/+16
|\ | | | | fix ImmutableArray slices
| * add specs for array slice access to node attributeslcg/node-immutable-array-sliceLamont Granquist2016-11-152-0/+16
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fixes Style/Semicolon coplcg/style-semicolonLamont Granquist2016-11-142-5/+5
|/ | | | | | these all seem like useless uses of semicolons. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5315 from ↵Bryan McLellan2016-11-112-0/+405
|\ | | | | | | | | MsysTechnologiesllc/dh/adding_powershell_package_manager_support Adding support for Powershell package manager to Chef package provider
| * Additional changes based on more review commentsdheerajd-msys2016-11-101-187/+157
| | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
| * Modified code based on review commentsdheerajd-msys2016-11-101-4/+4
| | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
| * Added unit specs for powershell packagedheerajd-msys2016-11-102-0/+435
| | | | | | | | Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
* | Respond to review comments and chefstyletm/rescue_5115Thom May2016-11-101-5/+5
| | | | | | | | Signed-off-by: Thom May <thom@chef.io>
* | Code style fixes; :lipstick:Andrew Burns2016-11-101-2/+2
| |
* | launchd: start_calendar_interval validity checkingAndrew Burns2016-11-101-3/+81
|/ | | | | | | | | | | | | | | | | | | | | StartCalendarInterval has some gotchas so we coerce it to sanity check. According to `man 5 launchd.plist`: StartCalendarInterval [is a] <dictionary of integers or array of dictionaries of integers> ... Missing arguments are considered to be wildcard. What the man page doesn't state, but what was observed (OSX 10.11.5, launchctrl v3.4.0) is that key that are specified, _but with invalid values, will also be silently treated as a wildcard values. This means that an entry like: { "Hour"=>0, "Weekday"=>"6-7"} will not just run on midnight of Sat and Sun, rather it will run _every_ midnight. We check to make sure that the values are integers and not strings, adhering to the manpage documentation. This also ensures that only keys that StartCalendarInterval supports will be passed. This eliminates passing a key (like `:hour` or `'hour') and thinking it works when in reality launchd is just treating it as a wildcard. NOTE: This is a "breaking" change in that: it will break existing cookbooks that are using the current docs: https://docs.chef.io/resource_launchd.html (See start_calendar_interval); however the generated plist doesn't appear to actually do what was intended anyway.
* Prevent apt_update failures on non-Linux platformstas50/apt_update_failsTim Smith2016-11-071-25/+17
| | | | | | | | | | | | We 1/2 wired up the noop functionality, but specifying that we only provided the resource on Linux caused that code to never run. This prevents this sort of error on non-Linux platforms: ``` Cannot find a resource for apt_update on windows version 6.3.9600 ``` Signed-off-by: Tim Smith <tsmith@chef.io>
* Don't double-JSON data collector run complete messagesdanielsdeleo2016-11-031-10/+38
| | | | Signed-off-by: Daniel DeLeo <dan@chef.io>
* Enable data collector w/o token for solo, but require explicit URLdanielsdeleo2016-11-031-3/+3
| | | | | | | | | | Third-party data collector implementations are supported and may not require a token for authentication. Therefore we must allow the case where the token is nil in Chef Solo mode. To reduce the chance that the data collector is accidentally enabled, only set the data collector URL to a default value in Chef Client mode. Signed-off-by: Daniel DeLeo <dan@chef.io>
* Remove stale TODO commentsdanielsdeleo2016-11-021-7/+0
| | | | Signed-off-by: Daniel DeLeo <dan@chef.io>
* Disable data collector for solo if token isn't configureddanielsdeleo2016-11-021-8/+78
| | | | Signed-off-by: Daniel DeLeo <dan@chef.io>
* Enable the data collector automaticallydanielsdeleo2016-11-021-2/+2
| | | | Signed-off-by: Daniel DeLeo <dan@chef.io>
* Allow optional signed header auth for data collectordanielsdeleo2016-11-021-1/+47
| | | | | | | | | | * When the data collector is enabled but the token is nil, data collector will use signed header auth. * Switch data collector to an HTTP client that includes the JSON content middlewares so both auth methods talk to the `http` object the same way. Signed-off-by: Daniel DeLeo <dan@chef.io>
* Merge pull request #5496 from chef/adamleff/deprecations-to-data-collectorThom May2016-11-011-0/+2
|\ | | | | Add deprecations to Data Collector competion message
| * Add deprecations to Data Collector competion messageadamleff/deprecations-to-data-collectorAdam Leff2016-10-281-0/+2
| | | | | | | | | | | | | | | | | | By adding deprecation warnings to Data Collector, receivers of Data Collector messages can easily identify nodes that would need attention to their versions/cookbooks before a major version Chef upgrade would be successful. Signed-off-by: Adam Leff <adam@leff.co>
* | Merge pull request #5498 from chef/2919/ssl_fetch_no_cnRachel Adler2016-11-011-0/+38
|\ \ | | | | | | Updating knife ssl fetch to correctly store certificate when it does not have a CN
| * | Updating knife ssl fetch to correctly store certificates when it does not ↵2919/ssl_fetch_no_cntyler-ball2016-10-311-0/+38
| | | | | | | | | | | | | | | | | | contain a common name. Stores the certificate under the URI host instead of the common name in that case Signed-off-by: tyler-ball <tyleraball@gmail.com>
* | | Merge pull request #5495 from chef/lcg/attribute-setting-eventLamont Granquist2016-11-011-1/+46
|\ \ \ | | | | | | | | Core: add attribute_changed hook to event handlers
| * | | add some unit testing of new node APIslcg/attribute-setting-eventLamont Granquist2016-10-311-1/+46
| | | | | | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | Merge pull request #5063 from ChaosCloud/masterLamont Granquist2016-11-011-6/+13
|\ \ \ \ | |_|/ / |/| | | service - upstart restart does not uses latest job config, need start/stop
| * | | Merge branches 'master' and 'master' of https://github.com/chef/chefAbhishekKr2016-10-081-0/+10
| |\ \ \
| * \ \ \ Merge branch 'master' of https://github.com/chef/chefAbhishekKr2016-10-0624-208/+931
| |\ \ \ \
| * | | | | service - upstart restart - service status managed via attr_accessorAbhishekKr2016-09-101-4/+9
| | | | | |
| * | | | | Merge branch 'master' of https://github.com/chef/chefAbhishekKr2016-09-10147-1391/+1995
| |\ \ \ \ \
| * \ \ \ \ \ Merge branch 'master' of https://github.com/chef/chefAbhishekKr2016-07-3117-102/+698
| |\ \ \ \ \ \
| * | | | | | | service - upstart restart - fixing specs and call of stopAbhishekKr2016-06-291-2/+4
| | | | | | | |
* | | | | | | | Merge pull request #5486 from chef/COOL-413/getent-on-solaris-doesnt-workTom Duffield2016-10-311-9/+36
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Properly check lock status of user on solaris2
| * | | | | | | | Solaris users are locked only if *LK*COOL-413/getent-on-solaris-doesnt-workTom Duffield2016-10-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to `man shadow` on Solaris 10 and 11, an account is only locked if the first four characters in the password field are `*LK*`. The same is true for SmartOS (the OS for which the initial code was contributed). Signed-off-by: Tom Duffield <tom@chef.io>
| * | | | | | | | Properly check lock status of user on solaris2Tom Duffield2016-10-311-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Solaris, the 'shadow' database does not exist within `getent`, so the checking for the username there won't return accurate results. As the Solaris provider assumes user management via /etc/shadow, we can very easily parse the contents of the file directly. Signed-off-by: Tom Duffield <tom@chef.io>
* | | | | | | | | Merge pull request #5395 from b1-systems/locking_Thom May2016-10-314-0/+162
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | package locking for apt, yum and zypper
| * | | | | | | | | fixed apt-mark commandsEike Waldt2016-09-291-2/+2
| | | | | | | | | |
| * | | | | | | | | added locking for yumEike Waldt2016-09-291-0/+18
| | | | | | | | | |
| * | | | | | | | | added missing tests for :(un)lock in provider/packageEike Waldt2016-09-291-0/+50
| | | | | | | | | |
| * | | | | | | | | cleaned comments in specc52275322016-09-282-32/+0
| | | | | | | | | |
| * | | | | | | | | added (un)lock_package for apt and zypperc52275322016-09-283-34/+105
| | | | | | | | | |
| * | | | | | | | | implement lockingc52275322016-09-282-0/+55
| | | | | | | | | |
* | | | | | | | | | Add the `--field-separator` flag to knife show commandsTom Duffield2016-10-281-0/+10
| |_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the commands that allow you to filter which attributes it shows you using the `--attribute` flag, add the `--field-separator` flag to allow the user to customize which character(s) they want to use to deliniate the attribute hierarchy. ```shell knife node show NODE -S: -a "packages:Chef Client v12.12.15" ``` Signed-off-by: Tom Duffield <tom@chef.io>
* | | | | | | | | Merge pull request #5394 from ↵Bryan McLellan2016-10-271-4/+13
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | MsysTechnologiesllc/ali/package_resource_uninstall_fix Newly creating uninstall string using the product code value retrieved from the uninstall_string of the Windows registry to avoid using invalid uninstall_string.
| * | | | | | | | Newly creating uninstall string using the product code value retrieved from ↵aliasgar162016-10-131-4/+13
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the uninstall_string of the Windows registry to avoid using invalid uninstall_string. Signed-off-by: aliasgar16 <aliasgar.batterywala@msystechnologies.com>
* | | | | | | | rename __path to __path__ and __node to __node__lcg/node-path-trackingLamont Granquist2016-10-252-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consistency with Unchain here: https://github.com/chef/chef/blob/master/lib/chef/decorator/unchain.rb#L23-L24 and with SimpleDelegator: https://ruby-doc.org/stdlib-2.1.0/libdoc/delegate/rdoc/SimpleDelegator.html#method-i-__getobj__ Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | | add tests from #4207Lamont Granquist2016-10-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | validates that we fixed the top_level_breadcrumb-state related bug which has been reported Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | | remove breadcrumb stateLamont Granquist2016-10-251-87/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | | standardize initializer args for VividMash+ImmutableMashLamont Granquist2016-10-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if anyone is using these directly this might be a breaking change, although it makes it considerably easier to use VividMash and IMO ImmutableMash is an implementation detail of the deep merge cache and Chef::Node object. we definitely have never documented these APIs, so I think the onus is on the consumer to update their code. VividMash.new() should now work. VividMash.new({ foo: :bar }) should also now work. IDK what object people would have been passing in as the root object before. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | | add specsLamont Granquist2016-10-251-0/+84
| |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | remove excessive mockinglcg/package-inline-resourcesLamont Granquist2016-10-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we have too much collaboration and state in our objects to write pure unit tests. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>