mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: unit: add negative tests for common.gr.obj_ctx
Add negative tests that inject memory allocation failures and HAL function call errors to verify error handling path in common.gr.obj_ctx unit. Update common.gr.setup test to cover invalid class input while setting preemption mode. Jira NVGPU-4457 Change-Id: I74d1ba63ba8aace6087b51fd50e2c136822d3a00 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2260939 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
34020a5999
commit
fdb8046812
@@ -318,6 +318,13 @@ int test_gr_setup_preemption_mode_errors(struct unit_module *m,
|
||||
unit_return_fail(m, "Fail Preemp_mode Error Test-2\n");
|
||||
}
|
||||
|
||||
/* Set invalid Class*/
|
||||
gr_setup_ch->obj_class = 0x1234;
|
||||
err = g->ops.gr.setup.set_preemption_mode(gr_setup_ch, 0, 0);
|
||||
if (err == 0) {
|
||||
unit_return_fail(m, "Fail Preemp_mode Error Test-2\n");
|
||||
}
|
||||
|
||||
gr_setup_ch->obj_class = class_num;
|
||||
|
||||
return UNIT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user