-
Notifications
You must be signed in to change notification settings - Fork 4
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
LTP: fix test case fchown04 issue #49
Conversation
I still believe that the correct way of fixing tests like this is to add either partitions or separate block devices to our test environment that provide the required file systems. We could easily add a separate 256MB block device for tests like this and do the mkfs on the outside. |
This needs a corresponding PR on sgx-lkl so that CI is run with this change. Please speak to @hukoyu if you aren't familiar with how to do that. |
@davidchisnall, Is this below approach is fine.
|
Problem: This test case causing oom killer to be invoked and causing kernel panic. This is because the test case invokes test framework function "tst_acquire_device" which creates a 256MB of .img file and binds with a loop device. This is not supported because the default size of LKL memory is set to 32M. This is kept low due to the limited size of EPC (Enclave page cache) and to avoid page cache being swapped out. Also, the test case invokes "tst_mkfs" framework function which inturn invokes mkfs utility command with the help of system() syscall. It is recommended to use root file system, but, this test case needs a read-only filesystem to test one of the sub-test case. we don't have a read-only file system mounted in sgx-lkl. To support the a formated ext4 filesystem image created in master .img. Test case will pick this image and use it in test. Test case changes link: lsds/ltp#49
Why do you want to use a loop device here? Can't you mount a separate block device using SGX-LKL, similar to what we do in some of our other CI tests? |
This test case causing oom killer to be invoked and causing kernel panic. This is because the test case invokes test framework function "tst_acquire_device" which creates a 256MB of .img file and binds with a loop device. This is not supported because the default size of LKL memory is set to 32M. This is kept low due to the limited size of EPC (Enclave page cache) and to avoid page cache being swapped out. Also, the test case invokes "tst_mkfs" framework function which inturn invokes mkfs utility command with the help of system() syscall. It is recommended to use root file system, but, this test case needs a read-only filesystem to test one of the sub-test cases. we don't have a read-only file system mounted in sgx-lkl. To support the test cases which need a block device a formatted ext4 filesystem image created and passed to enclave as extended disk. The test case passes the details about this new block disk image in the application configuration file. The test framework will pick this image details in the environment variable and use it in test. Test case changes link: lsds/ltp#49, lsds/ltp#59. This PR also revert the PR:lsds#741 This lsds#741, creates a filesystem image in master image. because of this, each individual test case needs to be modified.
The original test case performs the below tests: 1) fchown(2) returns -1 and sets errno to EPERM if the effective user id of the process does not match the owner of the file and the process is not a superuser. 2) fchown(2) returns -1 and sets errno to EBADF if the file descriptor of the specified file is not valid. 3) fchown(2) returns -1 and sets errno to EROFS if the named file resides on a read-only file system. Problem/issue: This test case causing oom killer to be invoked and causing kernel panic. This is because the test case invokes test framework function "tst_acquire_device" which creates a 256MB of .img file and binds with a loop device. This is not supported because the default size of LKL memory is set to 32M. This is kept low due to the limited size of EPC (Enclave page cache) and to avoid page cache being swapped out. Also, the test case invokes "tst_mkfs" framework function which inturn invokes mkfs utility command with the help of system() syscall. It is recommended to use root file system, but, this test case needs a read-only filesystem to test one of the sub-test case. we don't have a read-only file system mounted in sgx-lkl. Hence, disabling the code related to the mount and sub test case. Modifications: 1. Disable the 3rd sub test case 2. Disable the code which creates file system, mount, and unmount the filesystem.
1. add code to bind the loop device with ext4 formated file system image 2. mounted the loop device at the mount point.
Updated the test case to use the mounted block device.
0507f2c
to
3e6cd93
Compare
@davidchisnall, @prp, I updated the changes as per your suggestion. In this PR and PR: lsds/sgx-lkl#750 |
This test case causing oom killer to be invoked and causing kernel panic. This is because the test case invokes test framework function "tst_acquire_device" which creates a 256MB of .img file and binds with a loop device. This is not supported because the default size of LKL memory is set to 32M. This is kept low due to the limited size of EPC (Enclave page cache) and to avoid page cache being swapped out. Also, the test case invokes "tst_mkfs" framework function which inturn invokes mkfs utility command with the help of system() syscall. It is recommended to use root file system, but, this test case needs a read-only filesystem to test one of the sub-test cases. we don't have a read-only file system mounted in sgx-lkl. To support the test cases which need a block device a formatted ext4 filesystem image created and passed to enclave as extended disk. The test case passes the details about this new block disk image in the application configuration file. The test framework will pick this image details in the environment variable and use it in test. Test case changes link: lsds/ltp#49, lsds/ltp#59. This PR also revert the PR:lsds#741 This lsds#741, creates a filesystem image in master image. because of this, each individual test case needs to be modified.
This test case causing oom killer to be invoked and causing kernel panic. This is because the test case invokes test framework function "tst_acquire_device" which creates a 256MB of .img file and binds with a loop device. This is not supported because the default size of LKL memory is set to 32M. This is kept low due to the limited size of EPC (Enclave page cache) and to avoid page cache being swapped out. Also, the test case invokes "tst_mkfs" framework function which inturn invokes mkfs utility command with the help of system() syscall. It is recommended to use root file system, but, this test case needs a read-only filesystem to test one of the sub-test cases. we don't have a read-only file system mounted in sgx-lkl. To support the test cases which need a block device a formatted ext4 filesystem image created and passed to enclave as extended disk. The test case passes the details about this new block disk image in the application configuration file. The test framework will pick this image details in the environment variable and use it in test. Test case changes link: lsds/ltp#49, lsds/ltp#59, lsds/ltp#65, lsds/ltp#66.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. After lsds/sgx-lkl#764 and #65 are merged this fix will work.
@davidchisnall both of dependent PRs merged. This PR is ready to be merged if you approve. |
The original test case performs the below tests:
user id of the process does not match the owner of the file
and the process is not a superuser.
descriptor of the specified file is not valid.
resides on a read-only file system.
Problem/issue:
This test case causing oom killer to be invoked and causing
kernel panic. This is because the test case invokes test framework
function "tst_acquire_device" which creates a 256MB of .img file
and binds with a loop device. This is not supported because the
default size of LKL memory is set to 32M. This is kept low due to
the limited size of EPC (Enclave page cache) and to avoid page
cache being swapped out.
Also, the test case invokes "tst_mkfs" framework function which
inturn invokes mkfs utility command with the help of system() syscall.
It is recommended to use root file system, but, this test case
needs a read-only filesystem to test one of the sub-test case.
we don't have a read-only file system mounted in sgx-lkl.
Hence, disabling the code related to the mount and sub test case.
Modifications:
Review-1: