Changeset 99e6fb52 in rtems


Ignore:
Timestamp:
Aug 7, 2010, 12:22:46 AM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
58c5a9b
Parents:
39a056b
Message:

2010-08-06 Bharath Suri <bharath.s.jois@…>

PR 1654/testing

  • psx13/test.c, psx13/psx13.scn: Test case to improve testing of dup2 routine.
  • psxfile01/test.c, psxfile01/psxfile01.scn: New test to improve testing of fcntl routine.
  • psximfs01/init.c, psximfs01/psximfs01.scn: Improve testing of imfs routines.
  • psximfs02/init.c, psximfs02/psximfs02.scn: Improve coverage of imfs routines.
  • psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New tests to improve coverage of getpwent.c.
Location:
testsuites/psxtests
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r39a056b r99e6fb52  
     12010-08-06      Bharath Suri <bharath.s.jois@gmail.com>
     2
     3        PR 1654/testing
     4        * psx13/test.c, psx13/psx13.scn: Test case to improve testing of
     5        dup2 routine.
     6        * psxfile01/test.c, psxfile01/psxfile01.scn: New test to improve
     7        testing of fcntl routine.
     8        * psximfs01/init.c, psximfs01/psximfs01.scn: Improve testing of
     9        imfs routines.
     10        * psximfs02/init.c, psximfs02/psximfs02.scn: Improve coverage of
     11        imfs routines.
     12        * psxpasswd02/init.c, psxpasswd02/psxpasswd02.scn: New tests to
     13        improve coverage of getpwent.c.
     14
    1152010-08-06      Ralf Corsépius <ralf.corsepius@rtems.org>
    216
  • testsuites/psxtests/psx13/psx13.scn

    r39a056b r99e6fb52  
    1 
    21*** POSIX TEST 13 ***
    32
     
    54Testing device_lseek()... Failed!!!
    65Testing dup()............ Failed!!!
    7 Testing dup2()........... Failed!!!
     6Testing dup2()........... Success.
    87Testing fdatasync()...... Success.
    98Testing umask().......... Success.
  • testsuites/psxtests/psx13/test.c

    r39a056b r99e6fb52  
    143143    retval = FALSE;
    144144
    145   /* assert (retval == TRUE);*/
     145  close( fd );  /* assert (retval == TRUE);*/
    146146
    147147  return (retval);
     
    188188    retval = FALSE;
    189189
     190  close( fd1 );
     191  close( fd2 );
    190192  /* assert (retval == TRUE);*/
    191193
     
    258260
    259261  close (fd1);
    260 
     262  close (fd2);
    261263  /* assert (retval == TRUE);*/
    262264
  • testsuites/psxtests/psxfile01/psxfile01.scn

    r39a056b r99e6fb52  
    1 
    21*** FILE TEST 1 ***
    32*************** Dump of Entire IMFS ***************
     
    54....dev/
    65........console (device 0, 0)
    7 ***************       End of Dump        ***************
     6***************      End of Dump       ***************
    87stat of /dev/console
    98....st_dev     (0xfffe:0x0)
     
    5655mknod with bad type - expect EINVAL
    5756open /tmp/bha in write only mode -- OK
     57attempt fcntl on opened file -- OK
    5858attempt to read from /tmp/bha - expect EINVAL
    5959closing and unlinking /tmp/bha
     
    193193....imfs/
    194194........hidden_on_mount/
    195 ***************       End of Dump        ***************
     195***************      End of Dump       ***************
    196196truncate /tmp/j to length of 40
    197197....st_dev     (0xfffe:0x0)
     
    222222....imfs/
    223223........hidden_on_mount/
    224 ***************       End of Dump        ***************
     224***************      End of Dump       ***************
    225225truncate /tmp/j to length of 0
    226226truncate /tmp to length of 0 should fail with EISDIR
     
    243243....imfs/
    244244........hidden_on_mount/
    245 ***************       End of Dump        ***************
     245***************      End of Dump       ***************
    246246Writing First File
    247247Writing Second File
  • testsuites/psxtests/psxfile01/test.c

    r39a056b r99e6fb52  
    375375  fd = open( "/tmp/bha", O_CREAT | O_WRONLY, S_IRWXU|S_IRWXG|S_IRWXO );
    376376  rtems_test_assert( fd != -1 );
    377  
     377
     378  puts( "attempt fcntl on opened file -- OK" );
     379  status = fcntl( fd, F_SETFD, 0 );
     380  rtems_test_assert( status == 0 );
     381
    378382  puts( "attempt to read from /tmp/bha - expect EINVAL" );
    379383  status = read( fd, buffer, 10 );
  • testsuites/psxtests/psximfs01/init.c

    r39a056b r99e6fb52  
    148148  position = lseek( TestFd, 0, SEEK_END );
    149149  printf( "Seek to end .. returned %d\n", (int) position );
    150   rtems_test_assert( position == 1 );
    151150
    152151  /*
     
    180179          strerror( errno )
    181180        );
     181        break;
    182182      }
    183183      else {
     
    217217  void *alloc_ptr = (void *)0;
    218218  Heap_Information_block Info;
     219  int position = 0;
     220  int status = 0;
    219221
    220222  puts( "\n\n*** TEST IMFS 01 ***" );
     
    249251  free(alloc_ptr);
    250252
     253  extend_helper();
     254  position = lseek( TestFd , 0, SEEK_END );
     255  status = lseek( TestFd, position+2, SEEK_SET );
     256  rtems_test_assert( status == -1 );
     257  rtems_test_assert( errno == ENOSPC );
     258
    251259  close_it();
    252260  unlink_it();
  • testsuites/psxtests/psximfs01/psximfs01.scn

    r39a056b r99e6fb52  
    1515Seek to end .. returned 1
    1616lseek/ftruncate loop..
     17Seek to end .. returned 1295
     18lseek/ftruncate loop..
    1719close(biggie) - OK
    1820unlink(biggie) - OK
  • testsuites/psxtests/psximfs02/init.c

    r39a056b r99e6fb52  
    162162  IMFS_dump();
    163163 
     164  puts( "chown /fifo to 10 -- OK" );
     165  status = chown( "/fifo", 10, 10 );
     166  rtems_test_assert( status == 0 );
     167
     168  puts( "Changing euid to 10" );
     169  status = seteuid( 10 );
     170  rtems_test_assert( status == 0 );
     171
     172  puts( "chmod /fifo -- OK" );
     173  status = chmod( "/fifo", S_IRWXU );
     174  rtems_test_assert( status == 0 );
     175
     176  printk( "chown /fifo to %o -- OK", 0 );
     177  status = chown( "/fifo", 0, 0 );
     178  rtems_test_assert( status == 0 );
     179
    164180  puts( "*** END OF TEST IMFS 02 ***" );
    165181  rtems_test_exit(0);
  • testsuites/psxtests/psximfs02/psximfs02.scn

    r39a056b r99e6fb52  
    5858....node-slink links not printed
    5959....fifo FIFO not printed
    60 ***************       End of Dump        ***************
    61 *** END OF TEST IMFS 02 ***
     60***************      End of Dump       ***************
     61chown /fifo to 10 -- OK
     62Changing euid to 10
     63chmod /fifo -- OK
     64chown /fifo to 0 -- OK*** END OF TEST IMFS 02 ***
  • testsuites/psxtests/psxpasswd02/init.c

    r39a056b r99e6fb52  
    1818#include <fcntl.h>
    1919#include <errno.h>
     20#include <limits.h>
    2021
    2122void print_passwd(
     
    6465  struct group  *gr;
    6566  int status = -1;
     67  char str[100] = {0};
     68  int max_int = INT_MAX;
     69  int limit_value = 0;
    6670
    6771  FILE *fp = NULL;
     
    121125  rtems_test_assert( fp != NULL );
    122126  fprintf( fp, "user\n:x:2:2:dummy::/:/bin/sh\n" );
     127  fclose( fp );
     128
     129  puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
     130  pw = getpwnam( "root" );
     131  rtems_test_assert( !pw );
     132  rtems_test_assert( errno == EINVAL );
     133
     134  fp = fopen( "/etc/passwd", "w" );
     135  rtems_test_assert( fp != NULL );
     136  fprintf( fp, "user:x:999999999999:1:dummy::/:/bin/sh\n" );
     137  fclose( fp );
     138
     139  puts( "Init - getpwnam(\"root\") -- expected EINVAL" );
     140  pw = getpwnam( "root" );
     141  rtems_test_assert( !pw );
     142  rtems_test_assert( errno == EINVAL );
     143
     144  sprintf( str, "user:x:%d%d:1:dummy::/:/bin/sh\n", max_int/10, max_int%10+1 );
     145
     146  fp = fopen( "/etc/passwd", "w" );
     147  rtems_test_assert( fp != NULL );
     148  fprintf( fp, str );
    123149  fclose( fp );
    124150
  • testsuites/psxtests/psxpasswd02/psxpasswd02.scn

    r39a056b r99e6fb52  
    77Init - setgrent() -- OK
    88Init - setgrent() -- OK
     9Init - getpwnam("root") -- expected EINVAL
     10Init - getpwnam("root") -- expected EINVAL
    911Init - getpwnam("root") -- expected EINVAL
    1012Init - getpwnam("root") -- expected EINVAL
Note: See TracChangeset for help on using the changeset viewer.