NFSv4 Add support for nfs_open() nfs_fstat64() nfs_close()

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
libnfs-4.0.0-vitalif
Ronnie Sahlberg 2017-07-16 07:46:38 +10:00
parent 93fbecd7c1
commit 0d9dd0ee44
22 changed files with 636 additions and 195 deletions

View File

@ -294,6 +294,7 @@ struct nfs_context {
char *client_name;
uint64_t clientid;
verifier4 setclientid_confirm;
uint32_t seqid;
};
typedef int (*continue_func)(struct nfs_context *nfs, struct nfs_attr *attr,
@ -364,13 +365,21 @@ struct nfs_pagecache {
time_t ttl;
};
struct stateid {
uint32_t seqid;
char other[12];
};
struct nfsfh {
struct nfs_fh fh;
int is_sync;
int is_append;
uint64_t offset;
struct nfs_readahead ra;
struct nfs_pagecache pagecache;
struct nfs_fh fh;
int is_sync;
int is_append;
uint64_t offset;
struct nfs_readahead ra;
struct nfs_pagecache pagecache;
/* NFSv4 */
struct stateid stateid;
};
const struct nfs_fh *nfs_get_rootfh(struct nfs_context *nfs);
@ -464,10 +473,16 @@ int nfs3_write_async(struct nfs_context *nfs, struct nfsfh *nfsfh,
int nfs4_chdir_async(struct nfs_context *nfs, const char *path,
nfs_cb cb, void *private_data);
int nfs4_close_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
void *private_data);
int nfs4_fstat64_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
void *private_data);
int nfs4_mkdir2_async(struct nfs_context *nfs, const char *path, int mode,
nfs_cb cb, void *private_data);
int nfs4_mount_async(struct nfs_context *nfs, const char *server,
const char *export, nfs_cb cb, void *private_data);
int nfs4_open_async(struct nfs_context *nfs, const char *path, int flags,
nfs_cb cb, void *private_data);
int nfs4_rmdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb,
void *private_data);
int nfs4_stat64_async(struct nfs_context *nfs, const char *path,

View File

@ -513,6 +513,8 @@ EXTERN uint16_t nfs_umask(struct nfs_context *nfs, uint16_t mask);
* mode is a combination of the flags :
* O_RDONLY, O_WRONLY, O_RDWR , O_SYNC, O_APPEND, O_TRUNC, O_NOFOLLOW
*
* ( O_SYNC, O_APPEND, O_TRUNC are not yet supported for NFSv4. )
*
* Function returns
* 0 : The command was queued successfully. The callback will be invoked once
* the command completes.

View File

@ -497,7 +497,8 @@ nfs_close(struct nfs_context *nfs, struct nfsfh *nfsfh)
cb_data.is_finished = 0;
if (nfs_close_async(nfs, nfsfh, close_cb, &cb_data) != 0) {
nfs_set_error(nfs, "nfs_close_async failed");
nfs_set_error(nfs, "nfs_close_async failed. %s",
nfs_get_error(nfs));
return -1;
}
@ -545,7 +546,8 @@ nfs_fstat64(struct nfs_context *nfs, struct nfsfh *nfsfh,
cb_data.return_data = st;
if (nfs_fstat64_async(nfs, nfsfh, stat64_cb, &cb_data) != 0) {
nfs_set_error(nfs, "nfs_fstat64_async failed");
nfs_set_error(nfs, "nfs_fstat64_async failed. %s",
nfs_get_error(nfs));
return -1;
}

View File

@ -958,9 +958,11 @@ nfs_open_async(struct nfs_context *nfs, const char *path, int flags,
switch (nfs->version) {
case NFS_V3:
return nfs3_open_async(nfs, path, flags, cb, private_data);
case NFS_V4:
return nfs4_open_async(nfs, path, flags, cb, private_data);
default:
nfs_set_error(nfs, "%s does not support NFSv4",
__FUNCTION__);
nfs_set_error(nfs, "%s does not support NFSv%d",
__FUNCTION__, nfs->version);
return -1;
}
}
@ -1051,9 +1053,11 @@ nfs_close_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
switch (nfs->version) {
case NFS_V3:
return nfs3_close_async(nfs, nfsfh, cb, private_data);
case NFS_V4:
return nfs4_close_async(nfs, nfsfh, cb, private_data);
default:
nfs_set_error(nfs, "%s does not support NFSv4",
__FUNCTION__);
nfs_set_error(nfs, "%s does not support NFSv%d",
__FUNCTION__, nfs->version);
return -1;
}
}
@ -1079,9 +1083,11 @@ nfs_fstat64_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
switch (nfs->version) {
case NFS_V3:
return nfs3_fstat64_async(nfs, nfsfh, cb, private_data);
case NFS_V4:
return nfs4_fstat64_async(nfs, nfsfh, cb, private_data);
default:
nfs_set_error(nfs, "%s does not support NFSv4",
__FUNCTION__);
nfs_set_error(nfs, "%s does not support NFSv%d",
__FUNCTION__, nfs->version);
return -1;
}
}

View File

