Ignore:
Timestamp:
Nov 17, 2000, 9:29:31 PM (20 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
bde7e18e
Parents:
1e566bbb
Message:

2000-11-17 Jennifer Averret <jennifer@…>

  • psxmount/test.c, psxmount/psxmount.scn: Improve output to report expected error condition in one case.
  • psxreaddir/test.c, psxreaddir.scn: Added test cases to exercise readdir() of root of mounted filesystem. Also corrected the screen file for some mistakes noticed in this effort.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/tests/psxtests/psxstat/test.c

    r1e566bbb r2e3ce06  
    2727
    2828#define MAXSYMLINK 5   /* There needs to be a better way of getting this. */
     29#define TIMEOUT_VALUE  ( 5 * TICKS_PER_SECOND )
    2930
    3031
     
    3435
    3536char *Files[] = {
    36   "////dir1/\\//file1\\\\//",
    37   "/dir1/file2",
    38   "/dir1/file3",
    39   "/dir1/file4",
    40   "/dir1/dir1/file1",
    41   "../../..//dir1/./././dir1/ file1",
     37  "/////my_mount_point/dir1/\\//file1\\\\//",
     38  "/my_mount_point/dir1/file2",
     39  "/my_mount_point/dir1/file3",
     40  "/my_mount_point/dir1/file4",
     41  "/my_mount_point/dir1/dir1/file1",
     42  "../../..//my_mount_point/dir1/./././dir1/ file1",
    4243  "main.c",
    4344  0
     
    4950
    5051char *Directories[] = {
    51   "/dir1",
    52   "/dir2",
    53   "/dir3",
    54   "/dir4",
    55   "/dir1/dir1",
    56   "/./././dir1/ dir1",
    57   "/./././links", 
    58   "///dir1/dir1/../../dir1/../symlinks/////",
     52  "/my_mount_point/dir1",
     53  "/my_mount_point/dir2",
     54  "/my_mount_point/dir3",
     55  "/my_mount_point/dir4",
     56  "/my_mount_point/dir1/dir1",
     57  "/./././my_mount_point/dir1/ dir1",
     58  "/./././my_mount_point/links", 
     59  "///my_mount_point/dir1/dir1/../../dir1/../symlinks/////",
    5960  0
    6061};
     
    103104
    104105char *SymLinks[]= {
    105   "/symlinks/a_file_symlink",
    106   "/symlinks/a_dir_symlink",
    107   "/symlinks/a_link_symlink",
     106  "/my_mount_point/symlinks/a_file_symlink",
     107  "/my_mount_point/symlinks/a_dir_symlink",
     108  "/my_mount_point/symlinks/a_link_symlink",
    108109  "../symlinks/no_file",
    109   "/symlinks/a_dir_symlink/a_file_symlink",
     110  "/my_mount_point/symlinks/a_dir_symlink/a_file_symlink",
    110111  0
    111112};
     
    116117
    117118char *Good_absolute_paths[] = {
    118   "/dev",
    119   "////dir1/\\//file1\\\\//",
    120   "/dir1/\\\\/file2",
    121   "/dir1/file3/////\\\\\\",
    122   "/dir1/file4",
    123   "/dir1/dir1/file1",
    124   "/dir1/dir1/ file1",
    125   "/dir1",
    126   "/dir2//////\\",
    127   "/dir3",
    128   "/dir4",
    129   "/dir1/dir1",
    130   "/dir1/ dir1///\\\\",
    131   "/\\/\\/\\/\\/\\/\\/links\\/\\/\\/\\/\\/\\",
     119  "/my_mount_point/dev",
     120  "////my_mount_point/dir1/\\//file1\\\\//",
     121  "/my_mount_point/dir1/\\\\/file2",
     122  "/my_mount_point/dir1/file3/////\\\\\\",
     123  "/my_mount_point/dir1/file4",
     124  "/my_mount_point/dir1/dir1/file1",
     125  "/my_mount_point/dir1/dir1/ file1",
     126  "/my_mount_point/dir1",
     127  "/my_mount_point/dir2//////\\",
     128  "/my_mount_point/dir3",
     129  "/my_mount_point/dir4",
     130  "/my_mount_point/dir1/dir1",
     131  "/my_mount_point/dir1/ dir1///\\\\",
     132  "/my_mount_point/\\/\\/\\/\\/\\/\\/links\\/\\/\\/\\/\\/\\",
    132133  0
    133134};
     
    135136
    136137char *Bad_paths[] = {
    137   "/links/ENAMETOOLONG__________________________",
    138   "/dir1/file4/NOTADIR",
    139   "/dir1/dir1/EACCES__",
     138  "/my_mount_point/links/ENAMETOOLONG__________________________",
     139  "/my_mount_point/dir1/file4/NOTADIR",
     140  "/my_mount_point/dir1/dir1/EACCES__",
    140141  0
    141142};
     
    387388 make_a_symlink( "No_File",            SymLinks[3] );
    388389 make_a_symlink( SymLinks[1],          SymLinks[4] );
    389  make_a_symlink( "//links",            "/symlinks/links" );
     390 make_a_symlink( "//my_mount_point/links","/my_mount_point/symlinks/links" );
    390391
    391392 stat_a_file( SymLinks[0] );
     
    561562  assert( status == 0 );
    562563
    563   printf("chdir to / \n");
    564   status = chdir( "/" );
     564  printf("chdir to /my_mount_point \n");
     565  status = chdir( "/my_mount_point" );
    565566  assert( status == 0 );
    566567
     
    610611  assert( status == 0 );
    611612
    612   printf("chdir to / \n");
    613   status = chdir( "/" );
     613  printf("chdir to /my_mount_point\n");
     614  status = chdir( "/my_mount_point" );
    614615  assert( status == 0 );
    615616
     
    652653     RTEMS_FILESYSTEM_READ_WRITE,
    653654     NULL,
    654      "/dir1/my_mount_point" );
     655     "/my_mount_point/dir1/my_mount_point" );
    655656  assert( status == 0 );
    656657
    657658  printf("rmdir /dir1/my_mount_point should fail with EBUSY\n");
    658   status = rmdir ("/dir1/my_mount_point" );
     659  status = rmdir ("/my_mount_point/dir1/my_mount_point" );
    659660  assert( status == -1 );
    660661  assert( errno == EBUSY );
    661662
    662   printf( "Unmount /dir1/my_mount_point\n");
    663   status = unmount( "/dir1/my_mount_point" );
     663  printf( "Unmount /my_mount_point/dir1/my_mount_point\n");
     664  status = unmount( "/my_mount_point/dir1/my_mount_point" );
    664665  assert( status == 0 );
    665666
     
    699700   */
    700701
    701   printf("chdir to / \n");
    702   status = chdir( "/" );
     702  printf("chdir to /my_mount_point \n");
     703  status = chdir( "/my_mount_point" );
    703704  assert( status == 0 );
    704705
     
    728729#endif
    729730{
    730   rtems_status_code status;
    731   rtems_time_of_day time;
     731  rtems_status_code                    status;
     732  rtems_time_of_day                    time;
     733  rtems_filesystem_mount_table_entry_t *mt_entry;
    732734
    733735  puts( "\n\n*** STAT TEST 01 ***" );
     
    735737  build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
    736738  status = rtems_clock_set( &time );
     739  Show_Time();
     740
     741  /*
     742   * Create and mount another version of the filesyste.
     743   * This allows expected node id's to be consistant across
     744   * platforms and bsp's.
     745   */
     746
     747  status = mkdir("/my_mount_point",  S_IRWXU );
     748  assert( status == 0 );
     749  status = mount(
     750     &mt_entry,
     751     &IMFS_ops,
     752     RTEMS_FILESYSTEM_READ_WRITE,
     753     NULL,
     754     "my_mount_point" );
     755  assert( status == 0 );
     756  status = chdir( "/my_mount_point" );
     757  assert( status == 0 );
     758  status = mkdir("dev",  S_IRWXU );
     759  assert( status == 0 );
     760
    737761
    738762  /*
    739763   *  Create the files and directories for the test.
    740764   */
    741   Show_Time();
    742765
    743766  make_multiple_directories( Directories );
     
    746769  make_multiple_links( Files,          Links_to_Files );
    747770
    748   status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
     771  status = rtems_task_wake_after( TIMEOUT_VALUE );
    749772  make_multiple_links( Links_to_Dirs,  Links_to_dirlinks );
    750   status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
     773  status = rtems_task_wake_after( TIMEOUT_VALUE );
    751774  make_multiple_links( Links_to_Files, Links_to_filelinks );
    752775
    753   status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
     776  status = rtems_task_wake_after( TIMEOUT_VALUE );
    754777
    755778  /*
     
    810833  make_many_symlinks( "/symlinks", 10 );
    811834
    812   status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
     835  status = rtems_task_wake_after( TIMEOUT_VALUE );
    813836  Cause_faults();
    814837
    815   status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
     838  status = rtems_task_wake_after( TIMEOUT_VALUE );
    816839  chown_multiple_files( Files );
    817840
    818   status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
     841  status = rtems_task_wake_after( TIMEOUT_VALUE );
    819842  chown_multiple_files( Links_to_Dirs );
    820843 
Note: See TracChangeset for help on using the changeset viewer.