Changeset 3f06c298 in rtems


Ignore:
Timestamp:
03/31/99 23:22:42 (25 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
f719ef1
Parents:
73b943bc
Message:

Added prints for calls into the file system. Added O_EXCL for an open that
tested that the same file could not be created twice.

Files:
2 edited

Legend:

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

    r73b943bc r3f06c298  
    233233  assert( !status );
    234234
     235  puts( "rmdir /dev" );
    235236  status = rmdir( "/dev" );
    236237  assert( status == -1 );
    237238  assert( errno ==  ENOTEMPTY);
    238239
     240  puts( "rmdir /fred" );
    239241  status = rmdir ("/fred");
    240242  assert (status == -1);
    241243  assert( errno == ENOENT );
    242244
     245  puts( "mknod /dev/test_console" );
    243246  status = mknod( "/dev/test_console", S_IFCHR, 0LL );
    244247  assert( !status );
     248
     249  puts( "mknod /dev/tty/S3" );
    245250  status = mknod( "/dev/tty/S3", S_IFCHR, 0xFF00000080LL );
    246251  assert( !status );
     252
     253  puts ("mknod /etc/passwd");
    247254  status = mknod( "/etc/passwd", (S_IFREG | S_IRWXU), 0LL );
    248255  assert( !status );
    249256
     257  puts( "mkdir /tmp/my_dir");
    250258  status = mkdir( "/tmp/my_dir", S_IRWXU );
    251259  assert( status == 0 );
    252260
     261  puts("mkfifo /c/my_dir" );
    253262  status = mkfifo( "/c/my_dir", S_IRWXU );
    254263  assert( status == -1 );
     
    279288  fd = open( "/tmp/j", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
    280289  assert( fd != -1 );
    281 
    282290  printf( "open returned file descriptor %d\n", fd );
    283291
     
    286294  assert( !status );
    287295
     296  puts( "close /tmp/j again" );
    288297  status = close( fd );
    289298  assert( status == -1 );
     
    293302  assert( !status );
    294303
     304  puts( "unlink /tmp" );
    295305  status = unlink( "/tmp" );
    296306  assert( status );
     
    300310   */
    301311
    302   fd = open( "/tmp/tom", O_CREAT );
     312  puts("create and close /tmp/tom");
     313  fd = open( "/tmp/tom", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
     314  assert( fd != -1 );
    303315  status = close( fd );
    304   fd1 = open( "/tmp/tom", O_CREAT );
    305   assert( fd1 == -1 );
    306 
    307   fd = open( "/tmp/john", O_CREAT );
     316  assert( status == 0 );
     317
     318  puts("Attempt to recreate /tmp/tom");
     319  fd = open( "/tmp/tom", O_CREAT | O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO );
     320  assert( fd == -1 );
     321  assert( errno == EEXIST );
     322
     323  puts("create /tmp/john");
     324  fd = open( "/tmp/john", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
    308325  assert( fd != -1 );
     326
     327  puts("tcdrain /tmp/john" );
    309328  status = tcdrain( fd );
    310329  assert( status == 0 );
     
    314333   */
    315334
     335  puts( "mknod /tmp/joel" );
    316336  status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
    317337  test_write( "/tmp/joel", 0, "the first write!!!\n" );
     
    337357   */
    338358
     359  puts("unlink /tmp/joel");
    339360  status = unlink( "/tmp/joel" );
    340361  assert( !status );
     
    342363  /* Test a failure path */
    343364
     365  puts( "unlink /tmp/joel" );
    344366  status = unlink( "/tmp/joel" );
    345367  assert( status == -1 );
    346368
     369  puts( "mknod /tmp/joel");
    347370  status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
    348371  assert( !status );
  • testsuites/psxtests/psxfile01/test.c

    r73b943bc r3f06c298  
    233233  assert( !status );
    234234
     235  puts( "rmdir /dev" );
    235236  status = rmdir( "/dev" );
    236237  assert( status == -1 );
    237238  assert( errno ==  ENOTEMPTY);
    238239
     240  puts( "rmdir /fred" );
    239241  status = rmdir ("/fred");
    240242  assert (status == -1);
    241243  assert( errno == ENOENT );
    242244
     245  puts( "mknod /dev/test_console" );
    243246  status = mknod( "/dev/test_console", S_IFCHR, 0LL );
    244247  assert( !status );
     248
     249  puts( "mknod /dev/tty/S3" );
    245250  status = mknod( "/dev/tty/S3", S_IFCHR, 0xFF00000080LL );
    246251  assert( !status );
     252
     253  puts ("mknod /etc/passwd");
    247254  status = mknod( "/etc/passwd", (S_IFREG | S_IRWXU), 0LL );
    248255  assert( !status );
    249256
     257  puts( "mkdir /tmp/my_dir");
    250258  status = mkdir( "/tmp/my_dir", S_IRWXU );
    251259  assert( status == 0 );
    252260
     261  puts("mkfifo /c/my_dir" );
    253262  status = mkfifo( "/c/my_dir", S_IRWXU );
    254263  assert( status == -1 );
     
    279288  fd = open( "/tmp/j", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
    280289  assert( fd != -1 );
    281 
    282290  printf( "open returned file descriptor %d\n", fd );
    283291
     
    286294  assert( !status );
    287295
     296  puts( "close /tmp/j again" );
    288297  status = close( fd );
    289298  assert( status == -1 );
     
    293302  assert( !status );
    294303
     304  puts( "unlink /tmp" );
    295305  status = unlink( "/tmp" );
    296306  assert( status );
     
    300310   */
    301311
    302   fd = open( "/tmp/tom", O_CREAT );
     312  puts("create and close /tmp/tom");
     313  fd = open( "/tmp/tom", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
     314  assert( fd != -1 );
    303315  status = close( fd );
    304   fd1 = open( "/tmp/tom", O_CREAT );
    305   assert( fd1 == -1 );
    306 
    307   fd = open( "/tmp/john", O_CREAT );
     316  assert( status == 0 );
     317
     318  puts("Attempt to recreate /tmp/tom");
     319  fd = open( "/tmp/tom", O_CREAT | O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO );
     320  assert( fd == -1 );
     321  assert( errno == EEXIST );
     322
     323  puts("create /tmp/john");
     324  fd = open( "/tmp/john", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
    308325  assert( fd != -1 );
     326
     327  puts("tcdrain /tmp/john" );
    309328  status = tcdrain( fd );
    310329  assert( status == 0 );
     
    314333   */
    315334
     335  puts( "mknod /tmp/joel" );
    316336  status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
    317337  test_write( "/tmp/joel", 0, "the first write!!!\n" );
     
    337357   */
    338358
     359  puts("unlink /tmp/joel");
    339360  status = unlink( "/tmp/joel" );
    340361  assert( !status );
     
    342363  /* Test a failure path */
    343364
     365  puts( "unlink /tmp/joel" );
    344366  status = unlink( "/tmp/joel" );
    345367  assert( status == -1 );
    346368
     369  puts( "mknod /tmp/joel");
    347370  status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL );
    348371  assert( !status );
Note: See TracChangeset for help on using the changeset viewer.