Skip to content

Commit a120cfa

Browse files
author
Subrahmanya Lingappa
committed
test: expand BASE service group coverage
Add BASE probe coverage for unregistered, experimental, and vendor service group IDs, plus an invalid BASE service ID case. This complements the existing positive BASE service tests and relies on the shared harness ACK header checks to verify token, service group, and service ID mirroring for normal requests. Signed-off-by: Subrahmanya Lingappa <subrahmanya.lingappa@qti.qualcomm.com>
1 parent cef0d66 commit a120cfa

1 file changed

Lines changed: 75 additions & 1 deletion

File tree

test/test_srvgrp_base.c

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,27 @@ static rpmi_uint32_t probe_expdata_default[] = {
5050
RPMI_BASE_VERSION(1, 0),
5151
};
5252

53+
static rpmi_uint32_t probe_sysreset_reqdata_default[] = {
54+
RPMI_SRVGRP_SYSTEM_RESET,
55+
};
56+
57+
static rpmi_uint32_t probe_unsupported_expdata_default[] = {
58+
RPMI_SUCCESS,
59+
0,
60+
};
61+
62+
static rpmi_uint32_t probe_experimental_reqdata_default[] = {
63+
RPMI_SRVGRP_EXPERIMENTAL_START,
64+
};
65+
66+
static rpmi_uint32_t probe_vendor_reqdata_default[] = {
67+
RPMI_SRVGRP_VENDOR_START,
68+
};
69+
70+
static rpmi_uint32_t invalid_service_expdata_default[] = {
71+
RPMI_ERR_NOTSUPP,
72+
};
73+
5374
static rpmi_uint32_t attribs_expdata_default[] = {
5475
RPMI_SUCCESS,
5576
RPMI_BASE_FLAGS_F0_PRIVILEGE,
@@ -70,7 +91,7 @@ static struct rpmi_test_scenario scenario_base_default = {
7091
.init = test_scenario_default_init,
7192
.cleanup = test_scenario_default_cleanup,
7293

73-
.num_tests = 7,
94+
.num_tests = 11,
7495
.tests = {
7596
{
7697
.name = "RPMI_BASE_SRV_ENABLE_NOTIFICATION",
@@ -141,6 +162,59 @@ static struct rpmi_test_scenario scenario_base_default = {
141162
.init_request_data = test_init_request_data_from_attrs,
142163
.init_expected_data = test_init_expected_data_from_attrs,
143164
},
165+
{
166+
.name = "RPMI_BASE_SRV_PROBE_SERVICE_GROUP unsupported",
167+
.attrs = {
168+
.servicegroup_id = RPMI_SRVGRP_BASE,
169+
.service_id = RPMI_BASE_SRV_PROBE_SERVICE_GROUP,
170+
.flags = RPMI_MSG_NORMAL_REQUEST,
171+
.request_data = probe_sysreset_reqdata_default,
172+
.request_data_len = sizeof(probe_sysreset_reqdata_default),
173+
.expected_data = probe_unsupported_expdata_default,
174+
.expected_data_len = sizeof(probe_unsupported_expdata_default),
175+
},
176+
.init_request_data = test_init_request_data_from_attrs,
177+
.init_expected_data = test_init_expected_data_from_attrs,
178+
},
179+
{
180+
.name = "RPMI_BASE_SRV_PROBE_SERVICE_GROUP experimental",
181+
.attrs = {
182+
.servicegroup_id = RPMI_SRVGRP_BASE,
183+
.service_id = RPMI_BASE_SRV_PROBE_SERVICE_GROUP,
184+
.flags = RPMI_MSG_NORMAL_REQUEST,
185+
.request_data = probe_experimental_reqdata_default,
186+
.request_data_len = sizeof(probe_experimental_reqdata_default),
187+
.expected_data = probe_unsupported_expdata_default,
188+
.expected_data_len = sizeof(probe_unsupported_expdata_default),
189+
},
190+
.init_request_data = test_init_request_data_from_attrs,
191+
.init_expected_data = test_init_expected_data_from_attrs,
192+
},
193+
{
194+
.name = "RPMI_BASE_SRV_PROBE_SERVICE_GROUP vendor",
195+
.attrs = {
196+
.servicegroup_id = RPMI_SRVGRP_BASE,
197+
.service_id = RPMI_BASE_SRV_PROBE_SERVICE_GROUP,
198+
.flags = RPMI_MSG_NORMAL_REQUEST,
199+
.request_data = probe_vendor_reqdata_default,
200+
.request_data_len = sizeof(probe_vendor_reqdata_default),
201+
.expected_data = probe_unsupported_expdata_default,
202+
.expected_data_len = sizeof(probe_unsupported_expdata_default),
203+
},
204+
.init_request_data = test_init_request_data_from_attrs,
205+
.init_expected_data = test_init_expected_data_from_attrs,
206+
},
207+
{
208+
.name = "RPMI_BASE invalid service",
209+
.attrs = {
210+
.servicegroup_id = RPMI_SRVGRP_BASE,
211+
.service_id = RPMI_BASE_SRV_ID_MAX,
212+
.flags = RPMI_MSG_NORMAL_REQUEST,
213+
.expected_data = invalid_service_expdata_default,
214+
.expected_data_len = sizeof(invalid_service_expdata_default),
215+
},
216+
.init_expected_data = test_init_expected_data_from_attrs,
217+
},
144218
{
145219
.name = "RPMI_BASE_SRV_GET_ATTRIBUTES",
146220
.attrs = {

0 commit comments

Comments
 (0)