gpu: nvgpu: Add more test coverage for common.netlist

Add more line and branch coverage in unit test for common.netlist
unit

Jira NVGPU-4920

Change-Id: I6991a584b22b1d3724b665dc2a04a30f172d5c11
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2286762
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
vinodg
2020-01-28 17:37:28 -08:00
committed by Alex Waterman
parent f0776d26f2
commit eabba98e2a
2 changed files with 64 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -38,6 +38,14 @@
*
* Test Type: Feature
*
* Targets: nvgpu_netlist_init_ctx_vars,
* gv11b_netlist_is_firmware_defined,
* gv11b_netlist_get_name,
* nvgpu_netlist_alloc_u32_list,
* nvgpu_netlist_alloc_aiv_list,
* nvgpu_netlist_alloc_av_list,
* nvgpu_netlist_alloc_av64_list
*
* Input: None
*
* Steps:
@@ -64,6 +72,21 @@ int test_netlist_init_support(struct unit_module *m,
*
* Test Type: Feature
*
* Targets: nvgpu_netlist_get_sw_non_ctx_load_av_list,
* nvgpu_netlist_get_sw_ctx_load_aiv_list,
* nvgpu_netlist_get_sw_method_init_av_list,
* nvgpu_netlist_get_sw_bundle_init_av_list,
* nvgpu_netlist_get_sw_veid_bundle_init_av_list,
* nvgpu_netlist_get_sw_bundle64_init_av64_list,
* nvgpu_netlist_get_fecs_inst_count,
* nvgpu_netlist_get_fecs_data_count,
* nvgpu_netlist_get_gpccs_inst_count,
* nvgpu_netlist_get_gpccs_data_count,
* nvgpu_netlist_get_fecs_inst_list,
* nvgpu_netlist_get_fecs_data_list,
* nvgpu_netlist_get_gpccs_inst_list,
* nvgpu_netlist_get_gpccs_data_list
*
* Input: None
*
* Steps:
@@ -94,13 +117,17 @@ int test_netlist_query_tests(struct unit_module *m,
*
* Description: This test covers negative paths in netlist init.
*
* Test Type: Feature
* Test Type: Feature, Error Injection
*
* Targets: nvgpu_netlist_init_ctx_vars,
* nvgpu_netlist_deinit_ctx_vars
*
* Input: None
*
* Steps:
* - Call nvgpu_netlist_init_ctx_vars after already initilized netlist
* - Call nvgpu_netlist_deinit_ctx_vars
* - Call nvgpu_netlist_init_ctx_vars injecting allocation failures.
* - Set HALs with no netlist defined and invalid netlist check
* - Call nvgpu_netlist_init_ctx_vars with above test HALs
* - Restore orginals HALs
@@ -119,6 +146,8 @@ int test_netlist_negative_tests(struct unit_module *m,
*
* Test Type: Feature
*
* Targets: nvgpu_netlist_deinit_ctx_vars
*
* Input: None
*
* Steps: