项目作者: tecracer-chef

项目描述 :
Kitchen driver to use existing hosts
高级语言: Ruby
项目地址: git://github.com/tecracer-chef/kitchen-static.git
创建时间: 2019-04-02T19:24:05Z
项目社区:https://github.com/tecracer-chef/kitchen-static

开源协议:Apache License 2.0

下载


Kitchen::Static: A Test Kitchen Driver for Existing Hosts

This is a Test Kitchen driver for use in cases, where you have an
existing machine, such as a physical server which you want
to use for your tests.

The static driver is directly derived from TK’s “proxy” driver,
which is relying on legacy plugin infrastructure - making it directly
incompatible with Windows platforms.

Usage

  1. ---
  2. driver:
  3. name: static
  4. host: 192.168.14.2
  5. # now the rest of your kitchen.yml follows

The host configuration setting, which specifies the hostname/IP you want tests
to run against.

If you have more than one server, for example when testing specific hardware
drivers, just add a suite for each and override the host value in its
section

Supported Platforms

As this is a pure driver which does not interact with the instances/VMs, it
supports all platforms. Specifically Linux and Windows are known to work.

Queueing Feature

As physical machines are a limited resource and are rarely bought or thrown
away in a TestKitchen context, some sort of queueing mechanism is needed in
bigger environments.

To enable this feature, set queueing to true (default: false)

  1. driver:
  2. name: static
  3. queueing: true
  4. request:
  5. execute: /usr/local/bin/get-host.sh
  6. release:
  7. execute: /usr/local/bin/release-host.sh $STATIC_HOSTNAME
  8. ...

Queueing knows two Actions:

  • request to obtain the hostname or IP of the machine to use
  • release to return this host into the pool

If you are using non-ephemeral test systems, like physical machines, you will
need to trigger some procedure to reset them back to the defined default. Otherwise,
every test will modify the system further until results get unpredictable.

There currently is just one handler for queueing scenarios:

  • the script handler, which executes a local script

Driver Options

Name Default Description
queueing false If to invoke external actions to get hostname
queueing_timeout 3600 Timeout for queueing operations in seconds.
queueing_handlers - Glob to load external queueing handlers

Queueing Handler static

This handler only executes local commands. These could query remote databases or
even issue more complex programs to obtain/release machines.

Parameters for request

Name Default Description
type script
execute - Command to execute
match_hostname ^(.*)$ Regex to specify what to grab from output. Default: All
match_banner - Regex to specify optional banner to grab. Default: Nothing

If a banner is grabbed, it’s contents are displaed after the message reporting the
hostname. This field can be used for warnings or additional information like access
to management interfaces (ILO, BMC, …).

Parameters for release

Name Default Description
type script
execute - Command to execute

The executed script gets the following environment variables:

  • STATIC_HOSTNAME: Hostname or IP of the host to be released

License

Apache 2.0 (see LICENSE)