4.1 server tests: Fix some exception handling

Some of the exception handling from the nfs4.0 version of nfs4lib was missing
from the nfs4.1 of nfs4lib.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
4.1 server tests: add cleanup

nfs4.0 server tests cleans up after running, this adds similar cleanup
to nfs4.1 server tests.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Make delegations tests optional

Also, DELEG2 should be in deleg FLAG.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix SEQ9d to work in home directory instead of root

Ganesha detects ROFS before testing anything else so gave the
wrong response. If we try rename in the home dir instead of
Pseudo Root then all servers should work.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add two SECINFO_NO_NAME tests for SECINFO_STYLE4_PARENT

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Fix CSID5 to use LOOKUP of file

Some servers test CurrentFH valid for an operation before testing
stateid. For this test we do:

OPEN(name), LOOKUP(name), CLOSE

Now the CurrentFH at point of CLOSE is a regular file FH but the
process of LOOKUP has wiped out the Current Stateid.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add CSID10 OPEN(name), SAVEFH, LOOKUP(name), RESTOREFH, CLOSE

This tests that SAVEFH does indeed save the Current Stateid and that
RESTOREFH restores it.

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
4.1 server tests: delete some redundant comments

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
pynfs: fix reporting of ignored tests

currently, ignored tests reported as failure, which
makes fixing them quite hard.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
st_destroy_session: remove invalid testcase

we cant expect NFS4ERR_NOT_ONLY_OP if spec
enforces NFS4ERR_OP_NOT_IN_SESSION

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Add --showcodesflags to show codes AND their flags

Output looks something like this:

[root@localhost nfs4.0]# ./testserver.py --showcodesflags | grep lockt
LKT1 FLAGS: lockt, all
LKT2a FLAGS: lockt, symlink, all
LKT2b FLAGS: lockt, block, all
LKT2c FLAGS: lockt, char, all
LKT2d FLAGS: lockt, dir, all
LKT2f FLAGS: lockt, fifo, all
LKT2s FLAGS: lockt, socket, all
LKT3 FLAGS: lockt, all
LKT4 FLAGS: lockt, all
LKT5 FLAGS: lockt, all
LKT6 FLAGS: lockt, all
LKT7 FLAGS: lockt, all
LKT8 FLAGS: lockt, emptyfh, all
LKT9 FLAGS: lockt, all
LKTOVER FLAGS: lockt, all
LOCK1 FLAGS: lock, lockt, all

Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Add a more explicit copyright notice

There is incomplete copyright information scattered through the files,
and the setup.py files all make it clear that the license is GPL, so I
don't think there's any doubt that the whole can be distributed under
the GPL (though unidentified portions, e.g., those copyright the UM or
CITI, may also be available under more liberal terms).

But I think we should make this clearer if only to avoid any
misunderstandings with future contributors.

So add a COPYRIGHT file with a copy of GPLv2 and a brief summary of the
copyright status.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
4.0 server tests: clean up WRT15

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
4.0 server tests: increase odds of WRT15 detecting bug

Testing the Linux server's xdr decoding, I found that if the
page-crossing logic was wrong, resulting in corrupting part of the final
getattr, the server didn't necessarily notice, whereas adding a second
getattr resulted in a reliable op_illegal.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nfs4.1: add test case for ca_maxrequestsize and bad backchannel

CSESS28: test too small maxrequestsize.
CSESS29: test a bug in nfsd by sending many bad backchannel request.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nfs4.1: check whether old session is discard for EID5f

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nfs4.1 server: fix typos related to file layout

Since the new .x it's "FATTR4_FS_LAYOUT_TYPES", not "FATTR4_FS_LAYOUT_TYPE"

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nfs4.1: add basic SECINFO_NO_NAME support

only returns AUTH_SYS for now

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nfs4.1 server: DSs should have diff server owners

Use getpid() to generate the minor_id component of the server owner.

Witout this, all DSs are considered to be the same server by NFS clients
that detect server trunking, such as the upstream Linux client.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
4.1 server tests: better REP_TOO_BIG test

We're depending on the server returning TOO_BIG on a 500-byte read over
a channel with maximum reply size 500.

It would be legal for the server to do that, but as far as I can tell it
would also be legal for it to return OK and a short read.

(And in fact depending on the server implementation that's quite likely
in this case since the file is actually only 160 bytes long!)

Use a getattrs of the mandatory attributes instead, as that reply has a
well-defined minimum size.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>