linux/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c

// SPDX-License-Identifier: BSD-3-Clause
/* Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries.
 * Microchip VCAP API kunit test suite
 */

#include <kunit/test.h>
#include "vcap_api.h"
#include "vcap_api_client.h"
#include "vcap_api_debugfs.h"
#include "vcap_model_kunit.h"

/* First we have the test infrastructure that emulates the platform
 * implementation
 */
#define TEST_BUF_CNT
#define TEST_BUF_SZ
#define STREAMWSIZE

static u32 test_updateaddr[STREAMWSIZE] =;
static int test_updateaddridx;
static int test_cache_erase_count;
static u32 test_init_start;
static u32 test_init_count;
static u32 test_hw_counter_id;
static struct vcap_cache_data test_hw_cache;
static struct net_device test_netdev =;
static int test_move_addr;
static int test_move_offset;
static int test_move_count;
static char test_pr_buffer[TEST_BUF_CNT][TEST_BUF_SZ];
static int test_pr_bufferidx;
static int test_pr_idx;

/* Callback used by the VCAP API */
static enum vcap_keyfield_set test_val_keyset(struct net_device *ndev,
					      struct vcap_admin *admin,
					      struct vcap_rule *rule,
					      struct vcap_keyset_list *kslist,
					      u16 l3_proto)
{}

/* Callback used by the VCAP API */
static void test_add_def_fields(struct net_device *ndev,
				struct vcap_admin *admin,
				struct vcap_rule *rule)
{}

/* Callback used by the VCAP API */
static void test_cache_erase(struct vcap_admin *admin)
{}

/* Callback used by the VCAP API */
static void test_cache_init(struct net_device *ndev, struct vcap_admin *admin,
			    u32 start, u32 count)
{}

/* Callback used by the VCAP API */
static void test_cache_read(struct net_device *ndev, struct vcap_admin *admin,
			    enum vcap_selection sel, u32 start, u32 count)
{}

/* Callback used by the VCAP API */
static void test_cache_write(struct net_device *ndev, struct vcap_admin *admin,
			     enum vcap_selection sel, u32 start, u32 count)
{}

/* Callback used by the VCAP API */
static void test_cache_update(struct net_device *ndev, struct vcap_admin *admin,
			      enum vcap_command cmd,
			      enum vcap_selection sel, u32 addr)
{}

static void test_cache_move(struct net_device *ndev, struct vcap_admin *admin,
			    u32 addr, int offset, int count)
{}

/* Provide port information via a callback interface */
static int vcap_test_port_info(struct net_device *ndev,
			       struct vcap_admin *admin,
			       struct vcap_output_print *out)
{}

static const struct vcap_operations test_callbacks =;

static struct vcap_control test_vctrl =;

static void vcap_test_api_init(struct vcap_admin *admin)
{}

/* callback used by the show_admin function */
static __printf(2, 3)
int test_prf(void *out, const char *fmt, ...)
{}

/* Define the test cases. */

static void vcap_api_addr_keyset_test(struct kunit *test)
{}

static void vcap_api_show_admin_raw_test(struct kunit *test)
{}

static const char * const test_admin_info_expect[] =;

static void vcap_api_show_admin_test(struct kunit *test)
{}

static const char * const test_admin_expect[] =;

static void vcap_api_show_admin_rule_test(struct kunit *test)
{}

static struct kunit_case vcap_api_debugfs_test_cases[] =;

static struct kunit_suite vcap_api_debugfs_test_suite =;

kunit_test_suite();