Class: Serverspec::Commands::RedHat

Inherits:
Linux
  • Object
show all
Defined in:
lib/serverspec/commands/redhat.rb

Instance Method Summary collapse

Methods inherited from Linux

#check_iptables_rule, #check_selinux

Methods inherited from Base

#check_authorized_key, #check_belonging_group, #check_cron_entry, #check_directory, #check_file, #check_file_contain, #check_file_contain_within, #check_file_md5checksum, #check_gid, #check_group, #check_grouped, #check_home_directory, #check_installed_by_gem, #check_ipfilter_rule, #check_ipnat_rule, #check_iptables_rule, #check_link, #check_listening, #check_login_shell, #check_mode, #check_mounted, #check_owner, #check_process, #check_reachable, #check_resolvable, #check_routing_table, #check_running, #check_running_under_supervisor, #check_selinux, #check_svcprop, #check_svcprops, #check_uid, #check_user, #check_zfs, #escape, #get_mode

Instance Method Details

#check_access_by_user(file, user, access) ⇒ Object



4
5
6
7
# File 'lib/serverspec/commands/redhat.rb', line 4

def check_access_by_user file, user, access
  # Redhat-specific
  "/sbin/runuser -s /bin/sh -c \"test -#{access} #{file}\" #{user}"
end

#check_enabled(service) ⇒ Object



9
10
11
# File 'lib/serverspec/commands/redhat.rb', line 9

def check_enabled service
  "/sbin/chkconfig --list #{escape(service)} | grep 3:on"
end

#check_installed(package) ⇒ Object



13
14
15
# File 'lib/serverspec/commands/redhat.rb', line 13

def check_installed package
  "rpm -q #{escape(package)}"
end