Commit 67d63751 authored by Steen Hegelund's avatar Steen Hegelund Committed by David S. Miller

net: microchip: sparx5: Adding KUNIT test for the VCAP API

This provides a KUNIT test suite for the VCAP APIs encoding functionality.

The test can be run by adding these settings in a .kunitconfig file

CONFIG_KUNIT=y
CONFIG_NET=y
CONFIG_VCAP_KUNIT_TEST=y
Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d7e5b04
......@@ -36,4 +36,17 @@ config VCAP
characteristics. Look in the datasheet for the VCAP specifications for the
specific switchcore.
config VCAP_KUNIT_TEST
bool "KUnit test for VCAP library" if !KUNIT_ALL_TESTS
depends on KUNIT
depends on KUNIT=y && VCAP=y && y
default KUNIT_ALL_TESTS
help
This builds unit tests for the VCAP library.
For more information on KUnit and unit tests in general, please refer
to the KUnit documentation in Documentation/dev-tools/kunit/.
If unsure, say N.
endif # NET_VENDOR_MICROCHIP
This diff is collapsed.
......@@ -1178,3 +1178,7 @@ void vcap_set_tc_exterr(struct flow_cls_offload *fco, struct vcap_rule *vrule)
}
}
EXPORT_SYMBOL_GPL(vcap_set_tc_exterr);
#ifdef CONFIG_VCAP_KUNIT_TEST
#include "vcap_api_kunit.c"
#endif
......@@ -11,6 +11,9 @@
#include <linux/netdevice.h>
/* Use the generated API model */
#ifdef CONFIG_VCAP_KUNIT_TEST
#include "vcap_ag_api_kunit.h"
#endif
#include "vcap_ag_api.h"
#define VCAP_CID_LOOKUP_SIZE 100000 /* Chains in a lookup */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment