GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > FILE / V3-11-0

Constituent: tffs_func_test     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

tffs_func_test.c File Reference

Function definitions for TFFS filesystem functional test. More...

#include "vxWorks.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "unistd.h"
#include "ioLib.h"
#include "taskLib.h"
#include "sysLib.h"
#include "usrLib.h"
#include "logLib.h"
#include "dosFsLib.h"
#include "sys/stat.h"
#include "tffs/flbase.h"
#include "tffs/tffsIoctl.h"
#include "PBS/PBS.h"
#include "PBS/MBA.h"
#include "MSG/MSG_pubdefs.h"
#include "MSG/MSG_printProc.h"
#include "FBS/FBS_pubrtos.h"
#include "FILE/tffs_func_test.h"

Include dependency graph for tffs_func_test.c:


Defines

#define TFFS_TEST_DIR_NAME   "dx"
#define TFFS_TEST_FILE_NAME   "fy"
#define PERROR   perror(""); taskDelay(sysClkRateGet())
#define FILE_DATA_SIZE   8000
#define FILE_COPY_SIZE   1000
#define MSG_PRI   210
#define WDOG_RESET

Functions

static int tffs_test_mount (int drv)
static int tffs_test_mkdir (int drv)
static int tffs_test_rmdir (int drv)
static int tffs_test_creat (int drv)
static int tffs_test_copy (int drv, int opCount)
static int tffs_test_rm (int drv)
static int tffs_test_unmount (int drv)
static int file_create (const char *name, const unsigned char *data)
static int file_delete (const char *name)
static int file_copy (const char *inName, const char *outName)
static int file_verify (const char *name, const unsigned char *data)
static void file_stat_print (const char *name, const struct stat *fs)
static void file_err (FLStatus error, int drv, unsigned int offset, int arg)
int tffs_func_test (int drv, unsigned int opCount)

Variables

static unsigned char * file_buf_0
static unsigned char * file_buf_1
static unsigned char * file_buf_2
static unsigned char * file_buf_copy
static unsigned char * file_buf_verify
static const char * dumpLine

Detailed Description

Function definitions for TFFS filesystem functional test.

Author:
D.L. Wood

Define Documentation

#define FILE_COPY_SIZE   1000
 

The size in bytes for file copy transfers.

#define FILE_DATA_SIZE   8000
 

The size in bytes of file test pattern data.

#define MSG_PRI   210
 

The priority of the MSG output task.

#define PERROR   perror(""); taskDelay(sysClkRateGet())
 

Calls system perror() function.

#define TFFS_TEST_DIR_NAME   "dx"
 

The root directory name to use for test directories.

#define TFFS_TEST_FILE_NAME   "fy"
 

The root file name to use for test files.

#define WDOG_RESET
 

Resets the watchdog timer on the RAD750; a no-op for other targets.


Function Documentation

static int file_copy const char *  inName,
const char *  outName
[static]
 

Copies an existing file and verifies that the copy is correct.

Parameters:
inName The original file name.
outName The copied file name.
Return values:
0 Success.
-1 Failure

static int file_create const char *  name,
const unsigned char *  data
[static]
 

Creates a new file and fills it with a data pattern.

Parameters:
name The file name.
data A pointer to the file data buffer.
Return values:
0 Success.
-1 Failure

static int file_delete const char *  name  )  [static]
 

Creates a new file and fills it with a data pattern.

Parameters:
name The file name.
Return values:
0 Success.
-1 Failure

static void file_err FLStatus  error,
int  drv,
unsigned int  offset,
int  arg
[static]
 

The error handler callback for the TFFS EEPROM driver. Simply prints the callback parameters.

Parameters:
error The error code reported by the EEPROM driver.
drv The TFFS drive number.
offset The offset into the EEPROM bank at which the error occurred.
arg Igonored.

static void file_stat_print const char *  name,
const struct stat *  fs
[static]
 

Displays the contents of a file status structure.

Parameters:
name The file name.
fs The file status structure.

static int file_verify const char *  name,
const unsigned char *  data
[static]
 

Verifies that a file contains the correct test pattern data.

Parameters:
name The file name.
data A pointer to the file data buffer.
Return values:
0 Success.
-1 Failure

int tffs_func_test int  drv,
unsigned int  opCount
 

Performs all of the TFFS file system funcional tests.

Parameters:
drv The TFFS drive number to test (0 or 1).
opCount The number of iterations for repeated tests.
Return values:
0 Success.
-1 Failure

static int tffs_test_copy int  drv,
int  opCount
[static]
 

Performs the TFFS file system file copy tests. Copies temporary private files on the partition and verifies the results.

Parameters:
drv The TFFS drive number to test (0 or 1).
opCount The number of times to perform each operation.
Return values:
0 Success.
-1 Failure

static int tffs_test_creat int  drv  )  [static]
 

Performs the TFFS file system file create tests. Creates temporary private files on the partition for running functional tests.

Parameters:
drv The TFFS drive number to test (0 or 1).
Return values:
0 Success.
-1 Failure

static int tffs_test_mkdir int  drv  )  [static]
 

Performs the TFFS file system directory create tests. Creates temporary private directories on the partition for running functional tests.

Parameters:
drv The TFFS drive number to test (0 or 1).
Return values:
0 Success.
-1 Failure

static int tffs_test_mount int  drv  )  [static]
 

Performs the TFFS file system mount tests.

Parameters:
drv The TFFS drive number to test (0 or 1).
Return values:
0 Success.
-1 Failure

static int tffs_test_rm int  drv  )  [static]
 

Performs the TFFS file system file delete tests. Deletes temporary private files on the partition for running functional tests.

Parameters:
drv The TFFS drive number to test (0 or 1).
Return values:
0 Success.
-1 Failure

static int tffs_test_rmdir int  drv  )  [static]
 

Performs the TFFS file system directory delete tests. Deletes temporary private directories on the partition for running functional tests.

Parameters:
drv The TFFS drive number to test (0 or 1).
Return values:
0 Success.
-1 Failure

static int tffs_test_unmount int  drv  )  [static]
 

Performs the TFFS file system unmount tests. Synchronizes and unmounts the partition using FIOUNMOUNT ioctl().

Parameters:
drv The TFFS drive number to test (0 or 1).
Return values:
0 Success.
-1 Failure


Variable Documentation

dumpLine [static]
 

Initial value:

 
        "-------------------------------------------------------------------------------\n"
A separator line for display.

file_buf_0 [static]
 

Buffer holding file 0 data - incrementing pattern.

file_buf_1 [static]
 

Buffer holding file 0 data - 0x55 pattern.

file_buf_2 [static]
 

Buffer holding file 0 data - 0xaa pattern.

file_buf_copy [static]
 

Buffer for holding data during file copies.

file_buf_verify [static]
 

Buffer for holding data during file verification.


Generated on Thu Oct 5 00:22:40 2006 by  doxygen 1.4.4