Re: [LTP] [PATCH] read/read02.c: add new error number tests

chrubis
2014-05-05T11:54:02Z

Hi!
> > > + tst_require_root(NULL);
> >
> > Does O_DIRECT require root?
> > (I haven't found anything in read man page that would suggests so)
> >
>
> In fedora20, /tmp is tmpfs.
> This test will fail if open a file with O_DIRECT in /tmp, like:
> read02 1 TBROK : open failed at read02.c:147: errno=EINVAL(22):
> Invalid argument
> So I test it in /root.

That is wrong way to solve this problem.

> > There is no need to unlink files if you call tst_rmdir(). You only need
> > to close filedescriptors.
> >
>
> TEST_FILE4 is not in /tmp.

The test should create all files in a directory created by tst_tmpdir().

We should handle this as:

* Skip the test (TCONF) if temp diretory is tmpfs (does not support O_DIRECT)
(see include/tst_fs_type.h)

* User should pass alternative temp directory to runltp script to make
the test working in case /tmp is on tmpfs

--
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now