gnmitest

module
Version: v0.0.0-...-6fa03d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: Apache-2.0

README

gnmitest - A Test Framework for gNMI

The gnmitest framework contains a test runner, and a set of tests to validate an implementation of the gNMI protocol. The tests are schema-aware, such that they can also validate the payload carried by gNMI - particularly, this allows compliance tests against the OpenConfig schema to be implemented.

The framework is intended to:

  1. Perform compliance tests for gNMI against the specification.
  2. Validate compliance with the OpenConfig schema.
  3. Allow augmentation to qualify a specific implementation against a set of operational requirements, such as a mandatory set of paths.

The gnmitest framework can be used as part of a wider test framework, to perform device interactions such as setting configuration, or as a validator that particular telemetry values are sent by a device in response to a particular stimulus. Currently, gnmitest does not validate the correctness of data that is returned by telemetry, or the behaviour of the device once a configuration has been applied.

Note: This is not an official Google product.

Tests in gnmitest

The tests that the framework can run are specified under the tests directory, and are organised according to the gNMI RPC that they test.

Tests that validate the behaviour of streaming telemetry implementations can be found in the subscribe directory -- for example, providing schema compliance tests for paths in received Notifications, and checks for data completeness - such as all expected entries being present in a list. As the framework is extended, additional subscription tests (value compliance with the schema, path set completeness) will be implemented within this directory.

The getsetv directory contains tests that relate to the Get and Set RPCs. Particularly, these tests allow the retrieval and manipulation of configuration on a device.

You can also learn about executing gnmitest Suite and extending gnmitest Subscribe tests.

Directories

Path Synopsis
cmd
gnmitest_cli
Package main implements command line utility to call gnmitest service API.
Package main implements command line utility to call gnmitest service API.
gnmitest_cli/common
Package common contains functions to run suite text proto and to write report proto into file.
Package common contains functions to run suite text proto and to write report proto into file.
gnmitest_demo
Package main contains implementation to start gnmitest service.
Package main contains implementation to start gnmitest service.
gnmitest_service
Package main contains an implementation of a gRPC service which can be used to execute the gNMI test framework.
Package main contains an implementation of a gRPC service which can be used to execute the gNMI test framework.
Package common defines operations that are used within the gNMITest framework for multiple tests.
Package common defines operations that are used within the gNMITest framework for multiple tests.
report
Package report contains common helpers to process report proto messages.
Package report contains common helpers to process report proto messages.
testerror
Package testerror contains List type that implements error interface.
Package testerror contains List type that implements error interface.
Package config creates a wrapper around Suite proto message.
Package config creates a wrapper around Suite proto message.
Package resolver contains a dictionary of credentials resolvers.
Package resolver contains a dictionary of credentials resolvers.
proto
Package register contains lookup table to get an instance of test.Subscribe.
Package register contains lookup table to get an instance of test.Subscribe.
Package runner has functions to be able to run given suite of tests.
Package runner has functions to be able to run given suite of tests.
Package schemafake defines a fake implementation of a gNMI device with a known schema which is used to validate tests within the gNMITest framework.
Package schemafake defines a fake implementation of a gNMI device with a known schema which is used to validate tests within the gNMITest framework.
Package schema exports functions to register given schema information into lookup table as well as to retrieve from lookup table.
Package schema exports functions to register given schema information into lookup table as well as to retrieve from lookup table.
openconfig
Package gostructs is a generated package which contains definitions of structs which represent a YANG schema.
Package gostructs is a generated package which contains definitions of structs which represent a YANG schema.
openconfig/register
Package openconfig registers generated gostructs with "openconfig" key.
Package openconfig registers generated gostructs with "openconfig" key.
Package service implements the gnmitest.proto Run service API.
Package service implements the gnmitest.proto Run service API.
Package subscribe contains test interface definitions for gnmi Subscribe RPC.
Package subscribe contains test interface definitions for gnmi Subscribe RPC.
tests
getsetv
Package getsetv defines the logic that implements the GetSetValidate tests for the gnmitest framework.
Package getsetv defines the logic that implements the GetSetValidate tests for the gnmitest framework.
subscribe/datatreepaths
Package datatreepaths implements a test which can check the contents of the data tree for particular path.
Package datatreepaths implements a test which can check the contents of the data tree for particular path.
subscribe/gnmipathc
Package gnmipathc tests whether received SubscribeResponse messages has a gNMI Path format in accordance with the specification.
Package gnmipathc tests whether received SubscribeResponse messages has a gNMI Path format in accordance with the specification.
subscribe/haskeys
Package haskeys runs a test that checks that a particular list within the OpenConfig schema has a set of specified keys.
Package haskeys runs a test that checks that a particular list within the OpenConfig schema has a set of specified keys.
subscribe/pathvalidation
Package pathvalidation implements subscribe.Test interface and registers factory function to registry.
Package pathvalidation implements subscribe.Test interface and registers factory function to registry.
subscribe/schemapathc
Package schemapathc runs a test in the gnmitest framework that checks for the presence of at least one gNMI Notification with each of the specified YANG schema paths.
Package schemapathc runs a test in the gnmitest framework that checks for the presence of at least one gNMI Notification with each of the specified YANG schema paths.
subscribe/valuevalidation
Package valuevalidation contains gnmitest test that attempts to unmarshal received SubscribeResponse updates into GoStruct.
Package valuevalidation contains gnmitest test that attempts to unmarshal received SubscribeResponse updates into GoStruct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL