Module: Inspec::Resources::UserManagementSelector

Included in:
User, Users
Defined in:
lib/inspec/resources/users.rb

Overview

This file contains two resources, the ‘user` and `users` resource. The `user` resource is optimized for requests that verify specific users that you know upfront for testing. If you need to query all users or search specific users with certain properties, use the `users` resource.

Instance Method Summary collapse

Instance Method Details

#select_user_manager(os) ⇒ Object

select user provider based on the operating system returns nil, if no user manager was found for the operating system



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/inspec/resources/users.rb', line 16

def select_user_manager(os)
  if os.linux?
    LinuxUser.new(inspec)
  elsif os.windows?
    WindowsUser.new(inspec)
  elsif ["darwin"].include?(os[:family])
    DarwinUser.new(inspec)
  elsif ["bsd"].include?(os[:family])
    FreeBSDUser.new(inspec)
  elsif ["aix"].include?(os[:family])
    AixUser.new(inspec)
  elsif os.solaris?
    SolarisUser.new(inspec)
  elsif ["hpux"].include?(os[:family])
    HpuxUser.new(inspec)
  end
end