GFAL Test Plan
Grid File Access Library, is an LCG-proposed POSIX interface for the normal file I/O operations (Open/Seek/Read/Write/Close) which includes a limited set of POSIX functions for file management. The GFAL interface is designed to hide the grid storage interactions (replica catalog, SRM and file access mechanism) from user applications. It consists of the Grid File Access Library, and a File System built on top of this library, which will support internally diverse file access protocols (e.g., file: rfio: dcap: root:).
Note: SE implementations (
DPM, dCache, Castor,
StoRM) may have slightly different behaviour, and different error messages. Hence, it isn't always possible for GFAL to convert to the correct errno value, depending on the error message returned by the SE.
There are not possible check correctly errno value in these cases. We check only general code of error.
Note: Classic SEs aren't officially supported, so these tests use SRMv2 SEs.
GFAL Python API Interface
This is the list of the available commands,
in parenthesis we state whether the relative test is present or missing:
gfal_abortfiles (SRMv2 only!)
gfal_abortrequest (no)
gfal_access_python (ok)
gfal_bringonline_python (ok)
gfal_chmod_python (supported for LFN and TURL only)
gfal_close_python (ok)
gfal_closedir_python (supported for LFN and TURL only)
gfal_creat_python (ok)
gfal_deletesurls_python (ok)
gfal_get_python (ok)
gfal_get_ids_python (no)
gfal_getstatus_python (ok)
gfal_ls_python (ok)
gfal_lseek_python (ok)
gfal_mkdir_python (ok)
gfal_open_python (ok)
gfal_opendir_python (supported for LFN and TURL only)
gfal_pin_python (ok)
gfal_prestage_python (ok)
gfal_prestagestatus_python (ok)
gfal_read_python (ok)
gfal_readdir_python (supported for LFN and TURL only)
gfal_release_python (ok)
gfal_rename_python (supported for LFN and TURL only)
gfal_rmdir_python (ok)
gfal_stat_python (ok)
gfal_set_xfer_running (ok)
gfal_set_xfer_done (ok)
gfal_turlsfromsurls_python (ok)
gfal_unlink_python (ok)
gfal_write_python (ok)
General Python API tests
All the commands listed above must be tested providing good and bad arguments.
Bad arguments has to return a proper error message and a non zero exit code.
In the following sections we list some specific cases for each command that needs to be considered.
gfal_abortfiles
Check that user can abort selective file requests from asynchronous requests: gfal_get, gfal_prestage.
(int returncode, gfal_internal gfal, string errmsg ) gfal_abortfiles (gfal_internal gfal )
This function needs a list of SURLs (to abort).
Check return value a proper message.
gfal_abortrequest
I have error in test script.
https://savannah.cern.ch/bugs/?53141
gfal_access
Check existence/accessibility of a file/directory on SE.
gfal_access (path, amode)
Checks the existence or the accessibility of the file/directory path according to the bit pattern in amode using the real user ID and return value a proper message.
Amode the bit pattern is built by an OR of the following constants: os.R_OK (read access), os.W_OK (write access), os.X_OK (execute access) or os.F_OK (file existence).
Check errors:
- ENOENT - A component of dirname prefix does not exist.
- EACCES - Search permission is denied on a component of the dirname prefix or write permission on the parent directory is denied.
- EFAULT - dirname is a NULL pointer.
- EINVAL - dirname has an invalid syntax.
The command should report a proper error message
gfal_bringonline
Synchronous function to bring on line a list of SURLs.
(int returncode, gfal_internal gfal, string errmsg ) gfal_bringonline (gfal_internal gfal );
Test checks that user can to bring on line a list of SURLs, in order to allow quicker future acces to them and return value a proper message.
Check errors:
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_chmod
gfal_chmod changes access mode of the file/directory path according to the bit pattern in mode.
gfal_chmod is only supported for LFN and TURL.
Check errors:
- ENOENT - The named file/directory does not exist.
- EACCES - Search permission is denied on a component of the path prefix or specified access to the file itself is denied.
- EFAULT - path is a NULL pointer.
- EINVAL - filename has an invalid syntax.
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_close
gfal_close - close a file
gfal_close (fd);
Check that user can close the file whose descriptor fd is the one returned by gfal_open.
Check errors:
- EBADF - fd is not a valid file descriptor.
The command should report a proper error message
gfal_closedir
gfal_closedir - close a directory
gfal_close (dirp);
Check that user can close the directory opened by gfal_opendir and associated with the DIR structure pointed by dirp.
gfal_closedir is supported for LFN and TURL only.
Check errors:
- EBADF - File descriptor in DIR structure is invalid.
The command should report a proper error message
gfal_creat
gfal_creat - create a new file or truncate an existing one.
gfal_creat (filename, mode);
Check that user can create file and return value a proper message.
Check errors:
- ENOENT - A component of the filename prefix does not exist.
- EACCES - Search permission is denied on a component of the filename prefix or the file does not exist and write permission on the parent directory is denied or the file exists and write permission on the file itself is denied.
- EFAULT - filename is a NULL pointer.
- EINVAL filename has an invalid syntax.
The command should report a proper error message
gfal_deletesurls
gfal_deletesurls - delete a list of SURLs from a SE
(int returncode, gfal_internal gfal, string errmsg ) gfal_get (gfal_internal gfal );
Check that user can delete a list of SURLs from a SE and return value a proper message.
gfal_get
gfal_get - an asynchronous function to bring list of SURLs on line and get the corresponding TURLs. It is the asynchronous version of gfal_turlsfromsurls.
(int returncode, gfal_internal gfal, string errmsg ) gfal_get (gfal_internal gfal );
Check that user can bring list of SURLs on line and get the corresponding TURLs and return value a proper message.
Check errors:
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_get_ids
Unfortunately, I have no time to check this command.
gfal_getstatus
gfal_getstatus - the asynchronous function which must be used to check the status of the gfal_get_python request and get the results.
(int returncode, gfal_internal gfal, string errmsg ) gfal_getstatus (gfal_internal gfal );
Check that user can check the status of the gfal_get_python request.
Check errors:
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_ls
gfal_ls - list SE directory contents
(int returncode, gfal_internal gfal, string errmsg ) gfal_ls (gfal_internal gfal );
The command should report a proper return code
gfal_lseek
gfal_lseek - position a file
gfal_lseek positions/repositions to offset the file associated with the descriptor fd generated by a previous gfal_open.
The command should report a proper return code
gfal_mkdir
Creates the directory.
gfal_mkdir (dirname, mode);
Check that user can create directory and return value a proper message.
Check errors:
- ENOENT - A component of dirname prefix does not exist.
- EACCES - Search permission is denied on a component of the dirname prefix or write permission on the parent directory is denied.
- EFAULT - dirname is a NULL pointer.
- EINVAL - dirname has an invalid syntax.
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message.
gfal_open
Open a file
gfal_open (filename, flags, mode);
Cheks that user can open a file according to the value of flags.
Check errors:
- ENOENT - The named file does not exist.
- EACCES - Search permission is denied on a component of the filename prefix or the file does not exist and write permission on the parent directory is denied or the file exists and flags permission on the file itself is denied.
- EFAULT - filename is a NULL pointer.
- EINVAL - filename has an invalid syntax.
The command should report a proper error message
gfal_opendir
Open a directory
gfal_opendir (dirname);
Cheks that user can open a directory to be used in subsequent gfal_readdir operations.
gfal_opendir is only supported for LFN and TURL.
Check errors:
- ENOENT - The named directory does not exist.
- EACCES - Search permission is denied on a component of the dirname prefix or read permission on the directory itself is denied.
- EFAULT - dirname is a NULL pointer.
- EINVAL - dirname has an invalid syntax.
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_pin
Cheks that user can extends the on-line life time of a list of SURLs.
int gfal_pin (gfal_internal gfal, char *errbuf, int errbufsz);
The command should report a proper error message
gfal_prestage
Asynchronous function to bring on line a list of SURLs.
(int returncode, gfal_internal gfal, string errmsg ) gfal_prestage (gfal_internal gfal );
Test checks that user can to bring on line a list of SURLs, in order to allow quicker future acces to them and return value a proper message.
Check errors:
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_prestagestatus
Asynchronous function to check status of a gfal_prestage request.
(int returncode, gfal_internal gfal, string errmsg ) gfal_prestagestatus (gfal_internal gfal );
Test checks that user can check the status of the gfal_prestage_python request and return value a proper message.
Check errors:
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_read
Read from a file
gfal_read (fd, size);
Cheks that user can read up to size bytes from the file descriptor fd into the buffer pointed by buf.
Check errors:
- EBADF - fd is not a valid file descriptor.
The command should report a proper error message
gfal_readdir
Read a directory
gfal_readdir (dirp);
Cheks that user can read a directory opened by gfal_opendir and associated with the DIR structure pointed by dirp
gfal_readdir is only supported for LFN and TURL.
Check errors:
- EBADF - File descriptor in DIR structure is invalid.
The command should report a proper error message
gfal_release
Releases a list of SURLs. It means that all SURLs in that list which was on-line, will be released, so they will not be on-line anymore.
(int returncode, gfal_internal gfal, string errmsg ) gfal_release (gfal_internal gfal );
Cheks that user can release all SURLs in that list which was on-line.
Check errors:
- EPROTONOSUPPORT - You try to make an action with a protocol which is not supported by the system.
The command should report a proper error message
gfal_rename
Rename a file or a directory
gfal_rename (old_name, new_name);
Cheks that user can rename a file or a directory.
gfal_rename is only supported for LFN and TURL.
Check errors:
- ENOENT - A component of old_name prefix does not exist.
- EACCES - Search permission is denied on a component of the file prefixes or write permission on the parent directories is denied or old_name is a directory and write permission is denied on old_name or new_name.
- EFAULT - old_name or new_name is a NULL pointer.
- EINVAL - old_name or new_name has an invalid syntax.
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_rmdir
Removes the directory
gfal_rmdir (dirname);
Check that user can remove directory and return value a proper message.
Check errors:
- ENOENT - A component of dirname prefix does not exist.
- EACCES - Search permission is denied on a component of the dirname prefix or write permission on the parent directory is denied.
- EFAULT - dirname is a NULL pointer.
- EINVAL - dirname has an invalid syntax.
- EPROTONOSUPPORT - Access method not supported.
The command should report a proper error message
gfal_stat
Get information about a file or directory
gfal_stat (name);
Check that user can get information about a file or directory.
Check errors:
- ENOENT - The named file/directory does not exist.
- EACCES - Search permission is denied on a component of the filename prefix.
- EFAULT - name is a NULL pointer.
- EINVAL - name has an invalid syntax.
The command should report a proper error message
gfal_set_xfer_running
gfal_set_xfer_running Marks a list of SURLs as ’transfert running’.
(int returncode, gfal_internal gfal, string errmsg ) gfal_set_xfer_running (gfal_internal gfal );
Check that marks a list of SURLs as ’transfert running’ and return value a proper message.
gfal_set_xfer_done
gfal_set_xfer_done Marks a list of SURLs as ’transfert completed’.
(int returncode, gfal_internal gfal, string errmsg ) gfal_set_xfer_done (gfal_internal gfal );
Check that marks a list of SURLs as ’transfert completed’ and return value a proper message.
gfal_turlsfromsurls
gfal_turlsfromsurls - converts a list of SURLs into a list of TURLs, according to the list of protocols put in the gfal_request object, or to the default system list.
(int returncode, gfal_internal gfal, string errmsg ) gfal_turlsfromsurls (gfal_internal gfal );
Check that user get TURLs corresponding to SURLs from a SE and return value a proper message.
gfal_unlink
gfal_unlink - remove a file entry
gfal_unlink (filename);
Check that user can removes a file entry.
Check errors:
- ENOENT - The named file does not exist.
- EFAULT - filename is a NULL pointer.
- EINVAL - filename has an invalid syntax.
The command should report a proper error message
gfal_write
gfal_write - write to a file
gfal_write (fd, buf);
Check that user can write buf to the file descriptor fd.
Check errors:
- EBADF - fd is not a valid file descriptor.
The command should report a proper error message
--
GianniPucciani - 16 Jun 2009