Tester Guide

/ binnacle / devel / syntax/


Test starts with an Binnacle keyword TEST, EXPECT, TRUE etc. The command should be written in quotes. For example,

TEST "stat ~/.ssh/"

If a test expects a different return code other than 0, then

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


Use # for writing comments.

# This is comment
TEST "echo Hello"


Arguments to Binnacle keywords are separated using ,(comma).

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

Using Variables

Binnacle supports Ruby style variables, for example

kubectl = "microk8s.kubectl"

TEST "#{kubectl} get pods"

Capturing the output of a command

Easily capture the output of a command and use that value for validating the output. For example,

hostname = TEST "hostname"
TRUE hostname == "", " hostname test", "Actual: #{hostname}"

Block Syntax

Some keywords allows to limit the execution only within a block. Block starts with do and ends with end keyword. For example, the tests within the Block are executed in

# Executes in Local node
TEST "echo Hello"

USE_NODE "" do
  TEST "echo Hello"

# Again in local node
TEST "echo Hello"

Running tests in loop

Binnacle supports using list of values and run the tests in loop. Please note, It will lead to undefined behaviour if the list of items is dependent on previous tests.

nodes = ["", "", ""]

nodes.each do |node|
  # Set node
  USE_NODE node

  # Validate the hostname set properly
  EXPECT node, "hostname"

Loop syntax is same as in Ruby.

© 2021 Kadalu Software Private Limited. All Rights Reserved.