Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for nvme_id_ns_flbas_to_lbaf_inuse() #808

Conversation

benchuanggli
Copy link
Contributor

Add unit test for nvme_id_ns_flbas_to_lbaf_inuse().
The test case for flbas[6:0] range from 0x00~0x7F.
I put the test data into the code, but it could be generated by a script.
Please tell me if you have any comments.

Thank you for reading.


And below is some logs for pass and fail.
--FAIL--

flbas = 00h, inuse = 00h (expect = 00h) [PASS]
flbas = 01h, inuse = 01h (expect = 01h) [PASS]
flbas = 02h, inuse = 02h (expect = 02h) [PASS]
flbas = 03h, inuse = 03h (expect = 03h) [PASS]
flbas = 04h, inuse = 04h (expect = 04h) [PASS]
flbas = 05h, inuse = 05h (expect = 05h) [PASS]
flbas = 06h, inuse = 06h (expect = 06h) [PASS]
flbas = 07h, inuse = 07h (expect = 07h) [PASS]
flbas = 08h, inuse = 08h (expect = 08h) [PASS]
flbas = 09h, inuse = 09h (expect = 09h) [PASS]
flbas = 0ah, inuse = 0ah (expect = 0ah) [PASS]
flbas = 0bh, inuse = 0bh (expect = 0bh) [PASS]
flbas = 0ch, inuse = 0ch (expect = 0ch) [PASS]
flbas = 0dh, inuse = 0dh (expect = 0dh) [PASS]
flbas = 0eh, inuse = 0eh (expect = 0eh) [PASS]
flbas = 0fh, inuse = 0fh (expect = 0fh) [PASS]
flbas = 10h, inuse = 00h (expect = 00h) [PASS]
flbas = 11h, inuse = 01h (expect = 01h) [PASS]
flbas = 12h, inuse = 02h (expect = 02h) [PASS]
flbas = 13h, inuse = 03h (expect = 03h) [PASS]
flbas = 14h, inuse = 04h (expect = 04h) [PASS]
flbas = 15h, inuse = 05h (expect = 05h) [PASS]
flbas = 16h, inuse = 06h (expect = 06h) [PASS]
flbas = 17h, inuse = 07h (expect = 07h) [PASS]
flbas = 18h, inuse = 08h (expect = 08h) [PASS]
flbas = 19h, inuse = 09h (expect = 09h) [PASS]
flbas = 1ah, inuse = 0ah (expect = 0ah) [PASS]
flbas = 1bh, inuse = 0bh (expect = 0bh) [PASS]
flbas = 1ch, inuse = 0ch (expect = 0ch) [PASS]
flbas = 1dh, inuse = 0dh (expect = 0dh) [PASS]
flbas = 1eh, inuse = 0eh (expect = 0eh) [PASS]
flbas = 1fh, inuse = 0fh (expect = 0fh) [PASS]
flbas = 20h, inuse = 00h (expect = 10h) [FAIL]
flbas = 21h, inuse = 01h (expect = 11h) [FAIL]
flbas = 22h, inuse = 02h (expect = 12h) [FAIL]
flbas = 23h, inuse = 03h (expect = 13h) [FAIL]
flbas = 24h, inuse = 04h (expect = 14h) [FAIL]
flbas = 25h, inuse = 05h (expect = 15h) [FAIL]
flbas = 26h, inuse = 06h (expect = 16h) [FAIL]
flbas = 27h, inuse = 07h (expect = 17h) [FAIL]
flbas = 28h, inuse = 08h (expect = 18h) [FAIL]
flbas = 29h, inuse = 09h (expect = 19h) [FAIL]
flbas = 2ah, inuse = 0ah (expect = 1ah) [FAIL]
flbas = 2bh, inuse = 0bh (expect = 1bh) [FAIL]
flbas = 2ch, inuse = 0ch (expect = 1ch) [FAIL]
flbas = 2dh, inuse = 0dh (expect = 1dh) [FAIL]
flbas = 2eh, inuse = 0eh (expect = 1eh) [FAIL]
flbas = 2fh, inuse = 0fh (expect = 1fh) [FAIL]
flbas = 30h, inuse = 00h (expect = 10h) [FAIL]
flbas = 31h, inuse = 01h (expect = 11h) [FAIL]
flbas = 32h, inuse = 02h (expect = 12h) [FAIL]
flbas = 33h, inuse = 03h (expect = 13h) [FAIL]
flbas = 34h, inuse = 04h (expect = 14h) [FAIL]
flbas = 35h, inuse = 05h (expect = 15h) [FAIL]
flbas = 36h, inuse = 06h (expect = 16h) [FAIL]
flbas = 37h, inuse = 07h (expect = 17h) [FAIL]
flbas = 38h, inuse = 08h (expect = 18h) [FAIL]
flbas = 39h, inuse = 09h (expect = 19h) [FAIL]
flbas = 3ah, inuse = 0ah (expect = 1ah) [FAIL]
flbas = 3bh, inuse = 0bh (expect = 1bh) [FAIL]
flbas = 3ch, inuse = 0ch (expect = 1ch) [FAIL]
flbas = 3dh, inuse = 0dh (expect = 1dh) [FAIL]
flbas = 3eh, inuse = 0eh (expect = 1eh) [FAIL]
flbas = 3fh, inuse = 0fh (expect = 1fh) [FAIL]
flbas = 40h, inuse = 01h (expect = 20h) [FAIL]
flbas = 41h, inuse = 01h (expect = 21h) [FAIL]
flbas = 42h, inuse = 03h (expect = 22h) [FAIL]
flbas = 43h, inuse = 03h (expect = 23h) [FAIL]
flbas = 44h, inuse = 05h (expect = 24h) [FAIL]
flbas = 45h, inuse = 05h (expect = 25h) [FAIL]
flbas = 46h, inuse = 07h (expect = 26h) [FAIL]
flbas = 47h, inuse = 07h (expect = 27h) [FAIL]
flbas = 48h, inuse = 09h (expect = 28h) [FAIL]
flbas = 49h, inuse = 09h (expect = 29h) [FAIL]
flbas = 4ah, inuse = 0bh (expect = 2ah) [FAIL]
flbas = 4bh, inuse = 0bh (expect = 2bh) [FAIL]
flbas = 4ch, inuse = 0dh (expect = 2ch) [FAIL]
flbas = 4dh, inuse = 0dh (expect = 2dh) [FAIL]
flbas = 4eh, inuse = 0fh (expect = 2eh) [FAIL]
flbas = 4fh, inuse = 0fh (expect = 2fh) [FAIL]
flbas = 50h, inuse = 01h (expect = 20h) [FAIL]
flbas = 51h, inuse = 01h (expect = 21h) [FAIL]
flbas = 52h, inuse = 03h (expect = 22h) [FAIL]
flbas = 53h, inuse = 03h (expect = 23h) [FAIL]
flbas = 54h, inuse = 05h (expect = 24h) [FAIL]
flbas = 55h, inuse = 05h (expect = 25h) [FAIL]
flbas = 56h, inuse = 07h (expect = 26h) [FAIL]
flbas = 57h, inuse = 07h (expect = 27h) [FAIL]
flbas = 58h, inuse = 09h (expect = 28h) [FAIL]
flbas = 59h, inuse = 09h (expect = 29h) [FAIL]
flbas = 5ah, inuse = 0bh (expect = 2ah) [FAIL]
flbas = 5bh, inuse = 0bh (expect = 2bh) [FAIL]
flbas = 5ch, inuse = 0dh (expect = 2ch) [FAIL]
flbas = 5dh, inuse = 0dh (expect = 2dh) [FAIL]
flbas = 5eh, inuse = 0fh (expect = 2eh) [FAIL]
flbas = 5fh, inuse = 0fh (expect = 2fh) [FAIL]
flbas = 60h, inuse = 01h (expect = 30h) [FAIL]
flbas = 61h, inuse = 01h (expect = 31h) [FAIL]
flbas = 62h, inuse = 03h (expect = 32h) [FAIL]
flbas = 63h, inuse = 03h (expect = 33h) [FAIL]
flbas = 64h, inuse = 05h (expect = 34h) [FAIL]
flbas = 65h, inuse = 05h (expect = 35h) [FAIL]
flbas = 66h, inuse = 07h (expect = 36h) [FAIL]
flbas = 67h, inuse = 07h (expect = 37h) [FAIL]
flbas = 68h, inuse = 09h (expect = 38h) [FAIL]
flbas = 69h, inuse = 09h (expect = 39h) [FAIL]
flbas = 6ah, inuse = 0bh (expect = 3ah) [FAIL]
flbas = 6bh, inuse = 0bh (expect = 3bh) [FAIL]
flbas = 6ch, inuse = 0dh (expect = 3ch) [FAIL]
flbas = 6dh, inuse = 0dh (expect = 3dh) [FAIL]
flbas = 6eh, inuse = 0fh (expect = 3eh) [FAIL]
flbas = 6fh, inuse = 0fh (expect = 3fh) [FAIL]
flbas = 70h, inuse = 01h (expect = 30h) [FAIL]
flbas = 71h, inuse = 01h (expect = 31h) [FAIL]
flbas = 72h, inuse = 03h (expect = 32h) [FAIL]
flbas = 73h, inuse = 03h (expect = 33h) [FAIL]
flbas = 74h, inuse = 05h (expect = 34h) [FAIL]
flbas = 75h, inuse = 05h (expect = 35h) [FAIL]
flbas = 76h, inuse = 07h (expect = 36h) [FAIL]
flbas = 77h, inuse = 07h (expect = 37h) [FAIL]
flbas = 78h, inuse = 09h (expect = 38h) [FAIL]
flbas = 79h, inuse = 09h (expect = 39h) [FAIL]
flbas = 7ah, inuse = 0bh (expect = 3ah) [FAIL]
flbas = 7bh, inuse = 0bh (expect = 3bh) [FAIL]
flbas = 7ch, inuse = 0dh (expect = 3ch) [FAIL]
flbas = 7dh, inuse = 0dh (expect = 3dh) [FAIL]
flbas = 7eh, inuse = 0fh (expect = 3eh) [FAIL]
flbas = 7fh, inuse = 0fh (expect = 3fh) [FAIL]
nvme_id_ns_flbas_to_lbaf_inuse() [FAIL]

