Changeset 042a442 in rtems


Ignore:
Timestamp:
Jun 2, 2010, 12:50:37 AM (9 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, master
Children:
8502b16
Parents:
558a5f4
Message:

2010-06-02 Chris Johns <chrisj@…>

  • psxfile01/test.c, psxmount/test.c, psxreaddir/test.c, psxstat/test.c: Update to the new mount API.
Location:
testsuites/psxtests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r558a5f4 r042a442  
     12010-06-02      Chris Johns <chrisj@rtems.org>
     2
     3        * psxfile01/test.c, psxmount/test.c, psxreaddir/test.c,
     4        psxstat/test.c: Update to the new mount API.
     5
    162010-05-29      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • testsuites/psxtests/psxfile01/test.c

    r558a5f4 r042a442  
    4141rtems_filesystem_operations_table  IMFS_ops_no_evalformake;
    4242rtems_filesystem_operations_table  IMFS_ops_no_rename;
     43
    4344/*
    4445 *  File test support routines.
     
    119120
    120121int no_evalformake_IMFS_initialize(
    121   rtems_filesystem_mount_table_entry_t *temp_mt_entry
     122  rtems_filesystem_mount_table_entry_t *mt_entry,
     123  const void                           *data
    122124)
    123125{
    124126   return IMFS_initialize_support(
    125      temp_mt_entry,
     127     mt_entry,
    126128     &IMFS_ops_no_evalformake,
    127129     &IMFS_memfile_handlers,
     
    131133
    132134int no_rename_IMFS_initialize(
    133   rtems_filesystem_mount_table_entry_t *temp_mt_entry
     135  rtems_filesystem_mount_table_entry_t *mt_entry,
     136  const void                           *data
    134137)
    135138{
    136139   return IMFS_initialize_support(
    137      temp_mt_entry,
     140     mt_entry,
    138141     &IMFS_ops_no_rename,
    139142     &IMFS_memfile_handlers,
     
    171174  rtems_status_code rtems_status;
    172175  rtems_time_of_day time;
    173   rtems_filesystem_mount_table_entry_t *mt_entry;
    174176
    175177  IMFS_ops_no_evalformake = IMFS_ops;
     
    182184  IMFS_ops_no_rename.rename_h = NULL;
    183185
    184 
     186  puts( "register no eval-for-make filesystem" );
     187  status = rtems_filesystem_register( "nefm", no_evalformake_IMFS_initialize );
     188  rtems_test_assert( status == 0 );
     189 
     190  puts( "register no rename filesystem" );
     191  status = rtems_filesystem_register( "nren", no_rename_IMFS_initialize );
     192  rtems_test_assert( status == 0 );
     193 
    185194  printf( "\n\n*** FILE TEST 1 ***\n" );
    186195
     
    419428
    420429  puts("mounting filesystem with IMFS_ops at /imfs");
    421   status = mount(&mt_entry, &IMFS_ops,
    422                  RTEMS_FILESYSTEM_READ_WRITE,
    423                  NULL, "/imfs");
    424   rtems_test_assert(status == 0);
    425   rtems_test_assert(mt_entry != NULL);
     430  status = mount("null", "/imfs", "imfs", RTEMS_FILESYSTEM_READ_WRITE, NULL);
     431  rtems_test_assert(status == 0);
    426432  puts("creating directory /imfs/test (on newly mounted filesystem)");
    427433  status = mkdir("/imfs/test", 0777);
     
    449455  puts("Mounting filesystem @ /imfs with no support for evalformake");
    450456 
    451   status = mount(&mt_entry, &IMFS_ops_no_evalformake,
    452                  RTEMS_FILESYSTEM_READ_WRITE,
    453                  NULL, "/imfs");
    454   rtems_test_assert(status == 0);
    455   rtems_test_assert(mt_entry != NULL);
     457  status = mount("null", "/imfs", "nefm", RTEMS_FILESYSTEM_READ_WRITE, NULL);
     458  rtems_test_assert(status == 0);
    456459
    457460  puts("change directory to /imfs");
     
    474477
    475478  puts("Mounting filesystem @ /imfs with no support for rename");
    476   status = mount(&mt_entry, &IMFS_ops_no_rename,
    477                  RTEMS_FILESYSTEM_READ_WRITE,
    478                  NULL, "/imfs");
    479   rtems_test_assert(status == 0);
    480   rtems_test_assert(mt_entry != NULL);
     479  status = mount("null", "/imfs", "nren", RTEMS_FILESYSTEM_READ_WRITE, NULL);
     480  rtems_test_assert(status == 0);
    481481
    482482  puts("creating directory /imfs/test");
  • testsuites/psxtests/psxmount/test.c

    r558a5f4 r042a442  
    3636#include <rtems.h>
    3737#include <rtems/libio.h>
    38 #include <rtems/imfs.h>
    3938#include <pmacros.h>
    4039
     
    9796  int status;
    9897  struct stat statbuf;
    99   rtems_filesystem_mount_table_entry_t *mt_entry;
    10098  static char mount_point_string[25] = { "/c/z/my_mount_point" };
    10199
     
    158156  printf("Attempting to mount IMFS file system at /c/z/my_mount_point \n");
    159157  status = mount(
    160      &mt_entry,
    161      &IMFS_ops,
    162      RTEMS_FILESYSTEM_READ_WRITE,
    163      NULL,
    164      mount_point_string );
    165   rtems_test_assert(  status == 0 );
    166   if( mt_entry == NULL ){
    167      printf(" NULL mount table entry was returned\n");
    168   }
    169   else {
    170      printf("2nd file system successfully mounted at /c/z/my_mount_point \n");
    171   }
     158    "null",
     159    mount_point_string,
     160    "imfs",
     161    RTEMS_FILESYSTEM_READ_WRITE,
     162    NULL );
     163  rtems_test_assert(  status == 0 );
     164  printf("2nd file system successfully mounted at /c/z/my_mount_point \n");
    172165
    173166  /*
     
    219212  printf("Mount a NULL file system and verify EINVAL\n");
    220213  status = mount(
    221    &mt_entry,
    222    NULL,
    223    RTEMS_FILESYSTEM_READ_WRITE,
    224    NULL,
    225    mount_point_string );
     214    "null",
     215    mount_point_string,
     216    "nofound",
     217    RTEMS_FILESYSTEM_READ_WRITE,
     218    NULL );
    226219  rtems_test_assert(  status == -1 );
    227220  rtems_test_assert(  errno == EINVAL );
     
    233226  printf("mount with option of -62 should fail with EINVAL\n");
    234227  status = mount(
    235      &mt_entry,
    236      &IMFS_ops,
    237      -62,
    238      NULL,
    239      "/c/y/my_mount_point" );
     228    "null",
     229    "/c/y/my_mount_point",
     230    "imfs",
     231    -62,
     232    NULL );
    240233  rtems_test_assert(  status == -1 );
    241234  rtems_test_assert(  errno == EINVAL );
     
    247240  printf("Mount a Read Only filesystem at /c/y/my_mount_point \n");
    248241  status = mount(
    249      &mt_entry,
    250      &IMFS_ops,
    251      RTEMS_FILESYSTEM_READ_ONLY,
    252      NULL,
    253      "/c/y/my_mount_point" );
    254   rtems_test_assert(  status == 0 );
    255   if( mt_entry == NULL ){
    256      printf(" NULL mount table entry was returned\n");
    257   }
    258   else {
    259      printf("Read only file system successfully mounted at /c/y/my_mount_point \n");
    260   }
     242    "null",
     243    "/c/y/my_mount_point",
     244    "imfs",
     245    RTEMS_FILESYSTEM_READ_ONLY,
     246    NULL );
     247  rtems_test_assert(  status == 0 );
     248  printf("Read only file system successfully mounted at /c/y/my_mount_point \n");
    261249
    262250  /*
     
    278266  printf("Verify a mount point returns EBUSY for another mount\n");
    279267  status = mount(
    280      &mt_entry,
    281      &IMFS_ops,
     268    "null",
     269    "/c/y/my_mount_point",
     270    "imfs",
    282271     RTEMS_FILESYSTEM_READ_ONLY,
    283      NULL,
    284      "/c/y/my_mount_point" );
     272     NULL );
    285273  rtems_test_assert(  status == -1 );
    286274  rtems_test_assert(  errno == EBUSY);
     
    292280  printf("Mount on a file should fail with ENOTDIR\n");
    293281  status = mount(
    294      &mt_entry,
    295      &IMFS_ops,
    296      RTEMS_FILESYSTEM_READ_ONLY,
    297      NULL,
    298      "/b/my_file" );
     282    "null",
     283    "/b/my_file",
     284    "imfs",
     285    RTEMS_FILESYSTEM_READ_ONLY,
     286    NULL );
    299287  rtems_test_assert(  status == -1 );
    300288  rtems_test_assert(  errno == ENOTDIR );
     
    344332  printf("Mount /c/y/my_mount_point\n");
    345333  status = mount(
    346      &mt_entry,
    347      &IMFS_ops,
    348      RTEMS_FILESYSTEM_READ_ONLY,
    349      NULL,
    350      "/c/y/my_mount_point" );
     334    "null",
     335    "/c/y/my_mount_point",
     336    "imfs",
     337    RTEMS_FILESYSTEM_READ_ONLY,
     338    NULL );
    351339  rtems_test_assert(  status == 0 );
    352340
     
    393381  printf("Mount a file system at /c/y/my_mount_point/my_dir\n");
    394382  status = mount(
    395      &mt_entry,
    396      &IMFS_ops,
     383     "null",
     384     "/c/y/my_mount_point/my_dir",
     385     "imfs",
    397386     RTEMS_FILESYSTEM_READ_WRITE,
    398      NULL,
    399      "/c/y/my_mount_point/my_dir");
     387     NULL );
    400388  rtems_test_assert(  status == 0 );
    401389
  • testsuites/psxtests/psxreaddir/test.c

    r558a5f4 r042a442  
    184184void test_across_mount(void)
    185185{
    186   rtems_filesystem_mount_table_entry_t *mt_entry;
    187   int                                  status;
     186  int status;
    188187
    189188  /*
     
    197196  printf("Attempting to mount IMFS file system at /imfs \n");
    198197  status = mount(
    199      &mt_entry,
    200      &IMFS_ops,
     198    "null",
     199    "/imfs",
     200    "imfs",
    201201     RTEMS_FILESYSTEM_READ_WRITE,
    202      NULL,
    203      "/imfs" );
     202     NULL );
    204203  rtems_test_assert( status == 0 );
    205   if( mt_entry == NULL ){
    206      printf(" NULL mount table entry was returned\n");
    207   }
    208204  printf( "create /imfs/testdir and /imfs/testdir/testsubdir\n");
    209205
  • testsuites/psxtests/psxstat/test.c

    r558a5f4 r042a442  
    469469  int                                   status;
    470470  char                                  longer_name[100];
    471   rtems_filesystem_mount_table_entry_t *mt_entry;
    472471
    473472  /*
     
    651650  printf("Attempting to mount IMFS file system at /dir1/my_mount_point \n");
    652651  status = mount(
    653      &mt_entry,
    654      &IMFS_ops,
     652    "null",
     653    "/my_mount_point/dir1/my_mount_point",
     654    "imfs",
    655655     RTEMS_FILESYSTEM_READ_WRITE,
    656      NULL,
    657      "/my_mount_point/dir1/my_mount_point" );
     656     NULL );
    658657  rtems_test_assert( status == 0 );
    659658
     
    731730#endif
    732731{
    733   rtems_status_code                    status;
    734   rtems_time_of_day                    time;
    735   rtems_filesystem_mount_table_entry_t *mt_entry;
     732  rtems_status_code status;
     733  rtems_time_of_day time;
    736734
    737735  puts( "\n\n*** STAT TEST 01 ***" );
     
    750748  rtems_test_assert( status == 0 );
    751749  status = mount(
    752      &mt_entry,
    753      &IMFS_ops,
     750    "null",
     751    "my_mount_point",
     752    "imfs",
    754753     RTEMS_FILESYSTEM_READ_WRITE,
    755      NULL,
    756      "my_mount_point" );
     754     NULL );
    757755  rtems_test_assert( status == 0 );
    758756  status = chdir( "/my_mount_point" );
Note: See TracChangeset for help on using the changeset viewer.