On Thu, 19 Jan 2006, Davide Libenzi wrote:

On Wed, 18 Jan 2006, Andrew Morton wrote:

Davide Libenzi <[email protected]> wrote:

How sophisticated this has to be?

umm

- test basic functionality

- test things which should fail: syscall arguments out-of-bounds,
 negative syscall args, etc.  invalid fd.  valid fd but for the wrong type
 of file.

- if you can, something which will test the 32bit->64bit->32bit
 conversions which 32-bit userspace on 64-bit kernel needs to do.

Somehow, I knew I didn't have to ask :)

Here you go:

http://www.xmailserver.org/epoll_pwait_test.c

There is a problem with the test we have inside the kernel about the size of sigset_t, from the kernel (8 bytes on i386) and the glibc one (128 bytes):

        if (sigmask) {
                if (sigsetsize != sizeof(sigset_t))
                        return -EINVAL;
                if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask)))
                        return -EFAULT;
                sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP));
                sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
        }

ATM I left the check and I bolt 8 inside the test software, but this needs nicer handling. Typical run will show:

[EMAIL PROTECTED]:~/tmp$ ./epoll_pwait_test
Testing from wrong epfd type            : OK
Testing from closed epfd type           : OK
Testing numevents <= 0                  : OK
Testing numevents too big               : OK
Testing wrong sigmask size              : OK
Testing getevents when none available   : OK
Testing getevents when one available    : OK
Testing signal when blocked             : OK
Testing signal when non blocked         : OK




- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to