test-tool: add test to verify SVPD page codes are in ascending order - #474
Merged
Conversation
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
marked this pull request as ready for review
June 10, 2026 16:44
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! |
Owner
|
Merged. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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