This directory contains multiple .cdlang files that contain gNMI test scenarios.
To build and execute those tests you should execute:
bazel run //stratum/testing/scenarios:scenarios_test
This command will trigger the following actions:
-
Compilation of the cdl_tool from the //stratum/testing/cdlang directory (if not present)
-
Compilation of all .cdlang files
-
Generation of //bazel-genfiles/stratum/testing/scenarios/scenarios.cc that implements the tests defined in the .cdlang files
-
Compilation of bazel-genfiles/stratum/testing/scenarios/scenarios.cc
-
Compilation of required libraries (like implementation of gNMI protobufs)
-
Linkage of the pieces into one executable: sceanrios_test
-
Execution of the scearios_test executable that will run the scenarios against a gNMI server that is reachable at
localhost:9339
.
If the gNMI server is not located on the same host, its address should be
provided by using the --gnmi_url
option. For example:
bazel run //stratum/testing/scenarios:scenarios_test -- --gnmi_url bmv2.company:9339
-
BUILD - the bazel build file
-
README.md - this file
-
test_main.cc - the main test file that contains the
main()
function -
scenarios.cc.tmpl and lib.cc.tmpl - Golang text template files used to generate C++ code implementig the scenarios
Just create new gNMI test scenarios and put them into separate .cdlang files.
That's it. Nothing else needs to be touched and/or modified!