Skip to content

test-tool: add test to verify SVPD page codes are in ascending order - #474

Merged
sahlberg merged 1 commit into
sahlberg:masterfrom
badarihp:master
Jun 10, 2026
Merged

test-tool: add test to verify SVPD page codes are in ascending order#474
sahlberg merged 1 commit into
sahlberg:masterfrom
badarihp:master

Conversation

@badarihp

Copy link
Copy Markdown
Contributor

Per SPC specification, the Supported VPD Pages (page 0x00) INQUIRY response shall return page codes in ascending order. The existing test_inquiry_supported_vpd test verifies each listed page can be read but does not validate the ordering.

Add a new test (test_inquiry_vpd_page_codes_sorted) that sends an INQUIRY for Supported VPD Pages and asserts that each page code in the response is strictly greater than the previous one. The test properly handles error paths by routing all failures through a cleanup label.

Test output

Suite: Inquiry
Test: VPDPageCodesSorted ...
2026-06-10 16:41:59.350614 Test INQUIRY Supported VPD page codes are in ascending order
2026-06-10 16:41:59.350655 Send INQUIRY for Supported VPD Pages (0x00)
2026-06-10 16:41:59.350661 Send INQUIRY (Expecting SUCCESS) evpd:1 page_code:00 alloc_len:255
2026-06-10 16:41:59.352403 [OK] INQUIRY returned SUCCESS NO SENSE(0x00) UNKNOWN(0x0000)
2026-06-10 16:41:59.352502 Verify we got at least 4 bytes of data
2026-06-10 16:41:59.352509 Verify we can unmarshall the DATA-IN buffer
2026-06-10 16:41:59.352517 Verify page codes are in ascending order (SPC requirement)
2026-06-10 16:41:59.352523 [FAILED] Page codes are not in ascending order. Page 0xb2 at index 5 is not greater than page 0xc0 at index 4
FAILED
1. test_inquiry_vpd_page_codes_sorted.c:72 - CU_FAIL("VPD page codes are not in ascending order") 2026-06-10 16:41:59.352595 Send PRIN/READ_KEYS

Run Summary: Type Total Ran Passed Failed Inactive
suites 1 1 n/a 0 0
tests 1 1 0 1 0
asserts 4 4 3 1 n/a

Elapsed time = 0.001 seconds
Tests completed with return value: 0

Per SPC specification, the Supported VPD Pages (page 0x00) INQUIRY
response shall return page codes in ascending order. The existing
test_inquiry_supported_vpd test verifies each listed page can be read
but does not validate the ordering.

Add a new test (test_inquiry_vpd_page_codes_sorted) that sends an
INQUIRY for Supported VPD Pages and asserts that each page code in the
response is strictly greater than the previous one. The test properly
handles error paths by routing all failures through a cleanup label.
@badarihp
badarihp marked this pull request as ready for review June 10, 2026 16:44
@badarihp

Copy link
Copy Markdown
Contributor Author

Hi @sahlberg ,

This PR adds a new test (VPDPageCodesSorted) that verifies the Supported VPD Pages (0x00) INQUIRY response returns page codes in ascending order, as required by SPC.

The existing test_inquiry_supported_vpd validates that each listed page is readable but doesn't check ordering. This new test fills that gap.

I've verified it catches out-of-order responses correctly against a test target.

Would appreciate your review when you get a chance. Thanks!

@sahlberg
sahlberg merged commit 65ebd14 into sahlberg:master Jun 10, 2026
1 check passed
@sahlberg

Copy link
Copy Markdown
Owner

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants