Manage Helpers
Introduction
The tester manage helpers are simple wrappers around the core management methods such
as n2svcd.management_resource_drilldown
. They provide some common pre/post-processing
to make the Lua test scripts simpler and more streamlined.
Tester REST management helper methods are accessed via the “n2.n2svcd.tester.manage” module:
local manage = require "n2.n2svcd.tester.manage"
.resource_row_instance [Asynchronous]
The resource_row_instance
method uses the n2svcd.management_resource_row
method to request
the specific target application return of a single specific resource vector row where specifically:
- The row is a row from the application’s
instances
resource, and - Additional post-processing of the
trace_log
column is performed to create awarnings
list.
The post-processing of the trace_log
involves finding all trace.warning
and trace.error
trace_log entries, and extracting the text part of the line. These are placed in to warnings
psuedo-column which can be checked for expected or unexpected warnings for the instance.
Only one single matching row is returned, rather than an array of rows.
The parameters for this method are:
Parameter | Type | Description |
---|---|---|
app_name
|
String |
[Required] The name of the application whose resource vector we are fetching. This must be a real application name, it cannot be a virtual (load-share/failover) app name. (Default = use the RestClientApp configured as "default_rest_app_name") |
instance_idx
|
String |
[Required] The instance_idx identifying the specific instance.This is the automatically assigned 8-character hexadecimal string. |
The resource_row_instance
method returns a Lua table object on success, or nil
if the
specific resource_row_instance
did not match any of the resource rows.
Example:
instance = tester_api.rest_resource_row_instance ('Logic', edr_result.instance_idx)
n2svcd.match_kpath_string (instance, 'completed', 'YES/Retain', true)
n2svcd.match_kpath_string (instance, 'warnings.[0]', nil, true)