aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-05-08 19:18:18 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-05-09 20:08:58 +0000
commit7d31ab2a5cc2124ddd973ac5dfac2219619f345a (patch)
treec348cd84cf2c4edc0bb73890830ed2bc280117bf /src/vpp/vnet
parent016d4cc327f1980605db7a9e436597e8f36fe9ed (diff)
add mactime plugin unit / code coverage tests
The unit and code coverage tests are boring. The rest of the patch involves test and packet-generator infra cleanups. Teach the "make test-xxx" family of targets to set the api test plugin path correctly, to make "binary-api <api-message-name> <args>" debug CLI commands work correctly in the "make test" environment. Unfortunately involves both the top-level and test Makefiles. Add a minor pg cli feature, a CLI to manually set s->sw_if_index[VLIB_TX]. Consider the case where one configures an interface with both a device-input and an output feature. To test the output feature using the pg, it's necessary to inject packets into the interface output node with both b->sw_if_index[VLIB_TX] and b->sw_if_index[VLIB_RX] set correctly. For example: packet-generator new { name tx limit 15 size 128-128 interface local0 # rx: device input feature not configured on local0 tx-interface loop0 # tx: output node requires b->sw_if_index[VLIB_TX] node loop0-output data { hex 0x01005e7ffffa000dead0000008000102030405060708090a0b0c0d0e0f0102030405 } } Fix a longstanding bug in the packet generator stream setup. Remove kludges which set b->sw_if_index[VLIB_TX] to ~0 [in multiple places] instead of using the stream value s->sw_if_index[VLIB_TX], and setting THAT datum correctly. Change-Id: I1097a18e8db73661ded6b822c1d718f7e5cf36ed Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vpp/vnet')
-rw-r--r--src/vpp/vnet/main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
index 6819ae6a3a4..5100d5c79b8 100644
--- a/src/vpp/vnet/main.c
+++ b/src/vpp/vnet/main.c
@@ -31,6 +31,7 @@
*/
char *vlib_plugin_path = NULL;
char *vlib_plugin_app_version = VPP_BUILD_VER;
+char *vat_plugin_path = NULL;
static void
vpp_find_plugin_path ()
@@ -219,6 +220,11 @@ main (int argc, char *argv[])
if (i < (argc - 1))
vlib_plugin_path = argv[++i];
}
+ if (!strncmp (argv[i], "test_plugin_path", 16))
+ {
+ if (i < (argc - 1))
+ vat_plugin_path = argv[++i];
+ }
else if (!strncmp (argv[i], "heapsize", 8))
{
sizep = (u8 *) argv[i + 1];
@@ -304,7 +310,7 @@ heapsize_config (vlib_main_t * vm, unformat_input_t * input)
VLIB_CONFIG_FUNCTION (heapsize_config, "heapsize");
static clib_error_t *
-plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
+dummy_path_config (vlib_main_t * vm, unformat_input_t * input)
{
u8 *junk;
@@ -322,8 +328,22 @@ plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
return 0;
}
+static clib_error_t *
+plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
+{
+ return dummy_path_config (vm, input);
+}
+
VLIB_CONFIG_FUNCTION (plugin_path_config, "plugin_path");
+static clib_error_t *
+test_plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
+{
+ return dummy_path_config (vm, input);
+}
+
+VLIB_CONFIG_FUNCTION (test_plugin_path_config, "test_plugin_path");
+
void vl_msg_api_post_mortem_dump (void);
void elog_post_mortem_dump (void);