File: host.rb

package info (click to toggle)
ruby-serverspec 2.41.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 984 kB
  • sloc: ruby: 4,780; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Serverspec::Type
  class Host < Base
    def resolvable?(type)
      @runner.check_host_is_resolvable(@name, type)
    end

    def reachable?(port, proto, timeout)
      @runner.check_host_is_reachable(@name, port, proto, timeout)
    end

    def ipaddress
      @runner.get_host_ipaddress(@name).stdout.strip
    end
    def ipv4_address
      @runner.get_host_ipv4_address(@name).stdout.strip
    end
    def ipv6_address
      @runner.get_host_ipv6_address(@name).stdout.strip
    end
  end
end