Hi everyone,
here is the initial test case design for move_pages(). Please
do send in your review comments. Do let me know, if any other
test cases are required. The test cases are based on the man
page available at http://linux.die.net/man/2/move_pages

BTW, I am planning to do the testing using numa=fake, hope
that should suffice.

Test 1: Test retrieval of NUMA node

1. Allocate pages in NUMA nodes A and B
2. Use move_pages() to retrieve the NUMA node of the pages.
3. Check if the NUMA nodes reported are correct.

Test 2: Test movement of pages mapped by a process

1. Allocate pages in NUMA node A.
2. Use move_pages() to move the pages to NUMA node B.
3. Retrieve the NUMA nodes of the moved pages.
4. Check if all pages are in node B.

Test 3: Test movement of shared pages

1. Start the test case program as root.
2. Allocate a shared memory in NUMA node A.
3. Fork another process.
4. Use move_pages() to move the pages to NUMA node B, with the
MPOL_MF_MOVE_ALL.
5. Check if all pages are in node B.

Test 4: Failure when page address is invalid

1. Pass an invalid pointer as one of the page addresses to move_pages().
2. Check if the corresponding status is set to -EFAULT.

Test 5: Failure when page is mlocked

1. Pass a pointer to a mlocked page to move_pages().
2. Check if the corresponding status is set to -EPERM.

Test 6: Failure when shared page is moved without MPOL_MF_MOVE_ALL

1. Start test case program as root.
2. Allocate a shared memory page.
3. Fork another process.
4. Pass a pointer to a shared page to move_pages(), without
the MPOL_MF_MOVE_ALL flag.
5. Check if the corresponding status is set to -EACCES.

Test 7: Failure when the NUMA node is invalid

1. Pass a non-existent NUMA node number to move_pages().
2. Check if errno is set to ENODEV.

Test 8: Failure when the PID is invalid

1. Pass a non-existent PID to move_pages().
2. Check if errno is set to ESRCH.

Test 9: Failure when the no. of pages is ULONG_MAX

1. Pass ULONG_MAX pages to move_pages().
2. Check if errno is set to E2BIG.

Test 10: Failure when all pages are in required NUMA node

1. Pass the actual NUMA node number for each page to move_pages().
2. Check if errno is set to ENOENT.

Test 11: Failure when flags is invalid

1. Pass invalid flags to move_pages().
2. Check if errno is set to EINVAL.

Test 12: Failure when trying move shared pages

1. Allocate a shared memory in NUMA node A.
2. Fork another process.
3. Use move_pages() to move the pages to NUMA node B, with the
MPOL_MF_MOVE_ALL.
4. Check if errno is set to EPERM.

TODO:

* Test case for errno = EACCES.
* Test case for errno = EINVAL, due to page being in a kernel thread.
* Test case for status[] = ENOENT.
* Test case for status[] = EBUSY.

Regards,
Vijay 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to