Module: Serverspec::Type

Defined in:
lib/serverspec_extended_types/virtualenv.rb,
lib/serverspec_extended_types/bitlbee.rb,
lib/serverspec_extended_types/http_get.rb

Overview

serverspec-extended-types - virtualenv

<github.com/jantman/serverspec-extended-types>

Copyright © 2015 Jason Antman <[email protected]>

Licensed under the MIT License - see LICENSE.txt

Defined Under Namespace

Classes: Bitlbee, Http_Get, Virtualenv

Instance Method Summary collapse

Instance Method Details

#bitlbee(port, nick, password, use_ssl = false) ⇒ Serverspec::Type::Bitlbee

Serverspec Type method for Bitlbee

Examples:

describe bitlbee(6697, 'myuser', 'mypass') do
  # tests here
end

Parameters:

  • port (Integer)

    the port to connect to

  • nick (String)

    the nick to connect as

  • password (String)

    the password for nick

  • use_ssl (Boolean) (defaults to: false)

    whether to connect with SSL

Returns:



198
199
200
# File 'lib/serverspec_extended_types/bitlbee.rb', line 198

def bitlbee(port, nick, password, use_ssl=false)
  Bitlbee.new(port, nick, password, use_ssl)
end

#http_get(port, host_header, path, timeout_sec = 10, protocol = 'http', bypass_ssl_verify = false) ⇒ Serverspec::Type::Http_Get

ServerSpec Type wrapper for http_get

Examples:

describe http_get(80, 'myhostname', '/') do
  # tests here
end

Parameters:

  • port (Int)

    the port to connect to HTTP over

  • host_header (String)

    the value to set in the ‘Host’ HTTP request header

  • path (String)

    the URI/path to request from the server

  • timeout_sec (Int) (defaults to: 10)

    how many seconds to allow request to run before timing out and setting @timed_out_status to True

  • protocol (String) (defaults to: 'http')

    the protocol to connect to the server (default ‘http’, can be ‘https’)

  • bypass_ssl_verify (Boolean) (defaults to: false)

    if true, SSL verification will be bypassed (useful for self-signed certificates)

Returns:



215
216
217
# File 'lib/serverspec_extended_types/http_get.rb', line 215

def http_get(port, host_header, path, timeout_sec=10, protocol='http', bypass_ssl_verify=false)
  Http_Get.new(port, host_header, path, timeout_sec, protocol, bypass_ssl_verify)
end

#virtualenv(name) ⇒ Serverspec::Type::Virtualenv

Serverspec Type wrapper method for Serverspec::Type::Virtualenv

Examples:

describe virtualenv('/path/to/venv') do
  # tests here
end

Parameters:

  • name (String)

    the absolute path to the virtualenv root

Returns:



156
157
158
# File 'lib/serverspec_extended_types/virtualenv.rb', line 156

def virtualenv(name)
  Virtualenv.new(name)
end