plfs / plfs-regression

LANL no longer develops PLFS. Feel free to fork and develop as you wish.
3 stars 5 forks source link

Implement regression test for plfs_access #17

Closed brettkettering closed 12 years ago

brettkettering commented 12 years ago

plfs_access should return 0 for valid plfs_files and directories that exist as well as ancestors of the mount point.

I.e. if the mount point is /mnt/plfs

plfs_acces("/mnt", R_OK); should return 0.

This broke temporarily in 2.2 so we need a test to check this in future releases.

include

include "plfs.h"

int main(int argc, char **argv){

printf("plfs access %s: %d\n","/mnt/plfs/no_exists", plfs_access("/mnt/plfs/no_exists", R_OK));
printf("plfs access %s: %d\n","/mnt/plfs/exists", plfs_access("/mnt/plfs/exists", R_OK));
printf("plfs access %s: %d\n","/mnt/plfs/", plfs_access("/mnt/plfs/", R_OK));
printf("plfs access %s: %d\n","/mnt", plfs_access("/mnt", R_OK));
printf("plfs access %s: %d\n","/tmp", plfs_access("/tmp", R_OK));
return 0;

}

Should return: /mnt/plfs/no_exists -2 /mnt/plfs/exists 0 /mnt/plfs 0 /mnt/ 0 /tmp -22

brettkettering commented 12 years ago

The test has been implemented and checked in.