Class: Serverspec::Type::User

Inherits:
Base
  • Object
show all
Defined in:
lib/serverspec/type/user.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#belongs_to_group?(group) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/serverspec/type/user.rb', line 7

def belongs_to_group?(group)
  @runner.check_user_belongs_to_group(@name, group)
end

#belongs_to_primary_group?(group) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/serverspec/type/user.rb', line 11

def belongs_to_primary_group?(group)
  @runner.check_user_belongs_to_primary_group(@name, group)
end

#encrypted_passwordObject



39
40
41
# File 'lib/serverspec/type/user.rb', line 39

def encrypted_password
  @runner.get_user_encrypted_password(@name).stdout.strip
end

#exists?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/serverspec/type/user.rb', line 3

def exists?
  @runner.check_user_exists(@name)
end

#has_authorized_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/serverspec/type/user.rb', line 27

def has_authorized_key?(key)
  @runner.check_user_has_authorized_key(@name, key)
end

#has_home_directory?(path) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/serverspec/type/user.rb', line 19

def has_home_directory?(path)
  @runner.check_user_has_home_directory(@name, path)
end

#has_login_shell?(shell) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/serverspec/type/user.rb', line 23

def (shell)
  @runner.(@name, shell)
end

#has_uid?(uid) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/serverspec/type/user.rb', line 15

def has_uid?(uid)
  @runner.check_user_has_uid(@name, uid)
end

#maximum_days_between_password_changeObject



35
36
37
# File 'lib/serverspec/type/user.rb', line 35

def maximum_days_between_password_change
  @runner.get_user_maximum_days_between_password_change(@name).stdout.to_i
end

#minimum_days_between_password_changeObject



31
32
33
# File 'lib/serverspec/type/user.rb', line 31

def minimum_days_between_password_change
  @runner.get_user_minimum_days_between_password_change(@name).stdout.to_i
end