summaryrefslogtreecommitdiff
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | | Merge pull request #5472 from chef/COOL-597/address-suse-test-failuresTom Duffield2016-10-211-0/+90
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Address test failures in SUSE 11.4 and 12.1
| * | | | | | | | | Raise error if suse group manager adds non-existent userCOOL-597/address-suse-test-failuresTom Duffield2016-10-201-0/+90
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The expected behavior of chef, as defined by our tests, is that if a user specified in a group resource does not exist than chef should raise an error. On suse, we use groupmod which will not raise an error if you attempt to add a non-existent user to a group. This change adds in a simple check that will raise an error if the specified does not exist. Signed-off-by: Tom Duffield <tom@chef.io>
* | | | | | | | | Merge pull request #5479 from chef/lcg/rubocop-0.44.1Lamont Granquist2016-10-201-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | fixes for rubocop 0.44.1 engine
| * | | | | | | | | fixes for rubocop 0.44.1 enginelcg/rubocop-0.44.1Lamont Granquist2016-10-201-1/+1
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a few cops we have enabled got a little more accurate/stricter Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | | | Attributes: add tests for regression in 12.0 fixed recentlyLamont Granquist2016-10-201-0/+28
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests for the issue that led up to https://github.com/chef/chef/issues/5447 The Hash tests actually pass against 12.13.37 so it appearly that only broke the Immutable array objects in 12.0. This both explains why we didn't have any existing tests that caught it, and why it went uncaught for so long. It also adds some ammunition to the argument that fixing this in 12.14.x was not a major breaking change to users that had been relying on the buggy 12.0 behavior. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | | Implement `--config-option` CLI opt for knifedan/config-option-in-knifedanielsdeleo2016-10-181-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `--config-option` CLI option allows setting any `Chef::Config` setting on the command line, which allows applications to be used without a configuration file even if a desired config option does not have a corresponding CLI option. This CLI option was present in the help output for knife but was not actually implemented. Moving the behavior into chef-config allows us to use it for both `chef-client` and `knife`. Signed-off-by: Daniel DeLeo <dan@chef.io>
* | | | | | | | Merge pull request #5430 from MsysTechnologiesllc/nim/double_quotes_issueMatt Wrock2016-10-141-1/+25
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fixed double quotes issue in powershell_out
| * | | | | | | | Verifying powershell stdout in specsNimishaS2016-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
| * | | | | | | | running powershell specs for only windowsNimishaS2016-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
| * | | | | | | | Fixed double quotes issue in powershell_outNimishaS2016-10-071-0/+22
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
* | | | | | | | Refactored Chef::Provider::User to short circuit and provider better ↵Geoffrey Hichborn2016-10-131-0/+6
| |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comparison of home paths to fix Issue #5444 Signed-off-by: Geoffrey Hichborn <geoff@socialcast.com>
* | | | | | | Adding support for rfc 62 exit code 213Jeremy J. Miller2016-10-061-0/+10
|/ / / / / / | | | | | | | | | | | | | | | | | | Signed-off-by: Jeremy J. Miller <jm@chef.io>
* | | | | | Merge pull request #5417 from chef/lcg/issue5089Thom May2016-10-061-0/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix for "Chefspec template rendering fails when cookbook_name != directory name"
| * | | | | | add a spec for the fix to #5089Lamont Granquist2016-10-051-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | | | | | Revert Handling double quotes in powershell_outMatt Wrock2016-10-051-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matt Wrock <matt@mattwrock.com>
* | | | | | | Merge pull request #5408 from coderanger/solaris-mNoah Kantrowitz2016-10-061-1/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix solaris handling for useradd -m/-M behavior
| * | | | | | | Fix solaris handling for -m/-M behavior. Fixes #5403.Noah Kantrowitz2016-10-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | | | | | | | Merge pull request #5381 from ↵Bryan McLellan2016-10-051-32/+13
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | MsysTechnologiesllc/nim/double_quotes_parsing_error Handling double quotes in powershell_out
| * | | | | | | Raising Mixlib::ShellOut::ShellCommandFailed exceptionNimishaS2016-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
| * | | | | | | Handling double quotes. Added specsNimishaS2016-09-301-32/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
* | | | | | | | Merge pull request #5319 from tas50/apt_update_specsThom May2016-10-041-17/+25
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Test apt_update on non-linux behavior
| * | | | | | | | Test apt_update on non-linux behaviorTim Smith2016-09-141-17/+25
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure on non-linux without running which we still end up with a no-op Signed-off-by: Tim Smith <tsmith@chef.io>
* | | | | | | | Merge pull request #5314 from chef/tm/raw_keyThom May2016-10-041-0/+50
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | Allow raw_key to override the configured signing_key
| * | | | | | | Allow raw_key to override the configured signing_keytm/raw_keyThom May2016-09-141-0/+50
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #5175 Signed-off-by: Thom May <thom@may.lt>
* | | | | | | Merge pull request #5359 from ↵Bryan McLellan2016-09-303-10/+122
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MsysTechnologiesllc/ali/windows_registry_key_resource_delete_fix Allow deletion of registry_key without the need for users to pass data key in values hash.
| * | | | | | | Allow deletion of registry_key without the need for users to pass type and ↵aliasgar162016-09-303-10/+122
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data key in values hash. Signed-off-by: aliasgar16 <aliasgar.batterywala@msystechnologies.com>
* | | | | | | Merge pull request #5377 from ↵Bryan McLellan2016-09-301-4/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MsysTechnologiesllc/nim/dsc_failure_reported_warning Invalid `dsc_scripts` should fail the run
| * | | | | | | set erroraction stop instead of continueNimishaS2016-09-301-4/+10
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Signed-off-by: NimishaS <nimisha.sharad@msystechnologies.com>
* | | | | | | Fixed review commentsVasu11052016-09-301-11/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@clogeny.com>
* | | | | | | Added resource and provider for cab packageVasu11052016-09-302-0/+229
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverted changes Adding resource and provider for cab file support Added method identifying package version for installation and removal of package Updated code to idetitfy installed version refactored some code Refactored code for parsing dism get package output Fixed rubocop issue, working on specs created spec files Working on unit specs Added unit specs and working on functional specs Working on functional specs and fixed rubocop errors Fixed failing unit test cases Resolved rubucop style error Removed functional specs Fixed error and working on functional specs Added missing functional spec file
* | | | | | Merge pull request #5379 from chef/localMatt Wrock2016-09-291-4/+2
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Revert --local filter for gems installed from paths
| * | | | | revert --local filter for gems installed from pathslocalMatt Wrock2016-09-231-4/+2
| | | | | |
* | | | | | Merge branch 'master' into solaris-rNoah Kantrowitz2016-09-237-2/+151
|\ \ \ \ \ \
| * \ \ \ \ \ Merge pull request #5360 from gbagnoli/array_literals_attributesLamont Granquist2016-09-232-1/+50
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | Chef 12 Attribute Regression
| | * | | | | modify attributes and nodes tests for deeply converting_valuesLamont Granquist2016-09-233-45/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | slightly more succinct and strict about types, also trying to keep the attributes tests associated with attributes even though we mix them all up like crazy anyway... Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| | * | | | | Convert attributes defined as literal arraysGiacomo Bagnoli2016-09-211-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VividMash, unlike Mash, does not recursively convert values inside arrays, just the array itself. As such, hashes inside arrays are not converted to *Mash, introducing a behaviour that differs from Chef 11, e.g. having this attr defined node['foo'] = [ { 'attr' => 'value' } ] in Chef 11 `node[:foo][0][:attr]` returns `'value'` while in Chef 12 it returns `nil` This commit fixes VividMash so arrays are recursively converted and the behaviour restored. Plus, immutablize merge_all result, so to be sure that hashes contained in Arrays are properly immutablized as well, so not existing attributes are not automatically vivified (thus returning an empty VividMash instead of nil) This problem was first reported in chef/chef#2871. Signed-off-by: Giacomo Bagnoli <gbagnoli@gmail.com>
| * | | | | | Handling Errno::ETIMEDOUT (#5358)Nimisha Sharad2016-09-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handling Errno::ETIMEDOUT * spec for Errno::ETIMEDOUT * rubocop fix
| * | | | | | drop warn all the way down to debuglcg/ignore-unknown-metdata-rb-fieldsLamont Granquist2016-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we expect this to be forward compat, so that all this turns into is a nag message to upgrade which is probably better just not to display Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | | | | | ignore unknown metadata fields in metadata.rbLamont Granquist2016-09-211-0/+19
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if we're just using chef-zero there's no metadata.json file so chef-client doesn't do json parsing (which ignores unknown metadata fields already) but parses metadata.json which explodes. i believe since TK goes through berks it renders the rb to json before copying to the virt so we don't see this in TK or in running chef-client from a real server. this only affects the chef-client -z or chef-zolo mode of operation (and probably legacy chef-solo) Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | | | | Merge pull request #5351 from chef/lcg/node-presenter-tweaksLamont Granquist2016-09-211-1/+22
| |\ \ \ \ \ | | |/ / / / | |/| | | | fix method_access and array handling in node presenter
| | * | | | add spec around node['class'] vs. node.class behaviorlcg/node-presenter-tweaksLamont Granquist2016-09-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we want attributes before methods Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| | * | | | add another spec for chef_environmentLamont Granquist2016-09-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| | * | | | fix method_access and array handling in node presenterLamont Granquist2016-09-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | | | | Fixed undefined short_cksum method issue and checksum in uppercase issue for ↵Aliasgar162016-09-202-0/+59
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | windows_package resource. (#5332) * Fixed undefined short_cksum method issue and checksum in uppercase issue for windows_package resource. * Added RSpecs for the changes done here. * Fixed RSpecs issues.
* | | | | Style fixes.Noah Kantrowitz2016-09-202-13/+12
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | | | | Add a test for the new Solaris behavior.Noah Kantrowitz2016-09-201-0/+8
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | | | | Refactor groupadd tests to a more normal RSpec layout. Noah Kantrowitz2016-09-201-96/+107
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | | | | Add a test for create_user to make sure we have no `-r`s.Noah Kantrowitz2016-09-191-0/+10
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | | | | Refactor these tests to be less repeat-y.Noah Kantrowitz2016-09-191-41/+36
|/ / / / | | | | | | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | | | Renamed supress_log_resource_count to count_log_resource_updatesnimisha2016-09-161-5/+5
| | | |