TestMachine

TestMachine

Abstract class that creates machines, runs tests on created machines, then destroys the machines.

Constructor

new TestMachine(opts)

Source:
Parameters:
Name Type Description
opts TestMachineOptions

options to configure the test machine.

Methods

(abstract) createInstance() → {Promise}

Source:

Creates a new machine for testing.

Returns:

resolves when the machine has been created.

Type
Promise

(abstract) destroyInstance() → {Promise}

Source:

Destroys the machine used for testing.

Returns:

resolves when the machine has been destroyed.

Type
Promise

ensureServiceStarted(service, timeout, startedopt) → {Promise}

Source:

Ensure that a systemd service is running.

Parameters:
Name Type Attributes Description
service String

the name of the systemd service to check.

timeout Integer

the maxiumum time to wait.

started Integer <optional>

the timestamp of the first check executed. Defaults to the current time.

Returns:

resolves when the session is running.

Type
Promise

ensureStarted(timeout, startedopt, failuresopt) → {Promise}

Source:

Ensure that a newly created machine has started.

Parameters:
Name Type Attributes Description
timeout Integer

the maxiumum time to wait.

started Integer <optional>

the timestamp of the first check executed. Defaults to the current time.

failures Integer <optional>

the number of times that an SSH connection has been tried. Defaults to 0.

Returns:

resolves when the machine has been started.

Type
Promise

(abstract) getInstances() → {Promise.<Array>}

Source:

Fetches all machines that are currently running created by this testing.

Returns:

resolves to the current running machines. Each includes { id, name, zone, creationTimestamp }.

Type
Promise.<Array>

(abstract) ssh(command) → {Promise}

Source:

Runs an SSH connection to the current testing machine.

Parameters:
Name Type Description
command String

a command to execute on the remote machine. If not provided, an interactive SSH session is started.

Returns:

resolves when the SSH connection terminates.

Type
Promise