Version:

Tester Guide

/ binnacle / latest / keywords/

Keywords

TEST

Runs any given command and validates for the exit code. For example,

TEST "stat /var/www/html/index.html"

Or validate for a specific exit code

TEST 1, "ls /non/existing/dir"

EXPECT

Runs the given command and validates the output only if exit code of the command is zero.

EXPECT "node1.example.com", "hostname"

TEST_WITHIN

To be implemented

EXPECT_WITHIN

To be implemented

EXISTS

To be implemented

TRUE

Test any expression

TRUE <expr>, "test title", "message to show on failure"
TRUE 42 % 2 == 0, "Even number test for 42"

hn = TEST "hostname"
TRUE hn == "node1.example.com", "hostname test for node1.example.com", "Actual: #{hn}"

FALSE

Same as TRUE but validate for false

USE_NODE

To switch node to execute the tests.

# Approach 1: set required node before the test statements

USE_NODE "node1.example.com"
TEST "command1.."
TEST "command2.."

USE_NODE "node2.example.com"
TEST "command1.."
TEST "command2.."
# Approach 2: Use Block syntax when node switch is required

# Default node set
USE_NODE "node1.example.com"

TEST "command 1"
TEST "command 2"

USE_NODE "node2.example.com" do
  TEST "command 3"
  TEST "command 4"
end

# continue running commands in default node
TEST "command 5"

USE_REMOTE_PLUGIN

Default remote plugin is ssh, change it when required. Similar to NODE keyword, this also supports Block syntax.

USE_NODE "node1.example.com"
USE_REMOTE_PLUGIN "ssh"

TEST "command 1"

USE_REMOTE_PLUGIN "docker" do
  USE_NODE "node2.example.com" do
    TEST "command 2"
  end
end

# Continue with default plugin
TEST "command 3"
© 2021 Kadalu Software Private Limited. All Rights Reserved.