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

mtest05 fail on read only remote machine #87

Closed
ngh1hc opened this issue Aug 29, 2016 · 6 comments
Closed

mtest05 fail on read only remote machine #87

ngh1hc opened this issue Aug 29, 2016 · 6 comments

Comments

@ngh1hc
Copy link

ngh1hc commented Aug 29, 2016

2016-08-26T11:37:31 Test: mtest05 Testparm: mmstress
mmstress 0 TINFO : run mmstress -h for all options
mmstress 0 TINFO : test1: Test case tests the race condition between simultaneous read faults in the same address space.
mmstress 1 TFAIL : mmstress.c:927: TEST 1 Failed
mmstress 0 TINFO : test2: Test case tests the race condition between simultaneous write faults in the same address space.
map_and_thread(): open(): Read-only file system
map_and_thread(): open(): Read-only file system
......
I run tests on read-only remote machine

Looks like the test tries to create new file in test binary folder..
map_and_thread("./tmp.file.1", thread_fault, READ_FAULT, NUMTHREAD, &retval);

@metan-ucw
Copy link
Member

Indeed the test opens files in $CWD it should be fixed to honour $TMPDIR and create a temporary directory there before it starts testing.

@bssrikanth
Copy link

trying to recreate this issue locally.. I am having CWD which is read-only.. but able to run tests successfully
/tmp/imgmnt# touch d
touch: cannot touch 'd': Read-only file system <-- CWD is readonly

/tmp/imgmnt# /opt/ltp/runltp -s mtest05
mmstress 0 TINFO : run mmstress -h for all options
mmstress 0 TINFO : test1: Test case tests the race condition between simultaneous read faults in the same address space.
mmstress 1 TPASS : TEST 1 Passed
mmstress 0 TINFO : test2: Test case tests the race condition between simultaneous write faults in the same address space.
mmstress 2 TPASS : TEST 2 Passed
mmstress 0 TINFO : test3: Test case tests the race condition between simultaneous COW faults in the same address space.
mmstress 3 TPASS : TEST 3 Passed
mmstress 0 TINFO : test4: Test case tests the race condition between simultaneous READ faults in the same address space. The file mapped is /dev/zero
mmstress 4 TPASS : TEST 4 Passed
mmstress 0 TINFO : test5: Test case tests the race condition between simultaneous fork - exit faults in the same address space.
mmstress 5 TPASS : TEST 5 Passed
mmstress 0 TINFO : test6: Test case tests the race condition between simultaneous fork -exec - exit faults in the same address space.
mmstress 6 TPASS : TEST 6 Passed
mmstress 7 TPASS : Test Passed
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=0 corefile=no
cutime=89 cstime=882
<<<test_end>>>
INFO: ltp-pan reported all tests PASS
LTP Version: 20160920-140-g65767d1

   ###############################################################

        Done executing testcases.
        LTP Version:  20160920-140-g65767d1
   ###############################################################

@metan-ucw
Copy link
Member

That is because the runltp script changes working directory to the /opt/ltp/. But you should be able to run the test binary directly in the read only directory, i.e. /tmp/imgmnt# /opt/ltp/testcases/bin/mtest05 which should then fail.

@athira-rajeev
Copy link

I was able to reproduce this issue . Created a file system and mounted as read only.
Executed mmstress testcase.

mmstress 0 TINFO : run /root/athira/LTP/ltp/testcases/kernel/mem/mtest05/mmstress -h for all options
mmstress 0 TINFO : test1: Test case tests the race condition between simultaneous read faults in the same address space.
map_and_thread(): open(): Read-only file system
mmstress 1 TFAIL : mmstress.c:927: TEST 1 Failed
mmstress 0 TINFO : test2: Test case tests the race condition between simultaneous write faults in the same address space.
map_and_thread(): open(): Read-only file system
mmstress 2 TFAIL : mmstress.c:927: TEST 2 Failed
mmstress 0 TINFO : test3: Test case tests the race condition between simultaneous COW faults in the same address space.
map_and_thread(): open(): Read-only file system

Created patch for this testcase where:

  • Create a directory under tmp using tst_tmpdir()
  • Instead of creating file with "./tmp.file.1", create under tmpdir

Will post the patch

@ghost
Copy link

ghost commented Dec 7, 2016

Not sure when $CWD is updated (trying to export it to /tmp and run binary in another read-only directory is not help), but the testcase can run normally in /tmp
/tmp# /opt/ltp/testcases/bin/mmstress
mmstress 0 TINFO : run /opt/ltp/testcases/bin/mmstress -h for all options
mmstress 0 TINFO : test1: Test case tests the race condition between simultaneous read faults in the same address space.
mmstress 1 TPASS : TEST 1 Passed
mmstress 0 TINFO : test2: Test case tests the race condition between simultaneous write faults in the same address space.
mmstress 2 TPASS : TEST 2 Passed
mmstress 0 TINFO : test3: Test case tests the race condition between simultaneous COW faults in the same address space.
mmstress 3 TPASS : TEST 3 Passed
mmstress 0 TINFO : test4: Test case tests the race condition between simultaneous READ faults in the same address space. The file mapped is /dev/zero
mmstress 4 TPASS : TEST 4 Passed
mmstress 0 TINFO : test5: Test case tests the race condition between simultaneous fork - exit faults in the same address space.
mmstress 5 TPASS : TEST 5 Passed
mmstress 0 TINFO : test6: Test case tests the race condition between simultaneous fork -exec - exit faults in the same address space.
test6(): execvp(): No such file or directory
test6(): execvp(): No such file or directory

(test6 is failed just because "mmstress_dummy" is not in /tmp/)
So using tst_tmpdir() as @athira-rajeev recommended may help to fix all current issues
Waiting for your new patch :-)

@ghost
Copy link

ghost commented Feb 7, 2017

Hello @athira-rajeev

Created patch for this testcase where:

Create a directory under tmp using tst_tmpdir()
Instead of creating file with "./tmp.file.1", create under tmpdir

Will post the patch

I also failed on this testcase, see that you already created the patch, did you post it ? (so that we'll not duplicate the work.)

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

No branches or pull requests

4 participants