@ -107,6 +107,7 @@ struct lookup_link_data {
struct lookup_filler {
op_filler func;
int num_op;
int flags;
void *data; /* Freed by nfs4_cb_data destructor */
struct {
@ -124,7 +125,7 @@ struct nfs4_cb_data {
/* Do not follow symlinks for the final component on a lookup.
* I.e. stat vs lstat
*/
#define LOOKUP_FLAG_FINAL_NO_FOLLOW 1
#define LOOKUP_FLAG_FINAL_NO_FOLLOW 0x0001
int flags;
/* Application callback and data */
@ -186,6 +187,27 @@ check_nfs4_error(struct nfs_context *nfs, int status,
return 0;
}
static int
nfs4_find_op(struct nfs_context *nfs, struct nfs4_cb_data *data,
COMPOUND4res *res, int op, const char *op_name)
{
int i;
for (i = 0; i < res->resarray.resarray_len; i++) {
if (res->resarray.resarray_val[i].resop == op) {
break;
}
}
if (i == res->resarray.resarray_len) {
nfs_set_error(nfs, "No %s result.", op_name);
data->cb(-EINVAL, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
return -1;
}
return i;
}
static uint64_t
nfs_pntoh64(const uint32_t *buf)
{
@ -458,7 +480,7 @@ nfs4_lookup_path_2_cb(struct rpc_context *rpc, int status, void *command_data,
COMPOUND4res *res = command_data;
READLINK4res *rlres = NULL;
char *path, *tmp, *end;
unsigned int i;
int i;
assert(rpc->magic == RPC_CONTEXT_MAGIC);
@ -489,19 +511,11 @@ nfs4_lookup_path_2_cb(struct rpc_context *rpc, int status, void *command_data,
*end++ = 0;
}
for (i = 0; i < res->resarray.resarray_len; i++) {
if (res->resarray.resarray_val[i].resop == OP_READLINK) {
rlres = &res->resarray.resarray_val[i].nfs_resop4_u.opreadlink;
break;
}
}
if (i == res->resarray.resarray_len) {
nfs_set_error(nfs, "No READLINK result found.");
data->cb(-EINVAL, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
if ((i = nfs4_find_op(nfs, data, res, OP_READLINK, "READLINK")) < 0) {
free(path);
return;
}
rlres = &res->resarray.resarray_val[i].nfs_resop4_u.opreadlink;
tmp = malloc(strlen(data->path) + 3 + strlen(rlres->READLINK4res_u.resok4.link.utf8string_val));
if (tmp == NULL) {
@ -760,7 +774,7 @@ nfs4_mount_4_cb(struct rpc_context *rpc, int status, void *command_data,
struct nfs_context *nfs = data->nfs;
COMPOUND4res *res = command_data;
GETFH4resok *gfhresok;
unsigned int i;
int i;
assert(rpc->magic == RPC_CONTEXT_MAGIC);
@ -769,18 +783,9 @@ nfs4_mount_4_cb(struct rpc_context *rpc, int status, void *command_data,
return;
}
for (i = 0; i < res->resarray.resarray_len; i++) {
if (res->resarray.resarray_val[i].resop == OP_GETFH) {
break;
}
}
if (i == res->resarray.resarray_len) {
nfs_set_error(nfs, "No GETFH result for mount.");
data->cb(-EINVAL, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
if ((i = nfs4_find_op(nfs, data, res, OP_GETFH, "GETFH")) < 0) {
return;
}
gfhresok = &res->resarray.resarray_val[i].nfs_resop4_u.opgetfh.GETFH4res_u.resok4;
nfs->rootfh.len = gfhresok->object.nfs_fh4_len;
@ -1054,7 +1059,7 @@ nfs4_xstat64_cb(struct rpc_context *rpc, int status, void *command_data,
COMPOUND4res *res = command_data;
GETATTR4resok *garesok;
struct nfs_stat_64 st;
unsigned int i;
int i;
assert(rpc->magic == RPC_CONTEXT_MAGIC);
@ -1063,15 +1068,7 @@ nfs4_xstat64_cb(struct rpc_context *rpc, int status, void *command_data,
return;
}
for (i = 0; i < res->resarray.resarray_len; i++) {
if (res->resarray.resarray_val[i].resop == OP_GETATTR) {
break;
}
}
if (i == res->resarray.resarray_len) {
nfs_set_error(nfs, "No GETATTR result for stat64.");
data->cb(-EINVAL, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
if ((i = nfs4_find_op(nfs, data, res, OP_GETATTR, "GETATTR")) < 0) {
return;
}
garesok = &res->resarray.resarray_val[i].nfs_resop4_u.opgetattr.GETATTR4res_u.resok4;
@ -1332,3 +1329,422 @@ nfs4_rmdir_async(struct nfs_context *nfs, const char *orig_path,
return 0;
}
/* filler.flags are the open flags
* filler.data is the object name
* filler.blob0.val is the attribute mask
*/
static void
nfs4_populate_open(struct nfs4_cb_data *data, nfs_argop4 *op)
{
struct nfs_context *nfs = data->nfs;
GETATTR4args *gaargs;
ACCESS4args *aargs;
OPEN4args *oargs;
uint32_t *attributes = data->filler.blob0.val;
gaargs = &op[0].nfs_argop4_u.opgetattr;
op[0].argop = OP_GETATTR;
memset(gaargs, 0, sizeof(*gaargs));
attributes[0] =
1 << FATTR4_TYPE |
1 << FATTR4_SIZE |
1 << FATTR4_FILEID;
attributes[1] =
1 << (FATTR4_MODE - 32) |
1 << (FATTR4_NUMLINKS - 32) |
1 << (FATTR4_OWNER - 32) |
1 << (FATTR4_OWNER_GROUP - 32) |
1 << (FATTR4_SPACE_USED - 32) |
1 << (FATTR4_TIME_ACCESS - 32) |
1 << (FATTR4_TIME_METADATA - 32) |
1 << (FATTR4_TIME_MODIFY - 32);
gaargs->attr_request.bitmap4_len = 2;
gaargs->attr_request.bitmap4_val = attributes;
/* Access */
op[1].argop = OP_ACCESS;
aargs = &op[1].nfs_argop4_u.opaccess;
memset(aargs, 0, sizeof(*aargs));
if (data->filler.flags & O_WRONLY) {
aargs->access |= ACCESS4_MODIFY;
}
if (data->filler.flags & O_RDWR) {
aargs->access |= ACCESS4_READ|ACCESS4_MODIFY;
}
if (!(data->filler.flags & (O_WRONLY|O_RDWR))) {
aargs->access |= ACCESS4_READ;
}
/* Open */
op[2].argop = OP_OPEN;
oargs = &op[2].nfs_argop4_u.opopen;
memset(oargs, 0, sizeof(*oargs));
oargs->seqid = nfs->seqid++;
oargs->share_access = OPEN4_SHARE_ACCESS_READ;
oargs->share_deny = OPEN4_SHARE_DENY_NONE;
oargs->owner.clientid = nfs->clientid;
oargs->owner.owner.owner_len = strlen(nfs->client_name);
oargs->owner.owner.owner_val = nfs->client_name;
oargs->openhow.opentype = OPEN4_NOCREATE;
oargs->claim.claim = CLAIM_NULL;
oargs->claim.open_claim4_u.file.utf8string_len =
strlen(data->filler.data);
oargs->claim.open_claim4_u.file.utf8string_val =
data->filler.data;
/* GetFH */
op[3].argop = OP_GETFH;
}
static void
nfs4_open_confirm_cb(struct rpc_context *rpc, int status, void *command_data,
void *private_data)
{
struct nfs4_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
COMPOUND4res *res = command_data;
OPEN_CONFIRM4resok *ocresok;
int i;
struct nfsfh *fh;
assert(rpc->magic == RPC_CONTEXT_MAGIC);
if (check_nfs4_error(nfs, status, data, res, "OPEN_CONFIRM")) {
free_nfs4_cb_data(data);
return;
}
if ((i = nfs4_find_op(nfs, data, res, OP_OPEN_CONFIRM,
"OPEN_CONFIRM")) < 0) {
return;
}
ocresok = &res->resarray.resarray_val[i].nfs_resop4_u.opopen_confirm.OPEN_CONFIRM4res_u.resok4;
fh = data->filler.blob0.val;
data->filler.blob0.val = NULL;
data->filler.blob1.val = NULL;
fh->stateid.seqid = ocresok->open_stateid.seqid;
memcpy(fh->stateid.other, ocresok->open_stateid.other, 12);
data->cb(0, nfs, fh, data->private_data);
free_nfs4_cb_data(data);
}
static void
nfs4_open_cb(struct rpc_context *rpc, int status, void *command_data,
void *private_data)
{
struct nfs4_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
COMPOUND4res *res = command_data;
ACCESS4resok *aresok;
OPEN4resok *oresok;
GETFH4resok *gresok;
int i;
struct nfsfh *fh;
assert(rpc->magic == RPC_CONTEXT_MAGIC);
if (check_nfs4_error(nfs, status, data, res, "OPEN")) {
free_nfs4_cb_data(data);
return;
}
/* Parse Access and check that we have the access that we need */
if ((i = nfs4_find_op(nfs, data, res, OP_ACCESS, "ACCESS")) < 0) {
return;
}
aresok = &res->resarray.resarray_val[i].nfs_resop4_u.opaccess.ACCESS4res_u.resok4;
if (aresok->supported != aresok->access) {
nfs_set_error(nfs, "Insufficient ACCESS. Wanted %08x but "
"got %08x.", aresok->access, aresok->supported);
data->cb(-EINVAL, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
return;
}
/* Parse GetFH */
if ((i = nfs4_find_op(nfs, data, res, OP_GETFH, "GETFH")) < 0) {
return;
}
gresok = &res->resarray.resarray_val[i].nfs_resop4_u.opgetfh.GETFH4res_u.resok4;
fh = malloc(sizeof(*fh));
if (fh == NULL) {
nfs_set_error(nfs, "Out of memory. Failed to allocate "
"nfsfh");
data->cb(-ENOMEM, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
return;
}
memset(fh, 0 , sizeof(*fh));
data->filler.blob0.val = fh;
fh->fh.len = gresok->object.nfs_fh4_len;
fh->fh.val = malloc(fh->fh.len);
if (fh->fh.val == NULL) {
nfs_set_error(nfs, "Out of memory. Failed to allocate "
"nfsfh");
data->cb(-ENOMEM, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
return;
}
memcpy(fh->fh.val, gresok->object.nfs_fh4_val, fh->fh.len);
data->filler.blob1.val = fh->fh.val;
/* Parse Open */
if ((i = nfs4_find_op(nfs, data, res, OP_OPEN, "OPEN")) < 0) {
return;
}
oresok = &res->resarray.resarray_val[i].nfs_resop4_u.opopen.OPEN4res_u.resok4;
fh->stateid.seqid = oresok->stateid.seqid;
memcpy(fh->stateid.other, oresok->stateid.other, 12);
if (oresok->rflags & OPEN4_RESULT_CONFIRM) {
COMPOUND4args args;
nfs_argop4 op[2];
memset(op, 0, sizeof(op));
op[0].argop = OP_PUTFH;
op[0].nfs_argop4_u.opputfh.object.nfs_fh4_len = fh->fh.len;
op[0].nfs_argop4_u.opputfh.object.nfs_fh4_val = fh->fh.val;
op[1].argop = OP_OPEN_CONFIRM;
op[1].nfs_argop4_u.opopen_confirm.open_stateid.seqid =
fh->stateid.seqid;
memcpy(op[1].nfs_argop4_u.opopen_confirm.open_stateid.other,
fh->stateid.other, 12);
op[1].nfs_argop4_u.opopen_confirm.seqid = nfs->seqid;
nfs->seqid++;
memset(&args, 0, sizeof(args));
args.argarray.argarray_len = sizeof(op) / sizeof(nfs_argop4);
args.argarray.argarray_val = op;
if (rpc_nfs4_compound_async(rpc, nfs4_open_confirm_cb, &args,
private_data) != 0) {
data->cb(-ENOMEM, nfs, nfs_get_error(nfs),
data->private_data);
free_nfs4_cb_data(data);
return;
}
return;
}
data->filler.blob0.val = NULL;
data->filler.blob1.val = NULL;
data->cb(0, nfs, fh, data->private_data);
free_nfs4_cb_data(data);
}
int
nfs4_open_async(struct nfs_context *nfs, const char *orig_path, int flags,
nfs_cb cb, void *private_data)
{
struct nfs4_cb_data *data;
char *path;
data = malloc(sizeof(*data));
if (data == NULL) {
nfs_set_error(nfs, "Out of memory. Failed to allocate "
"cb data");
return -1;
}
memset(data, 0, sizeof(*data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
data->path = nfs4_resolve_path(nfs, orig_path);
if (data->path == NULL) {
nfs_set_error(nfs, "Out of memory resolving path");
free_nfs4_cb_data(data);
return -1;
}
path = strrchr(data->path, '/');
if (path == data->path) {
char *ptr;
for (ptr = data->path; *ptr; ptr++) {
*ptr = *(ptr + 1);
}
/* No path to lookup */
data->filler.data = data->path;
data->path = strdup("/");
} else {
*path++ = 0;
data->filler.data = strdup(path);
}
data->filler.func = nfs4_populate_open;
data->filler.num_op = 4;
data->filler.flags = flags;
data->filler.blob0.val = malloc(2 * sizeof(uint32_t));
if (data->filler.blob0.val == NULL) {
nfs_set_error(nfs, "Out of memory. Failed to allocate "
"data structure.");
data->cb(-ENOMEM, nfs, nfs_get_error(nfs), data->private_data);
free_nfs4_cb_data(data);
return -1;
}
memset(data->filler.blob0.val, 0, 2 * sizeof(uint32_t));
if (nfs4_lookup_path_async(nfs, data, nfs4_open_cb) < 0) {
free_nfs4_cb_data(data);
return -1;
}
return 0;
}
int
nfs4_fstat64_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
void *private_data)
{
COMPOUND4args args;
nfs_argop4 op[2];
PUTFH4args *pfargs;
GETATTR4args *gaargs;
uint32_t attributes[2];
struct nfs4_cb_data *data;
data = malloc(sizeof(*data));
if (data == NULL) {
nfs_set_error(nfs, "Out of memory. Failed to allocate "
"cb data");
return -1;
}
memset(data, 0, sizeof(*data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
op[0].argop = OP_PUTFH;
pfargs = &op[0].nfs_argop4_u.opputfh;
pfargs->object.nfs_fh4_len = nfsfh->fh.len;
pfargs->object.nfs_fh4_val = nfsfh->fh.val;
gaargs = &op[1].nfs_argop4_u.opgetattr;
op[1].argop = OP_GETATTR;
memset(gaargs, 0, sizeof(*gaargs));
attributes[0] =
1 << FATTR4_TYPE |
1 << FATTR4_SIZE |
1 << FATTR4_FILEID;
attributes[1] =
1 << (FATTR4_MODE - 32) |
1 << (FATTR4_NUMLINKS - 32) |
1 << (FATTR4_OWNER - 32) |
1 << (FATTR4_OWNER_GROUP - 32) |
1 << (FATTR4_SPACE_USED - 32) |
1 << (FATTR4_TIME_ACCESS - 32) |
1 << (FATTR4_TIME_METADATA - 32) |
1 << (FATTR4_TIME_MODIFY - 32);
gaargs->attr_request.bitmap4_len = 2;
gaargs->attr_request.bitmap4_val = attributes;
memset(&args, 0, sizeof(args));
args.argarray.argarray_len = sizeof(op) / sizeof(nfs_argop4);
args.argarray.argarray_val = op;
if (rpc_nfs4_compound_async(nfs->rpc, nfs4_xstat64_cb, &args,
data) != 0) {
free_nfs4_cb_data(data);
return -1;
}
return 0;
}
static void
nfs4_close_cb(struct rpc_context *rpc, int status, void *command_data,
void *private_data)
{
struct nfs4_cb_data *data = private_data;
struct nfs_context *nfs = data->nfs;
COMPOUND4res *res = command_data;
struct nfsfh *nfsfh;
assert(rpc->magic == RPC_CONTEXT_MAGIC);
nfsfh = data->filler.blob0.val;
data->filler.blob0.val = NULL;
if (check_nfs4_error(nfs, status, data, res, "OPEN_CONFIRM")) {
free_nfs4_cb_data(data);
return;
}
data->cb(0, nfs, NULL, data->private_data);
nfs_free_nfsfh(nfsfh);
free_nfs4_cb_data(data);
}
int
nfs4_close_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
void *private_data)
{
COMPOUND4args args;
nfs_argop4 op[3];
PUTFH4args *pfargs;
COMMIT4args *coargs;
CLOSE4args *clargs;
struct nfs4_cb_data *data;
data = malloc(sizeof(*data));
if (data == NULL) {
nfs_set_error(nfs, "Out of memory. Failed to allocate "
"cb data");
return -1;
}
memset(data, 0, sizeof(*data));
data->nfs = nfs;
data->cb = cb;
data->private_data = private_data;
memset(op, 0, sizeof(op));
op[0].argop = OP_PUTFH;
pfargs = &op[0].nfs_argop4_u.opputfh;
pfargs->object.nfs_fh4_len = nfsfh->fh.len;
pfargs->object.nfs_fh4_val = nfsfh->fh.val;
op[1].argop = OP_COMMIT;
coargs = &op[1].nfs_argop4_u.opcommit;
coargs->offset = 0;
coargs->count = 0;
op[2].argop = OP_CLOSE;
clargs = &op[2].nfs_argop4_u.opclose;
clargs->seqid = nfs->seqid++;
clargs->open_stateid.seqid = nfsfh->stateid.seqid;
memcpy(clargs->open_stateid.other, nfsfh->stateid.other, 12);
data->filler.blob0.val = nfsfh;
memset(&args, 0, sizeof(args));
args.argarray.argarray_len = sizeof(op) / sizeof(nfs_argop4);
args.argarray.argarray_val = op;
if (rpc_nfs4_compound_async(nfs->rpc, nfs4_close_cb, &args,
data) != 0) {
data->filler.blob0.val = NULL;
free_nfs4_cb_data(data);
return -1;
}
return 0;
}

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic fstat test"
echo "NFSv${VERS} Basic nfs_fstat64() test."
start_share
@ -10,7 +10,7 @@ dd if=/dev/zero of=testdata/testfile count=1 bs=32768 2>/dev/null
chmod 644 testdata/testfile
echo -n "test nfs_fstat64() ... "
./prog_fstat "${TESTURL}/" "." testfile > "${TESTDIR}/output" || failure
./prog_fstat "${TESTURL}/?version=${VERS}" "." testfile > "${TESTDIR}/output" || failure
success
echo -n "test nfs_ino ... "

View File

@ -2,37 +2,37 @@
. ./functions.sh
echo "basic nfs_fstat64() test"
echo "NFSv${VERS} Basic nfs_fstat64() test."
start_share
mkdir "${TESTDIR}/subdir"
mkdir "${TESTDIR}/subdir2"
echo -n "Test nfs_fstat64() for a root file (abs) (1)... "
echo -n "test nfs_fstat64() for a root file (abs) (1)... "
touch "${TESTDIR}/fstat1"
./prog_fstat "${TESTURL}/" "." /fstat1 >/dev/null || failure
./prog_fstat "${TESTURL}/?version=${VERS}" "." /fstat1 >/dev/null || failure
success
echo -n "Test nfs_fstat64() for a root file (rel) (2)... "
./prog_fstat "${TESTURL}/" "." fstat1 >/dev/null || failure
echo -n "test nfs_fstat64() for a root file (rel) (2)... "
./prog_fstat "${TESTURL}/?version=${VERS}" "." fstat1 >/dev/null || failure
success
echo -n "Test nfs_fstat64() for a subdir file (abs) (3)... "
echo -n "test nfs_fstat64() for a subdir file (abs) (3)... "
touch "${TESTDIR}/subdir/fstat3"
./prog_fstat "${TESTURL}/" "." /subdir/fstat3 >/dev/null || failure
./prog_fstat "${TESTURL}/?version=${VERS}" "." /subdir/fstat3 >/dev/null || failure
success
echo -n "Test nfs_fstat64() for a subdir file (rel) (4)... "
./prog_fstat "${TESTURL}/" "." subdir/fstat3 >/dev/null || failure
echo -n "test nfs_fstat64() for a subdir file (rel) (4)... "
./prog_fstat "${TESTURL}/?version=${VERS}" "." subdir/fstat3 >/dev/null || failure
success
echo -n "Test nfs_fstat64() from a different cwd (rel) (5)... "
./prog_fstat "${TESTURL}/" "subdir2" ../subdir/fstat3 >/dev/null || failure
echo -n "test nfs_fstat64() from a different cwd (rel) (5)... "
./prog_fstat "${TESTURL}/?version=${VERS}" "subdir2" ../subdir/fstat3 >/dev/null || failure
success
echo -n "Test nfs_fstat64() outside the share (rel) (6)... "
./prog_fstat "${TESTURL}/" "subdir2" ../../subdir/fstat3 >/dev/null 2>&1 && failure
echo -n "test nfs_fstat64() outside the share (rel) (6)... "
./prog_fstat "${TESTURL}/?version=${VERS}" "subdir2" ../../subdir/fstat3 >/dev/null 2>&1 && failure
success
stop_share

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic valgrind leak check for nfs_fstat64()"
echo "NFSv${VERS} Basic valgrind leak check for nfs_fstat64()."
start_share
@ -12,28 +12,28 @@ mkdir "${TESTDIR}/subdir2"
echo -n "test nfs_fstat64() (1) ... "
touch "${TESTDIR}/fstat1"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/" "." /fstat1 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/?version=${VERS}" "." /fstat1 >/dev/null 2>&1 || failure
success
echo -n "test nfs_fstat64() (2) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/" "." fstat1 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/?version=${VERS}" "." fstat1 >/dev/null 2>&1 || failure
success
echo -n "test nfs_fstat64() (3) ... "
touch "${TESTDIR}/subdir/fstat3"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/" "." /subdir/fstat3 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/?version=${VERS}" "." /subdir/fstat3 >/dev/null 2>&1 || failure
success
echo -n "test nfs_fstat64() (4) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/" "." subdir/fstat3 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/?version=${VERS}" "." subdir/fstat3 >/dev/null 2>&1 || failure
success
echo -n "test nfs_fstat64() (5) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/" "subdir2" ../subdir/fstat3 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/?version=${VERS}" "subdir2" ../subdir/fstat3 >/dev/null 2>&1 || failure
success
echo -n "test nfs_fstat64() (6) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/" "subdir2" ../../subdir/fstat3 2>/dev/null || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_fstat "${TESTURL}/?version=${VERS}" "subdir2" ../../subdir/fstat3 2>/dev/null || expr $? != 99 >/dev/null || failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic open path tests"
echo "NFSv${VERS} Basic open path tests."
start_share
@ -11,52 +11,52 @@ mkdir "${TESTDIR}/subdir2"
echo -n "Open a file in root (abs) (1) ... "
echo -n "kangabanga" > "${TESTDIR}/open1"
./prog_open_read "${TESTURL}/" "." /open1 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." /open1 O_RDONLY >/dev/null || failure
success
echo -n "Open a file in root (rel) (2) ... "
./prog_open_read "${TESTURL}/" "." open1 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." open1 O_RDONLY >/dev/null || failure
success
echo -n "Open a file in a subdir (abs) (3) ... "
echo -n "kangabanga" > "${TESTDIR}/subdir/open3"
./prog_open_read "${TESTURL}/" "." /subdir/open3 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." /subdir/open3 O_RDONLY >/dev/null || failure
success
echo -n "Open a file in root (rel) (4) ... "
./prog_open_read "${TESTURL}/" "." subdir/open3 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir/open3 O_RDONLY >/dev/null || failure
success
echo -n "Open a file from a different cwd (rel) (5) ... "
./prog_open_read "${TESTURL}/" "subdir2" ../subdir/open3 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "subdir2" ../subdir/open3 O_RDONLY >/dev/null || failure
success
echo -n "Open a file outside the share (rel) (5) ... "
./prog_open_read "${TESTURL}/" "subdir2" ../../subdir/open3 O_RDONLY >/dev/null 2>&1 && failure
./prog_open_read "${TESTURL}/?version=${VERS}" "subdir2" ../../subdir/open3 O_RDONLY >/dev/null 2>&1 && failure
success
echo -n "Create a directory symlink (rel) (6) ... "
./prog_symlink "${TESTURL}/" "." subdir /subdir4 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "." subdir /subdir4 || failure
success
echo -n "Open a file in a symlinked subdir (rel) (7) ... "
./prog_open_read "${TESTURL}/" "." subdir4/open3 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir4/open3 O_RDONLY >/dev/null || failure
success
echo -n "Create a file symlink (rel) (8) ... "
./prog_symlink "${TESTURL}/" "." open3 /subdir4/open8 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "." open3 /subdir4/open8 || failure
success
echo -n "Open a symlinked file (rel) (9) ... "
./prog_open_read "${TESTURL}/" "." subdir4/open8 O_RDONLY >/dev/null || failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir4/open8 O_RDONLY >/dev/null || failure
success
echo -n "Open a symlinked path with O_NOFOLLOW (rel) (10) ... "
./prog_open_read "${TESTURL}/" "." subdir4/open3 O_RDONLY,O_NOFOLLOW 2>/dev/null && failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir4/open3 O_RDONLY,O_NOFOLLOW 2>/dev/null && failure
success
echo -n "Open a symlinked file with O_NOFOLLOW (rel) (11) ... "
./prog_open_read "${TESTURL}/" "." subdir/open8 O_RDONLY,O_NOFOLLOW 2>/dev/null && failure
./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir/open8 O_RDONLY,O_NOFOLLOW 2>/dev/null && failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic valgrind leak check for nfs_open()"
echo "NFSv${VERS} Basic valgrind leak check for nfs_open()."
start_share
@ -12,28 +12,28 @@ mkdir "${TESTDIR}/subdir2"
echo -n "test nfs_open() (1) ... "
echo -n "kangabanga" > "${TESTDIR}/open1"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/" "." /open1 O_RDONLY >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." /open1 O_RDONLY >/dev/null 2>&1 || failure
success
echo -n "test nfs_open() (2) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/" "." open1 O_RDONLY >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." open1 O_RDONLY >/dev/null 2>&1 || failure
success
echo -n "test nfs_open() (3) ... "
echo -n "kangabanga" > "${TESTDIR}/subdir/open3"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/" "." /subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." /subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
success
echo -n "test nfs_open() (4) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/" "." subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
success
echo -n "test nfs_open() (5) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/" "subdir2" ../subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "subdir2" ../subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
success
echo -n "test nfs_open() (6) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/" "subdir2" ../../subdir/open3 O_RDONLY 2>/dev/null || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "subdir2" ../../subdir/open3 O_RDONLY 2>/dev/null || expr $? != 99 >/dev/null || failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic creat path tests"
echo "NFSv${VERS} Basic creat path tests."
start_share
@ -10,11 +10,11 @@ mkdir "${TESTDIR}/subdir"
mkdir "${TESTDIR}/subdir2"
echo -n "Create a file in root (abs) (1) ... "
./prog_create "${TESTURL}/" "." /creat1 0750 || failure
./prog_create "${TESTURL}/?version=${VERS}" "." /creat1 0750 || failure
success
echo -n "Stat the new file ... "
./prog_stat "${TESTURL}/" "." creat1 > "${TESTDIR}/output" || failure
./prog_stat "${TESTURL}/?version=${VERS}" "." creat1 > "${TESTDIR}/output" || failure
success
echo -n "Verifying it is a regular file ... "
@ -22,27 +22,27 @@ grep "nfs_mode:100750" "${TESTDIR}/output" >/dev/null || failure
success
echo -n "Remove the file ... "
./prog_unlink "${TESTURL}/" "." /creat1 || failure
./prog_unlink "${TESTURL}/?version=${VERS}" "." /creat1 || failure
success
echo -n "Create a file in root (rel) (2) ... "
./prog_create "${TESTURL}/" "." creat2 0750 || failure
./prog_create "${TESTURL}/?version=${VERS}" "." creat2 0750 || failure
success
echo -n "Create a file in subdirectory (abs) (3) ... "
./prog_create "${TESTURL}/" "." /subdir/creat3 0750 || failure
./prog_create "${TESTURL}/?version=${VERS}" "." /subdir/creat3 0750 || failure
success
echo -n "Create a file in subdirectory (rel) (4) ... "
./prog_create "${TESTURL}/" "." subdir/creat4 0750 || failure
./prog_create "${TESTURL}/?version=${VERS}" "." subdir/creat4 0750 || failure
success
echo -n "Create a file from a different cwd (rel) (5) ... "
./prog_create "${TESTURL}/" "subdir" ../subdir2/creat5 0750 || failure
./prog_create "${TESTURL}/?version=${VERS}" "subdir" ../subdir2/creat5 0750 || failure
success
echo -n "Create a file outside the share (rel) (6) ... "
./prog_create "${TESTURL}/" "subdir" ../../subdir2/creat6 0750 2>/dev/null && failure
./prog_create "${TESTURL}/?version=${VERS}" "subdir" ../../subdir2/creat6 0750 2>/dev/null && failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic link test"
echo "NFSv${VERS} Basic link test."
start_share
@ -11,47 +11,47 @@ mkdir "${TESTDIR}/subdir2"
echo "kangabanga" > "${TESTDIR}/testfile"
echo -n "Link a root path (abs -> abs) (1) ... "
./prog_link "${TESTURL}/" "." /testfile /link1 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." /testfile /link1 || failure
success
echo -n "Link a root path (abs -> rel) (2) ... "
./prog_link "${TESTURL}/" "." /testfile link2 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." /testfile link2 || failure
success
echo -n "Link a root path (rel -> abs) (3) ... "
./prog_link "${TESTURL}/" "." testfile /link3 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." testfile /link3 || failure
success
echo -n "Link a root path (rel -> rel) (4) ... "
./prog_link "${TESTURL}/" "." testfile link4 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." testfile link4 || failure
success
echo -n "Link a subdir path (abs -> abs) (5) ... "
./prog_link "${TESTURL}/" "." /testfile /subdir/link5 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." /testfile /subdir/link5 || failure
success
echo -n "Link a subdir path (abs -> rel) (6) ... "
./prog_link "${TESTURL}/" "." /subdir/link5 subdir2/link6 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." /subdir/link5 subdir2/link6 || failure
success
echo -n "Link a subdir path (rel -> abs) (7) ... "
./prog_link "${TESTURL}/" "." subdir/link5 /subdir2/link7 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." subdir/link5 /subdir2/link7 || failure
success
echo -n "Link a subdir path (rel -> rel) (8) ... "
./prog_link "${TESTURL}/" "." subdir2/link7 subdir/link8 || failure
./prog_link "${TESTURL}/?version=${VERS}" "." subdir2/link7 subdir/link8 || failure
success
echo -n "Link from a different cwd (rel -> rel) (9) ... "
./prog_link "${TESTURL}/" "subdir2" link7 ../subdir/link9 || failure
./prog_link "${TESTURL}/?version=${VERS}" "subdir2" link7 ../subdir/link9 || failure
success
echo -n "Link from outside the share (rel -> rel) (10) ... "
./prog_link "${TESTURL}/" "subdir2" ../../link7 ../subdir/link10 2>/dev/null && failure
./prog_link "${TESTURL}/?version=${VERS}" "subdir2" ../../link7 ../subdir/link10 2>/dev/null && failure
success
echo -n "Link to outside the share (rel -> rel) (11) ... "
./prog_link "${TESTURL}/" "subdir2" link7 ../../subdir/link11 2>/dev/null && failure
./prog_link "${TESTURL}/?version=${VERS}" "subdir2" link7 ../../subdir/link11 2>/dev/null && failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic valgrind leak check for nfs_link()"
echo "NFSv${VERS} Basic valgrind leak check for nfs_link()."
start_share
@ -12,47 +12,47 @@ mkdir "${TESTDIR}/subdir2"
echo "kangabanga" > "${TESTDIR}/testfile"
echo -n "test nfs_link() (1) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." /testfile /link1 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." /testfile /link1 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (2) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." /testfile link2 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." /testfile link2 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (3) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." testfile /link3 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." testfile /link3 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (4) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." testfile link4 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." testfile link4 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (5) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." /testfile /subdir/link5 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." /testfile /subdir/link5 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (6) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." /subdir/link5 subdir2/link6 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." /subdir/link5 subdir2/link6 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (7) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." subdir/link5 /subdir2/link7 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." subdir/link5 /subdir2/link7 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (8) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "." subdir2/link7 /subdir/link8 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "." subdir2/link7 /subdir/link8 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (9) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "subdir2" link7 ../subdir/link9 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "subdir2" link7 ../subdir/link9 >/dev/null 2>&1 || failure
success
echo -n "test nfs_link() (10) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "subdir2" ../../link7 ../subdir/link10 2>/dev/null || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "subdir2" ../../link7 ../subdir/link10 2>/dev/null || expr $? != 99 >/dev/null || failure
success
echo -n "test nfs_link() (11) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/" "subdir2" link7 ../../subdir/link11 2>/dev/null || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_link "${TESTURL}/?version=${VERS}" "subdir2" link7 ../../subdir/link11 2>/dev/null || expr $? != 99 >/dev/null || failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic rename test"
echo "NFSv${VERS} Basic rename test."
start_share
@ -11,7 +11,7 @@ mkdir "${TESTDIR}/subdir2"
echo -n "Rename a root path (abs -> abs) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
./prog_rename "${TESTURL}/" "." /testfile /renamed1 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." /testfile /renamed1 || failure
success
echo -n "Verify the new path ... "
@ -20,7 +20,7 @@ success
echo -n "Rename a root path (rel -> abs) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
./prog_rename "${TESTURL}/" "." testfile /renamed2 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." testfile /renamed2 || failure
success
echo -n "Verify the new path ... "
@ -29,7 +29,7 @@ success
echo -n "Rename a root path (rel -> rel) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
./prog_rename "${TESTURL}/" "." testfile renamed3 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." testfile renamed3 || failure
success
echo -n "Verify the new path ... "
@ -38,7 +38,7 @@ success
echo -n "Rename a root path (abs -> rel) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
./prog_rename "${TESTURL}/" "." /testfile renamed4 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." /testfile renamed4 || failure
success
echo -n "Verify the new path ... "
@ -49,7 +49,7 @@ success
echo -n "Rename a subdir path (abs -> abs) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "." /subdir/testfile /subdir/renamed5 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile /subdir/renamed5 || failure
success
echo -n "Verify the new path ... "
@ -58,7 +58,7 @@ success
echo -n "Rename a subdir path (rel -> abs) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "." subdir/testfile /subdir/renamed6 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." subdir/testfile /subdir/renamed6 || failure
success
echo -n "Verify the new path ... "
@ -67,7 +67,7 @@ success
echo -n "Rename a subdir path (rel -> rel) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "." subdir/testfile subdir/renamed7 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." subdir/testfile subdir/renamed7 || failure
success
echo -n "Verify the new path ... "
@ -76,7 +76,7 @@ success
echo -n "Rename a subdir path (abs -> rel) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "." /subdir/testfile subdir/renamed8 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile subdir/renamed8 || failure
success
echo -n "Verify the new path ... "
@ -85,7 +85,7 @@ success
echo -n "Rename a subdir path to a different dir (rel -> rel) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "." /subdir/testfile subdir2/renamed9 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile subdir2/renamed9 || failure
success
echo -n "Verify the new path ... "
@ -94,16 +94,16 @@ success
echo -n "Rename from different cwd ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "subdir" ./testfile ../subdir2/renamed10 || failure
./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ./testfile ../subdir2/renamed10 || failure
success
echo -n "Rename from outside share ... "
./prog_rename "${TESTURL}/" "subdir" ../../testfile ../subdir2/renamed11 2>/dev/null && failure
./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ../../testfile ../subdir2/renamed11 2>/dev/null && failure
success
echo -n "Rename to outside share ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
./prog_rename "${TESTURL}/" "subdir" ./testfile ../../subdir2/renamed12 2>/dev/null && failure
./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ./testfile ../../subdir2/renamed12 2>/dev/null && failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic valgrind leak check for nfs_rename()"
echo "NFSv${VERS} Basic valgrind leak check for nfs_rename()."
start_share
@ -12,61 +12,61 @@ mkdir "${TESTDIR}/subdir2"
echo -n "test nfs_rename() (1) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /testfile /renamed1 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /testfile /renamed1 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (2) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." testfile /renamed2 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." testfile /renamed2 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (3) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." testfile renamed3 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." testfile renamed3 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (4) ... "
echo "kangabanga" > "${TESTDIR}/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /testfile renamed4 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /testfile renamed4 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (5) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /subdir/testfile /subdir/renamed5 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile /subdir/renamed5 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (6) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." subdir/testfile /subdir/renamed6 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." subdir/testfile /subdir/renamed6 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (7) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." subdir/testfile subdir/renamed7 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." subdir/testfile subdir/renamed7 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (8) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /subdir/testfile subdir/renamed8 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile subdir/renamed8 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (9) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /subdir/testfile subdir2/renamed9 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile subdir2/renamed9 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (10) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "subdir" ./testfile ../subdir2/renamed10 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ./testfile ../subdir2/renamed10 >/dev/null 2>&1 || failure
success
echo -n "test nfs_rename() (11) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/" "subdir" ../../testfile ../subdir2/renamed11 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ../../testfile ../subdir2/renamed11 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure
success
echo -n "test nfs_rename() (12) ... "
echo "kangabanga" > "${TESTDIR}/subdir/testfile"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/" "subdir" ./testfile ../../subdir2/renamed12 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ./testfile ../../subdir2/renamed12 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure
success

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic symlink test"
echo "NFSv${VERS} Basic symlink test."
start_share
@ -10,7 +10,7 @@ mkdir "${TESTDIR}/subdir"
mkdir "${TESTDIR}/subdir2"
echo -n "Create a symlink in root (abs) (1) ... "
./prog_symlink "${TESTURL}/" "." kangabanga /symlink1 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "." kangabanga /symlink1 || failure
success
echo -n "Verify the link ... "
@ -18,7 +18,7 @@ ls -l "${TESTDIR}/symlink1" | egrep "\-> kangabanga$" >/dev/null || failure
success
echo -n "Create a symlink in root (rel) (2) ... "
./prog_symlink "${TESTURL}/" "." kangabanga symlink2 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "." kangabanga symlink2 || failure
success
echo -n "Verify the link ... "
@ -26,7 +26,7 @@ ls -l "${TESTDIR}/symlink2" | egrep "\-> kangabanga$" >/dev/null || failure
success
echo -n "Create a symlink from a subdir (abs) (3) ... "
./prog_symlink "${TESTURL}/" "." kangabanga /subdir/symlink3 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "." kangabanga /subdir/symlink3 || failure
success
echo -n "Verify the link ... "
@ -34,7 +34,7 @@ ls -l "${TESTDIR}/subdir/symlink3" | egrep "\-> kangabanga$" >/dev/null || failu
success
echo -n "Create a symlink from a subdir (rel) (4) ... "
./prog_symlink "${TESTURL}/" "." kangabanga subdir/symlink4 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "." kangabanga subdir/symlink4 || failure
success
echo -n "Verify the link ... "
@ -42,7 +42,7 @@ ls -l "${TESTDIR}/subdir/symlink4" | egrep "\-> kangabanga$" >/dev/null || failu
success
echo -n "Create a symlink from a subdir (rel) (5) ... "
./prog_symlink "${TESTURL}/" "/subdir" kangabanga symlink5 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "/subdir" kangabanga symlink5 || failure
success
echo -n "Verify the link ... "
@ -50,7 +50,7 @@ ls -l "${TESTDIR}/subdir/symlink5" | egrep "\-> kangabanga$" >/dev/null || failu
success
echo -n "Create a symlink in a parent directory (rel) (6) ... "
./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../symlink6 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "/subdir" kangabanga ../symlink6 || failure
success
echo -n "Verify the link ... "
@ -58,7 +58,7 @@ ls -l "${TESTDIR}/symlink6" | egrep "\-> kangabanga$" >/dev/null || failure
success
echo -n "Create a symlink from different cwd (rel) (7) ... "
./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../subdir2/symlink7 || failure
./prog_symlink "${TESTURL}/?version=${VERS}" "/subdir" kangabanga ../subdir2/symlink7 || failure
success
echo -n "Verify the link ... "
@ -66,7 +66,7 @@ ls -l "${TESTDIR}/subdir2/symlink7" | egrep "\-> kangabanga$" >/dev/null || fail
success
echo -n "Create a symlink outside the share (rel) (8) ... "
./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../../symlink8 2>/dev/null && failure
./prog_symlink "${TESTURL}/?version=${VERS}" "/subdir" kangabanga ../../symlink8 2>/dev/null && failure
success
stop_share

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic nfs_unlink() test"
echo "NFSv${VERS} Basic nfs_unlink() test."
start_share
@ -11,35 +11,35 @@ mkdir "${TESTDIR}/subdir2"
echo -n "Unlink a file from the root (abs) (1)... "
touch "${TESTDIR}/unlink"
./prog_unlink "${TESTURL}/" "." /unlink || failure
./prog_unlink "${TESTURL}/?version=${VERS}" "." /unlink || failure
success
echo -n "Verify the file is gone ... "
./prog_stat "${TESTURL}/" "." unlink 2>/dev/null && failure
./prog_stat "${TESTURL}/?version=${VERS}" "." unlink 2>/dev/null && failure
success
echo -n "Unlink a file from the root (rel) (2)... "
touch "${TESTDIR}/unlink"
./prog_unlink "${TESTURL}/" "." unlink || failure
./prog_unlink "${TESTURL}/?version=${VERS}" "." unlink || failure
success
echo -n "Unlink a file from a subdir (abs) (3)... "
touch "${TESTDIR}/subdir/unlink"
./prog_unlink "${TESTURL}/" "." /subdir/unlink || failure
./prog_unlink "${TESTURL}/?version=${VERS}" "." /subdir/unlink || failure
success
echo -n "Unlink a file from a subdir (rel) (4)... "
touch "${TESTDIR}/subdir/unlink"
./prog_unlink "${TESTURL}/" "." subdir/unlink || failure
./prog_unlink "${TESTURL}/?version=${VERS}" "." subdir/unlink || failure
success
echo -n "Unlink a file from a different dir (rel) (5)... "
touch "${TESTDIR}/subdir2/unlink"
./prog_unlink "${TESTURL}/" "subdir" ../subdir2/unlink || failure
./prog_unlink "${TESTURL}/?version=${VERS}" "subdir" ../subdir2/unlink || failure
success
echo -n "Unlink a file from outside the share (rel) (6)... "
./prog_unlink "${TESTURL}/" "subdir" ../../subdir2/unlink 2>/dev/null && failure
./prog_unlink "${TESTURL}/?version=${VERS}" "subdir" ../../subdir2/unlink 2>/dev/null && failure
success
stop_share

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic valgrind leak check for nfs_unlink()"
echo "NFSv${VERS} Basic valgrind leak check for nfs_unlink()."
start_share
@ -12,31 +12,31 @@ mkdir "${TESTDIR}/subdir2"
echo -n "test nfs_unlink() (1) ... "
touch "${TESTDIR}/unlink"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." /unlink 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/?version=${VERS}" "." /unlink 2>/dev/null || failure
success
echo -n "test nfs_unlink() (2) ... "
touch "${TESTDIR}/unlink"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." unlink 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/?version=${VERS}" "." unlink 2>/dev/null || failure
success
echo -n "test nfs_unlink() (3) ... "
touch "${TESTDIR}/subdir/unlink"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." /subdir/unlink 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/?version=${VERS}" "." /subdir/unlink 2>/dev/null || failure
success
echo -n "test nfs_unlink() (4) ... "
touch "${TESTDIR}/subdir/unlink"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." subdir/unlink 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/?version=${VERS}" "." subdir/unlink 2>/dev/null || failure
success
echo -n "test nfs_unlink() (5) ... "
touch "${TESTDIR}/subdir2/unlink"
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "subdir" ../subdir2/unlink 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/?version=${VERS}" "subdir" ../subdir2/unlink 2>/dev/null || failure
success
echo -n "test nfs_unlink() (6) ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "subdir" ../../subdir2/unlink 2>/dev/null || expr $? != 99 >/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/?version=${VERS}" "subdir" ../../subdir2/unlink 2>/dev/null || expr $? != 99 >/dev/null || failure
success

View File

@ -5,7 +5,7 @@
. ./functions.sh
echo "basic mknod test"
echo "NFSv${VERS} Basic mknod test."
start_share
@ -13,11 +13,11 @@ mkdir "${TESTDIR}/subdir"
mkdir "${TESTDIR}/subdir2"
echo -n "Create a chrdev in the root (abs) (1)... "
./prog_mknod "${TESTURL}/?uid=0" "." /mknod1 020755 0x1234 || failure
./prog_mknod "${TESTURL}/?uid=0&version=${VERS}" "." /mknod1 020755 0x1234 || failure
success
echo -n "Stat the node ... "
./prog_stat "${TESTURL}/" "." mknod1 > "${TESTDIR}/output" || failure
./prog_stat "${TESTURL}/?version=${VERS}" "." mknod1 > "${TESTDIR}/output" || failure
success
echo -n "Testing nfs_mode and verify it is a CHRDEV ... "
@ -25,23 +25,23 @@ grep "nfs_mode:20755" "${TESTDIR}/output" >/dev/null || failure
success
echo -n "Create a chrdev in the root (rel) (2)... "
./prog_mknod "${TESTURL}/?uid=0" "." mknod2 020775 0x1234 || failure
./prog_mknod "${TESTURL}/?uid=0&version=${VERS}" "." mknod2 020775 0x1234 || failure
success
echo -n "Create a chrdev in a subdirectory (abs) (3)... "
./prog_mknod "${TESTURL}/?uid=0" "." /subdir/mknod3 020775 0x1234 || failure
./prog_mknod "${TESTURL}/?uid=0&version=${VERS}" "." /subdir/mknod3 020775 0x1234 || failure
success
echo -n "Create a chrdev in a subdirectory (abs) (4)... "
./prog_mknod "${TESTURL}/?uid=0" "." subdir/mknod4 020775 0x1234 || failure
./prog_mknod "${TESTURL}/?uid=0&version=${VERS}" "." subdir/mknod4 020775 0x1234 || failure
success
echo -n "Create a chrdev from a different cwd (abs) (5)... "
./prog_mknod "${TESTURL}/?uid=0" "subdir" ../subdir2/mknod5 020775 0x1234 || failure
./prog_mknod "${TESTURL}/?uid=0&version=${VERS}" "subdir" ../subdir2/mknod5 020775 0x1234 || failure
success
echo -n "Create a chrdev outside the share (abs) (6)... "
./prog_mknod "${TESTURL}/?uid=0" "." ../subdir2/mknod6 020775 0x1234 2>/dev/null && failure
./prog_mknod "${TESTURL}/?uid=0&version=${VERS}" "." ../subdir2/mknod6 020775 0x1234 2>/dev/null && failure
success
stop_share

View File

@ -2,14 +2,14 @@
. ./functions.sh
echo "basic timeout test"
echo "NFSv${VERS} Basic timeout test."
start_share
touch "${TESTDIR}/testfile"
for IDX in `seq 1 28`; do
echo -n "Test timeout at socket event ${IDX} ... "
TIMEOUT_START=${IDX} LD_PRELOAD=./ld_timeout.so ./prog_stat "${TESTURL}/" "." testfile >/dev/null 2>&1 && failure
TIMEOUT_START=${IDX} LD_PRELOAD=./ld_timeout.so ./prog_stat "${TESTURL}/?version=${VERS}" "." testfile >/dev/null 2>&1 && failure
success
done

View File

@ -2,7 +2,7 @@
. ./functions.sh
echo "basic valgrind leak check"
echo "NFSv${VERS} Basic valgrind leak check."
start_share
@ -17,43 +17,43 @@ done
success
echo -n "Testing server discovery for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-ls -D nfs:// > "${TESTDIR}/output" 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-ls -D nfs:// > "${TESTDIR}/output?version=${VERS}" 2>/dev/null || failure
success
echo -n "Testing share enumeration for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-ls -D nfs://127.0.0.1 > "${TESTDIR}/output" 2>/dev/null || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-ls -D nfs://127.0.0.1 > "${TESTDIR}/output?version=${VERS}" 2>/dev/null || failure
success
echo -n "test nfs-ls for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-ls "${TESTURL}" >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-ls "${TESTURL}?version=${VERS}" >/dev/null 2>&1 || failure
success
echo -n "test nfs-cp for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-cp "${TESTURL}/file.99" "${TESTURL}/copy-of-file.99" >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../utils/nfs-cp "${TESTURL}/file.99?version=${VERS}" "${TESTURL}/copy-of-file.99" >/dev/null 2>&1 || failure
success
echo -n "test nfs_truncate() for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io trunc "${TESTURL}/copy-of-file.99" >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io trunc "${TESTURL}/copy-of-file.99?version=${VERS}" >/dev/null 2>&1 || failure
success
echo -n "test nfs_unlink() for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io unlink "${TESTURL}/copy-of-file.99" >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io unlink "${TESTURL}/copy-of-file.99?version=${VERS}" >/dev/null 2>&1 || failure
success
echo -n "test nfs_mkdir() for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io mkdir "${TESTURL}/testdir" >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io mkdir "${TESTURL}/testdir?version=${VERS}" >/dev/null 2>&1 || failure
success
echo -n "test nfs_rmdir() for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io rmdir "${TESTURL}/testdir" >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ../examples/nfs-io rmdir "${TESTURL}/testdir?version=${VERS}" >/dev/null 2>&1 || failure
success
echo -n "test nfs_stat64() for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_stat "${TESTURL}/" "." file.99 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_stat "${TESTURL}/?version=${VERS}" "." file.99 >/dev/null 2>&1 || failure
success
echo -n "test nfs_fstat64() for memory leaks ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_fstat "${TESTURL}/" "." file.99 >/dev/null 2>&1 || failure
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_fstat "${TESTURL}/?version=${VERS}" "." file.99 >/dev/null 2>&1 || failure
success

View File

@ -2,14 +2,14 @@
. ./functions.sh
echo "basic valgrind check of timeout handling"
echo "NFSv${VERS} Basic valgrind check of timeout handling."
start_share
touch "${TESTDIR}/testfile"
for IDX in `seq 1 28`; do
echo -n "Test memory leaks at socket event ${IDX} ... "
TIMEOUT_START=${IDX} LD_PRELOAD=./ld_timeout.so libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_timeout "${TESTURL}/testfile" >/dev/null 2>&1 || failure
TIMEOUT_START=${IDX} LD_PRELOAD=./ld_timeout.so libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_timeout "${TESTURL}/testfile?version=${VERS}" >/dev/null 2>&1 || failure
success
done