--PASS--

flbas = 00h, inuse = 00h (expect = 00h) [PASS]
flbas = 01h, inuse = 01h (expect = 01h) [PASS]
flbas = 02h, inuse = 02h (expect = 02h) [PASS]
flbas = 03h, inuse = 03h (expect = 03h) [PASS]
flbas = 04h, inuse = 04h (expect = 04h) [PASS]
flbas = 05h, inuse = 05h (expect = 05h) [PASS]
flbas = 06h, inuse = 06h (expect = 06h) [PASS]
flbas = 07h, inuse = 07h (expect = 07h) [PASS]
flbas = 08h, inuse = 08h (expect = 08h) [PASS]
flbas = 09h, inuse = 09h (expect = 09h) [PASS]
flbas = 0ah, inuse = 0ah (expect = 0ah) [PASS]
flbas = 0bh, inuse = 0bh (expect = 0bh) [PASS]
flbas = 0ch, inuse = 0ch (expect = 0ch) [PASS]
flbas = 0dh, inuse = 0dh (expect = 0dh) [PASS]
flbas = 0eh, inuse = 0eh (expect = 0eh) [PASS]
flbas = 0fh, inuse = 0fh (expect = 0fh) [PASS]
flbas = 10h, inuse = 00h (expect = 00h) [PASS]
flbas = 11h, inuse = 01h (expect = 01h) [PASS]
flbas = 12h, inuse = 02h (expect = 02h) [PASS]
flbas = 13h, inuse = 03h (expect = 03h) [PASS]
flbas = 14h, inuse = 04h (expect = 04h) [PASS]
flbas = 15h, inuse = 05h (expect = 05h) [PASS]
flbas = 16h, inuse = 06h (expect = 06h) [PASS]
flbas = 17h, inuse = 07h (expect = 07h) [PASS]
flbas = 18h, inuse = 08h (expect = 08h) [PASS]
flbas = 19h, inuse = 09h (expect = 09h) [PASS]
flbas = 1ah, inuse = 0ah (expect = 0ah) [PASS]
flbas = 1bh, inuse = 0bh (expect = 0bh) [PASS]
flbas = 1ch, inuse = 0ch (expect = 0ch) [PASS]
flbas = 1dh, inuse = 0dh (expect = 0dh) [PASS]
flbas = 1eh, inuse = 0eh (expect = 0eh) [PASS]
flbas = 1fh, inuse = 0fh (expect = 0fh) [PASS]
flbas = 20h, inuse = 10h (expect = 10h) [PASS]
flbas = 21h, inuse = 11h (expect = 11h) [PASS]
flbas = 22h, inuse = 12h (expect = 12h) [PASS]
flbas = 23h, inuse = 13h (expect = 13h) [PASS]
flbas = 24h, inuse = 14h (expect = 14h) [PASS]
flbas = 25h, inuse = 15h (expect = 15h) [PASS]
flbas = 26h, inuse = 16h (expect = 16h) [PASS]
flbas = 27h, inuse = 17h (expect = 17h) [PASS]
flbas = 28h, inuse = 18h (expect = 18h) [PASS]
flbas = 29h, inuse = 19h (expect = 19h) [PASS]
flbas = 2ah, inuse = 1ah (expect = 1ah) [PASS]
flbas = 2bh, inuse = 1bh (expect = 1bh) [PASS]
flbas = 2ch, inuse = 1ch (expect = 1ch) [PASS]
flbas = 2dh, inuse = 1dh (expect = 1dh) [PASS]
flbas = 2eh, inuse = 1eh (expect = 1eh) [PASS]
flbas = 2fh, inuse = 1fh (expect = 1fh) [PASS]
flbas = 30h, inuse = 10h (expect = 10h) [PASS]
flbas = 31h, inuse = 11h (expect = 11h) [PASS]
flbas = 32h, inuse = 12h (expect = 12h) [PASS]
flbas = 33h, inuse = 13h (expect = 13h) [PASS]
flbas = 34h, inuse = 14h (expect = 14h) [PASS]
flbas = 35h, inuse = 15h (expect = 15h) [PASS]
flbas = 36h, inuse = 16h (expect = 16h) [PASS]
flbas = 37h, inuse = 17h (expect = 17h) [PASS]
flbas = 38h, inuse = 18h (expect = 18h) [PASS]
flbas = 39h, inuse = 19h (expect = 19h) [PASS]
flbas = 3ah, inuse = 1ah (expect = 1ah) [PASS]
flbas = 3bh, inuse = 1bh (expect = 1bh) [PASS]
flbas = 3ch, inuse = 1ch (expect = 1ch) [PASS]
flbas = 3dh, inuse = 1dh (expect = 1dh) [PASS]
flbas = 3eh, inuse = 1eh (expect = 1eh) [PASS]
flbas = 3fh, inuse = 1fh (expect = 1fh) [PASS]
flbas = 40h, inuse = 20h (expect = 20h) [PASS]
flbas = 41h, inuse = 21h (expect = 21h) [PASS]
flbas = 42h, inuse = 22h (expect = 22h) [PASS]
flbas = 43h, inuse = 23h (expect = 23h) [PASS]
flbas = 44h, inuse = 24h (expect = 24h) [PASS]
flbas = 45h, inuse = 25h (expect = 25h) [PASS]
flbas = 46h, inuse = 26h (expect = 26h) [PASS]
flbas = 47h, inuse = 27h (expect = 27h) [PASS]
flbas = 48h, inuse = 28h (expect = 28h) [PASS]
flbas = 49h, inuse = 29h (expect = 29h) [PASS]
flbas = 4ah, inuse = 2ah (expect = 2ah) [PASS]
flbas = 4bh, inuse = 2bh (expect = 2bh) [PASS]
flbas = 4ch, inuse = 2ch (expect = 2ch) [PASS]
flbas = 4dh, inuse = 2dh (expect = 2dh) [PASS]
flbas = 4eh, inuse = 2eh (expect = 2eh) [PASS]
flbas = 4fh, inuse = 2fh (expect = 2fh) [PASS]
flbas = 50h, inuse = 20h (expect = 20h) [PASS]
flbas = 51h, inuse = 21h (expect = 21h) [PASS]
flbas = 52h, inuse = 22h (expect = 22h) [PASS]
flbas = 53h, inuse = 23h (expect = 23h) [PASS]
flbas = 54h, inuse = 24h (expect = 24h) [PASS]
flbas = 55h, inuse = 25h (expect = 25h) [PASS]
flbas = 56h, inuse = 26h (expect = 26h) [PASS]
flbas = 57h, inuse = 27h (expect = 27h) [PASS]
flbas = 58h, inuse = 28h (expect = 28h) [PASS]
flbas = 59h, inuse = 29h (expect = 29h) [PASS]
flbas = 5ah, inuse = 2ah (expect = 2ah) [PASS]
flbas = 5bh, inuse = 2bh (expect = 2bh) [PASS]
flbas = 5ch, inuse = 2ch (expect = 2ch) [PASS]
flbas = 5dh, inuse = 2dh (expect = 2dh) [PASS]
flbas = 5eh, inuse = 2eh (expect = 2eh) [PASS]
flbas = 5fh, inuse = 2fh (expect = 2fh) [PASS]
flbas = 60h, inuse = 30h (expect = 30h) [PASS]
flbas = 61h, inuse = 31h (expect = 31h) [PASS]
flbas = 62h, inuse = 32h (expect = 32h) [PASS]
flbas = 63h, inuse = 33h (expect = 33h) [PASS]
flbas = 64h, inuse = 34h (expect = 34h) [PASS]
flbas = 65h, inuse = 35h (expect = 35h) [PASS]
flbas = 66h, inuse = 36h (expect = 36h) [PASS]
flbas = 67h, inuse = 37h (expect = 37h) [PASS]
flbas = 68h, inuse = 38h (expect = 38h) [PASS]
flbas = 69h, inuse = 39h (expect = 39h) [PASS]
flbas = 6ah, inuse = 3ah (expect = 3ah) [PASS]
flbas = 6bh, inuse = 3bh (expect = 3bh) [PASS]
flbas = 6ch, inuse = 3ch (expect = 3ch) [PASS]
flbas = 6dh, inuse = 3dh (expect = 3dh) [PASS]
flbas = 6eh, inuse = 3eh (expect = 3eh) [PASS]
flbas = 6fh, inuse = 3fh (expect = 3fh) [PASS]
flbas = 70h, inuse = 30h (expect = 30h) [PASS]
flbas = 71h, inuse = 31h (expect = 31h) [PASS]
flbas = 72h, inuse = 32h (expect = 32h) [PASS]
flbas = 73h, inuse = 33h (expect = 33h) [PASS]
flbas = 74h, inuse = 34h (expect = 34h) [PASS]
flbas = 75h, inuse = 35h (expect = 35h) [PASS]
flbas = 76h, inuse = 36h (expect = 36h) [PASS]
flbas = 77h, inuse = 37h (expect = 37h) [PASS]
flbas = 78h, inuse = 38h (expect = 38h) [PASS]
flbas = 79h, inuse = 39h (expect = 39h) [PASS]
flbas = 7ah, inuse = 3ah (expect = 3ah) [PASS]
flbas = 7bh, inuse = 3bh (expect = 3bh) [PASS]
flbas = 7ch, inuse = 3ch (expect = 3ch) [PASS]
flbas = 7dh, inuse = 3dh (expect = 3dh) [PASS]
flbas = 7eh, inuse = 3eh (expect = 3eh) [PASS]
flbas = 7fh, inuse = 3fh (expect = 3fh) [PASS]
nvme_id_ns_flbas_to_lbaf_inuse() [PASS]

@igaw
Copy link
Collaborator

igaw commented Apr 2, 2024

Looks good to me. The only thing I'd nitpick is the number format output. 0x12 or x12 instead of 12h.

@benchuanggli benchuanggli force-pushed the add-test-case-for-nvme-id-ns-flbas-to-lbaf-inuse branch from 26c95fe to 335c4c1 Compare April 3, 2024 00:04
@benchuanggli
Copy link
Contributor Author

Looks good to me. The only thing I'd nitpick is the number format output. 0x12 or x12 instead of 12h.

Updated it.

@igaw igaw merged commit cc1a194 into linux-nvme:master Apr 3, 2024
13 of 14 checks passed
@igaw
Copy link
Collaborator

igaw commented Apr 3, 2024

Thanks!

@benchuanggli benchuanggli deleted the add-test-case-for-nvme-id-ns-flbas-to-lbaf-inuse branch April 3, 2024 07:02
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