module yumaworks-unit-test { namespace "http://yumaworks.com/ns/yumaworks-unit-test"; prefix "ut"; import yuma-types { prefix yt; } import yumaworks-extensions { prefix ywx; } organization "YumaWorks, Inc."; contact "Support "; description "This module contains data structures representing server unit tests for specific use cases and YANG modules +---------------------+ +-+------------------+ | | | | | Unit Test Suite | | | |--+ +--------------------+ | | | | | V | +---------------------+ | +-+------------------+ | | | | | | | Unit Test | | | | |--+ | +--------------------+ | | | | | V | +---------------------+ | +-+------------------+ | | | | | | | Step | | | | |--+ | +--------------------+ | V +---------------------+ +-+------------------+ | | | | | Servers | | | |--+ +--------------------+ | | V +---------------------+ +-+------------------+ | | | | | Sessions | | | |--+ +--------------------+ "; revision 2013-01-21 { description "Initial version"; } typedef response-type { type enumeration { enum none { description "Local command, no expected."; } enum ok { description "Expecting the reply."; } enum data { description "Expecting a data reply."; } enum error { description "Expecting an rpc-error reply."; } } description "The type of response expected from the server for this request."; } typedef data-response-type { type enumeration { enum any-data { description "Any type of data reponse is acceptable."; } enum data-empty { description "Expecting an empty element in the reply."; } enum data-non-empty { description "Expecting a non-empty element in the reply."; } enum data-match { description "Expecting a data reply to match the saved data element."; } } description "The type of data response expected from the server for this request, when response-type=data."; } container unit-test { presence "If this node is present then the unit-test service is enabled."; list test-suite { description "A list of test-suites all run against a single server."; key name; leaf name { type yt:NcxName; description "The test suite name."; } leaf description { type string; description "Description of this test suite."; } container setup { ywx:cli-text-block; description "Test suite setup commands"; } container cleanup { ywx:cli-text-block; description "Test suite cleanup commands"; } leaf-list run-test { ordered-by user; type yt:NcxName; min-elements 1; description "The ordered list of test names to run in this test suite. At least 1 test must be specified."; } list test { description "The unit-tests that are configured to be run. At least 1 test must be configured."; ordered-by user; min-elements 1; key name; leaf name { type yt:NcxName; description "The name of this unit test."; } leaf description { type string; description "Description of this unit test."; } leaf-list must-pass { type yt:NcxName; description "The names of the tests that have already been run and pased for this test to be attempted, The test will be skipped if any test in the must-pass list has been attempted and the test failed. If the named test has not been run yet this test will fail and be skipped. If the named test was skipped, then it will not cause this test to be skipped, only if it did not run at all or if it ran and passed."; } list step { description "A list of test steps to be done in order."; ordered-by user; key name; leaf name { type string { length "1 .. 64"; } description "The name of this unit test step."; } leaf description { type string; description "Description of this unit test step."; } leaf session-name { type yt:NcxName; description "The name of the session to use. Empty if the test session should be used"; } leaf result-type { type response-type; description "The expected response type. If this leaf is missing then any response type is acceptable."; } leaf result-error-tag { when "../result-type = 'error'"; type string; description "The error-tag value expected if the result-type is 'error'. If not set, then any error-tag value is acceptable."; } leaf result-error-apptag { when "../result-type = 'error'"; type string; description "The error-app-tag value expected if the result-type is 'error'. If not set, then any error-app-tag value is acceptable."; } leaf-list result-error-info { when "../result-type = 'error'"; type yt:NcxName; description "The error-info element name expected if the result-type is 'error'."; } leaf result-data-type { when "../result-type = 'data'"; type data-response-type; description "The expected data response type. If this leaf is missing then any data response type is acceptable."; } leaf command { type string; mandatory true; description "The yangcli command line string to use"; } anyxml rpc-reply-data { when "../result-data-type = 'data-match'"; description "The contents of element that are expected to be returned in the reply. This element itself represents and any child nodes are the nodes returned by the server."; } } // list step } // list test } // list test-suite } // container unit-test }