Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

inotify.03: missing warning concerning loss of data #11

Closed
xypron opened this Issue · 6 comments

3 participants

@xypron

testcases/kernel/syscalls/inotify/inotify03.c
should warn that the drive used for testing will be formatted and this will result in data loss. Only after confirmation by the user the test should continue.

Furthermore, please, add the test to
testcases/kernel/syscalls/inotify/README

@metan-ucw
Owner

The first part wouldn't be easy to implement. LTP is automated testsuite, i.e. user starts it by the toplevel script, then it runs for hours and once finished the user collects the results. The tests MUST NOT read any input from user.

The second part would be easier. However the same holds for more than the inotify03 testcase, there are at least 30 testcases that works with a device in the same way.

There is a warning already in the top level README:

Warning!
--------
Be careful with these tests!

Don't run them on production systems.

Which clearly says that you should not run LTP on any machine that holds any important data. IMHO the best solution would be to add a more explicit note that devices passed to testcases are formatted there. What do you think?

@vapier
Owner

i haven't looked at the others, but at least for inotify03, there's no real reason to require a random external device be provided by the user. it should be more than capable of creating a sparse temporary file, formatting it as ext2, and then doing its mount/umount tests, and then deleting it.

@metan-ucw
Owner

vapier: That is what the runltp script does at the moment.

If no device is passed to it it creates a loop device that is passed to all tests.

I would be happier if the logic was in libltp.a. However there are a few problems that comes with it. One of the problems is that if tests fails to cleanup the loop device it will stay in the system until reboot or manual removal, so after a few iterations the system would be filled with unused loop devices and these tests will fail from that point on.

The second problem is just a matter of time, redesigning the libltp interface is cheap. Rewriting all testcases that use the interface is more time consuming.

@vapier
Owner

the test cases already need to clean up their mounts, so we can't get away from their inability to clean up after themselves. although that can be mitigated by running test cases in their own mount namespace.

i agree that it'd be much nicer if libltp provided an API for allocating on the fly and for registering their clean up phase.

if we want to close this out sooner rather than later, then just adding a warning to runltp when someone specifies their own device input should be sufficient.

@xypron

The top level README comment "Don't run them on production systems." does not imply that I should not use tlp on my workstation, which is a development system and not a production system. Even with this comment I expect tlp to change only files inside its own directory tree and afterwards clean up again.

As vapier already mentioned tests for mounting and formatting should be executed using a tempory file formatted as ext2.

metan-ucw wrote:

If no device is passed to it it creates a loop device that is passed to all tests.

My intention was to only execute the inotify tests. Creating a loop device in some script outside the inotify directory does not help in this case.

@metan-ucw
Owner

xypron wrote:

The top level README comment "Don't run them on production systems." does not imply that I should not use tlp on my workstation, which is a development system and not a production system.

I'm just saying that you should be careful when running the testcases. They are supposed to stress Linux to the limits and try unusual codepaths and may crash the system under test. Furthermore when passing devices to testcase you should really expect that the data would be destroyed.

Even with this comment I expect tlp to change only files inside its own directory tree and afterwards clean up again.

This is not generally true, LTP uses $TMPDIR (defaults to /tmp/) to create all temporary files. It should not, on the other hand, touch anything outside the temp directory created in $TMPDIR and the directory is cleaned up once testcase has finished.

My intention was to only execute the inotify tests. Creating a loop device in some script outside the inotify directory does not help in this case.

You are expected to install LTP and run the test using the runltp script (runltp -f testcase_name). If you need to execute the testcase manually you need to prepare device beforehand. I'm not happy with this and I have this on my TODO, but I cannot promise that this will get fixed soon.

@metan-ucw metan-ucw closed this issue from a commit
@metan-ucw metan-ucw syscalls/inotify03: Convert to tst_acquire_device()
Resolves #11

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
f8bf865
@metan-ucw metan-ucw closed this in f8bf865
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.