summaryrefslogtreecommitdiff
path: root/spec/unit/provider/user
Commit message (Collapse)AuthorAgeFilesLines
* Fix some odd whitespacing in tests.Pete Higgins2020-06-241-2/+2
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-136-6/+6
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix AIX specLamont Granquist2020-01-131-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-081-1/+1
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add mac_user resource that is compatible with macOS >= 10.14Ryan Cragun2019-07-242-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a user resource that is compatible with default TCC restrictions that were introduced in macOS 10.14. Changes: * This resource and the corresponding provider have been modified to work with default macOS TCC policies. Direct access to user binary plists are no longer permitted by default, thus we've chosen to use use newer methods of creating, modifying and removing users. * Due to the tooling required by the provider this provider is only suitable for use on macOS >= 10.14. Support for older platforms has been removed. New Features: * Primary group management is now included. * 'admin' is now a boolean property that configures a user to an admin. * 'admin_username' and 'admin_password' are new properties that define the admin user credentials required for toggling SecureToken for an exiting user. The 'admin_username' must correspond to a system admin with SecureToken enabled in order to toggle SecureToken. * 'secure_token' is a boolean property that sets the desired state for SecureToken. SecureToken token is required for FileVault full disk encryption. Signed-off-by: Ryan Cragun <ryan@chef.io>
* Fix the comment specTim Smith2019-02-191-2/+1
| | | | | | This was entirely wrong. We're setting the comment to nil and proving that it ends up being the user and not the comment, but then we actually expected it to be the comment. This spec did not due what the description said it did. Now it does. Signed-off-by: Tim Smith <tsmith@chef.io>
* Improve the lets in the dscl provider specsTim Smith2019-02-191-19/+15
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix bad spec descriptionsTim Smith2019-02-191-2/+2
| | | | | | These are the opposite Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove the legacy useradd user providerTim Smith2019-02-191-1/+0
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* user resource: Remove support for macOS 10.7 and 10.7 upgraded to 10.8+Tim Smith2019-01-141-303/+86
| | | | | | We can greatly simplify our dscl user provider by removing support for macOS 10.7 and 10.7 which has been upgraded to 10.8. No one is using this anyone as it's beyond EOL with Apple and has been for years. Signed-off-by: Tim Smith <tsmith@chef.io>
* MSYS-888 Adds full_name property to user resource for Windows.vasu11052018-09-241-3/+12
| | | | Signed-off-by: vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Fix issue of setting comment for windows userNAshwini2018-08-101-3/+3
| | | | Signed-off-by: NAshwini <ashwini.nehate@msystechnologies.com>
* Merge pull request #7484 from chef/attribute_to_propertiesTim Smith2018-07-172-17/+17
|\ | | | | Update wording in resource specs for attributes -> properties
| * Update wording in resource specs for attributes -> propertiesTim Smith2018-07-102-17/+17
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Remove require mixlib/shellouts where not necessaryrequire_the_right_shelloutTim Smith2018-07-103-3/+0
|/ | | | | | the dscl user provider uses mixin/shell_out instead and the specs don't seem to use mixlib/shellout or actually need the require. Signed-off-by: Tim Smith <tsmith@chef.io>
* fix Style/HashSyntaxLamont Granquist2018-07-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Unification of shell_out APIsLamont Granquist2018-06-154-35/+35
| | | | | | | converts all usage to just shell_out() from the numerous helper utilities that we've had previously. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #7249 from chef/lcg/cleanup-userLamont Granquist2018-05-211-2/+2
|\ | | | | Cleanup AIX and Solaris user resources.
| * clean up solaris providerLamont Granquist2018-05-101-2/+2
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Fixing shell_out to have correct syntaxNick McSpadden2018-05-151-1/+1
| | | | | | | | Signed-off-by: Nick McSpadden <nmcspadden@gmail.com>
* | Updating spec testNick McSpadden2018-05-151-9/+2
|/
* mechanical conversion of most debug log statements to traceThom May2018-03-261-0/+3
| | | | Signed-off-by: Thom May <thom@chef.io>
* Check for set home property before file existence (fixes #5777)Sean Karlage2018-01-041-0/+26
| | | | Signed-off-by: Sean Karlage <skarlage@fb.com>
* fixes for rubocop 0.49.1 engineLamont Granquist2017-06-201-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #6055 from coderanger/package-optionsThom May2017-04-281-5/+5
|\ | | | | Clean up more stubbed properties in tests
| * Remove a whole bunch more stubbed property stuff.Noah Kantrowitz2017-04-111-5/+5
| | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | Fix manage_home on AIXtm/aix_manage_homeThom May2017-04-271-0/+97
|/ | | | | | Fixes: #6092 Signed-off-by: Thom May <thom@chef.io>
* fix remaining specs for popen4 removalLamont Granquist2017-04-011-16/+4
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove most of supports APILamont Granquist2017-03-061-2/+2
| | | | | | | | | | | | | | | still there on service (where it makes some sense) also still on mount (because i have no idea if that is actively being used or if it makes any sense at all). converts it to a property on mount + service as well. also removed setting it as an array -- did we ever document that and/or does anyone use it? i'm not religiously against that way of setting it, but if nobody ever used it i'd rather remove the YAGNI. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13: Remove supports API from all user providersLamont Granquist2017-02-282-54/+8
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* user provider cleanupLamont Granquist2016-12-224-88/+89
| | | | | | | | * removes more run_command * converts to shell_out_compact * some other misc style cleanup Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add a spec for supports non_unique throwing a deprecation messageTim Smith2016-12-061-0/+6
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* The suggested fix for the manage_home deprecation is incorrectTim Smith2016-12-061-1/+1
| | | | | | manage_home: true is not a proper resource property. It should be manage_home true instead. Signed-off-by: Tim Smith <tsmith@chef.io>
* Structure deprecations with additional metadatatm/deprecation_with_urlThom May2016-11-161-1/+1
| | | | | | | | 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>
* 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>
* Fix solaris handling for -m/-M behavior. Fixes #5403.Noah Kantrowitz2016-10-051-1/+9
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Style fixes.Noah Kantrowitz2016-09-201-1/+0
| | | | 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>
* suppress deprecation errors in testslcg/manage-home-fixLamont Granquist2016-09-152-0/+6
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add tests for provider behaviorLamont Granquist2016-09-141-0/+12
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* revert supports[:manage_home] behaviorLamont Granquist2016-09-141-6/+24
| | | | | | | even though i violently disagree that this is correct behavior and we're just going to break everyone in one massive go when we hit Chef 13. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add func spec for default and fix unit specsLamont Granquist2016-08-231-3/+8
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* clean up everythingLamont Granquist2016-08-231-11/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* user provider manage_home behavior and refactorLamont Granquist2016-08-195-14/+41
| | | | | | | | | split out the user provider into 1:1 resources. fix the behavior of the linux user provider to implement manage_home behavior correctly. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-172-52/+52
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Too much log output and unnecessary warnings! Suppress that shit.Kartik Null Cating-Subramanian2016-04-251-6/+6
|
* fix trailing whitespacetm/trailing_whitespaceThom May2016-02-161-1/+1
|
* Merge pull request #4427 from juliandunn/remove-duplicate-shellcmddefLamont Granquist2016-02-162-17/+20
|\ | | | | Refactor test to remove duplicate definition of ShellCmdResult