Route table check tool
The following configuration is for the route table check tool only and is not part of the Envoy binary. The route table check tool is a standalone binary that can be used to verify Envoy’s routing for a given configuration file.
The following specifies input to the route table check tool. The route table check tool checks if the route returned by a router matches what is expected. The tool can be used to check cluster name, virtual cluster name, virtual host name, manual path rewrite, manual host rewrite, path redirect, and header field matches. Extensions for other test cases can be added. Details about installing the tool and sample tool input/output can be found at .
The route table check tool config is composed of an array of json test objects. Each test object is composed of three parts.
Test name
This field specifies the name of each test object.
Input values
The input value fields specify the parameters to be passed to the router. Example input fields include the :authority, :path, and :method header fields. The :authority and :path fields specify the url sent to the router and are required. All other input fields are optional.
Validate
The validate fields specify the expected values and test cases to check. At least one test case is required.
A simple tool configuration json has one test case and is written as follows. The test expects a cluster name match of “instant-server”.:
test_name
(required, string) The name of a test object.
input
(required, object) Input values sent to the router that determine the returned route.
validate
(required, object) The validate object specifies the returned route parameters to match. At least one test parameter must be specified. Use “” (empty string) to indicate that no return value is expected. For example, to test that no cluster match is expected use {“cluster_name”: “”}.
The router check tool will report route coverage at the end of a successful test run.
This reporting can be leveraged to enforce a minimum coverage percentage by using the -f or –fail-under flag. If coverage falls below this percentage the test run will fail.