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:
Deepak Nibade
2019-12-04 19:32:51 +05:30
committed by Alex Waterman
parent 34020a5999
commit fdb8046812
15 changed files with 707 additions and 0 deletions

View File

@@ -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;