Changeset 1fe4042 in rtems for testsuites/psxtests


Ignore:
Timestamp:
Jul 1, 2010, 5:26:37 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
0d923d9
Parents:
c40d3c4b
Message:

2010-07-01 Bharath Suri <bharath.s.jois@…>

PR 1598/testing

  • Makefile.am, configure.ac, psxpasswd01/init.c, psxpasswd01/psxpasswd01.doc, psxpasswd01/psxpasswd01.scn: Add testing for POSIX user database (e.g. /etc/group and /etc/passwd) access routines which are implemented in libcsupport/src/getpwent.c.
  • psxpasswd02/.cvsignore, psxpasswd02/Makefile.am, psxpasswd02/init.c, psxpasswd02/psxpasswd02.doc, psxpasswd02/psxpasswd02.scn: New files.
Location:
testsuites/psxtests
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    rc40d3c4b r1fe4042  
     12010-07-01      Bharath Suri <bharath.s.jois@gmail.com>
     2
     3        PR 1598/testing
     4        * Makefile.am, configure.ac, psxpasswd01/init.c,
     5        psxpasswd01/psxpasswd01.doc, psxpasswd01/psxpasswd01.scn: Add testing
     6        for POSIX user database (e.g. /etc/group and /etc/passwd) access
     7        routines which are implemented in libcsupport/src/getpwent.c.
     8        * psxpasswd02/.cvsignore, psxpasswd02/Makefile.am, psxpasswd02/init.c,
     9        psxpasswd02/psxpasswd02.doc, psxpasswd02/psxpasswd02.scn: New files.
     10
    1112010-07-01      Vinu Rajashekhar <vinutheraj@gmail.com>
    212
  • testsuites/psxtests/Makefile.am

    rc40d3c4b r1fe4042  
    2121## File IO tests
    2222SUBDIRS += psxfile01 psxfile02 psxfilelock01 psxid01 psximfs01 psxreaddir \
    23     psxstat psxmount psx13 psxchroot01 psxpasswd01
     23    psxstat psxmount psx13 psxchroot01 psxpasswd01 psxpasswd02
    2424
    2525## Until sys/uio.h is moved to libcsupport, we have to have networking
  • testsuites/psxtests/configure.ac

    rc40d3c4b r1fe4042  
    106106psxobj01/Makefile
    107107psxpasswd01/Makefile
     108psxpasswd02/Makefile
    108109psxreaddir/Makefile
    109110psxrdwrv/Makefile
  • testsuites/psxtests/psxpasswd01/init.c

    rc40d3c4b r1fe4042  
    6161  struct group  *gr;
    6262
    63   puts( "*** PASSWORD/GROUP TEST ***" );
     63  puts( "*** PASSWORD/GROUP TEST - 01 ***" );
     64
     65  /* getpwent */
     66  puts( "Init - getpwent() -- OK, result should be NULL" );
     67  pw = getpwent();
     68  rtems_test_assert( !pw );
     69
     70  /* getgrent */
     71  puts( "Init - getgrent() -- OK, result should be NULL" );
     72  gr = getgrent();
     73  rtems_test_assert( !gr );
     74
     75  /* setpwent */
     76
     77  puts( "Init - setpwent() -- OK" );
     78  setpwent();
     79
     80  /* setgrent */
     81
     82  puts( "Init - setgrent() -- OK" );
     83  setgrent();
     84
     85  /* getpwent */
     86
     87  puts( "Init - getpwent() (1) -- OK" );
     88  pw = getpwent();
     89  rtems_test_assert( pw );
     90  print_passwd( pw );
     91
     92  puts( "Init - getpwent() (2) -- OK" );
     93  pw = getpwent();
     94  rtems_test_assert( pw );
     95  print_passwd( pw );
     96
     97  puts( "Init - getpwent() (3) -- OK" );
     98  pw = getpwent();
     99  rtems_test_assert( pw );
     100  print_passwd( pw );
     101
     102  puts( "Init - getpwent() (4) -- result should be NULL" );
     103  pw = getpwent();
     104  rtems_test_assert( !pw );
     105
     106  /* getgrent */
     107
     108  puts( "Init - getgrent() (1) -- OK" );
     109  gr = getgrent();
     110  rtems_test_assert( gr );
     111  print_group( gr );
     112
     113  puts( "Init - getgrent() (2) -- OK" );
     114  gr = getgrent();
     115  rtems_test_assert( gr );
     116  print_group( gr );
     117
     118  puts( "Init - getgrent() (3) -- OK" );
     119  gr = getgrent();
     120  rtems_test_assert( gr );
     121  print_group( gr );
     122
     123  puts( "Init - getgrent() (4) -- result should be NULL" );
     124  gr = getgrent();
     125  rtems_test_assert( !gr );
    64126
    65127  /* getpwnam */
    66128  puts( "Init - getpwnam(\"root\") -- OK" );
    67   pw = getpwnam("root");
     129  pw = getpwnam( "root" );
    68130  rtems_test_assert( pw );
    69131  print_passwd( pw );
    70132
    71133  puts( "Init - getpwnam(\"rtems\") -- OK" );
    72   pw = getpwnam("rtems");
    73   rtems_test_assert( pw );
    74   print_passwd( pw );
     134  pw = getpwnam( "rtems" );
     135  rtems_test_assert( pw );
     136  print_passwd( pw );
     137
     138  puts( "Init - getpwnam(\"suser\") -- result should be NULL" );
     139  pw = getpwnam( "suser" );
     140  rtems_test_assert( !pw );
     141
     142  /* getpwuid */
     143  puts( "Init - getpwuid(0) -- OK" );
     144  pw = getpwuid( 0 );
     145  rtems_test_assert( pw );
     146  print_passwd( pw );
     147
     148  puts( "Init - getpwuid(1) -- OK" );
     149  pw = getpwuid( 1 );
     150  rtems_test_assert( pw );
     151  print_passwd( pw );
     152
     153  puts( "Init - getpwuid(4) -- result should be NULL" );
     154  pw = getpwuid( 4 );
     155  rtems_test_assert( !pw );
    75156
    76157  /* getgrnam */
     
    85166  print_group( gr );
    86167
    87   puts( "*** END OF PASSWORD/GROUP TEST ***" );
     168  /* getgrgid */
     169  puts( "Init - getgrgid(0) -- OK" );
     170  gr = getgrgid(0);
     171  rtems_test_assert( gr );
     172  print_group( gr );
     173
     174  puts( "Init - getgrgid(1) -- OK" );
     175  gr = getgrgid(1);
     176  rtems_test_assert( gr );
     177  print_group( gr );
     178
     179  puts( "Init - getgrgid(4) -- result should be NULL");
     180  gr = getgrgid( 4 );
     181  rtems_test_assert( !gr );
     182
     183  /* endpwent */
     184  puts( "Init - endpwent() -- OK" );
     185  endpwent();
     186
     187  /* endgrent */
     188  puts( "Init - endgrent() -- OK" );
     189  endgrent();
     190
     191  puts( "*** END OF PASSWORD/GROUP TEST - 01 ***" );
    88192  rtems_test_exit( 0 );
    89193}
  • testsuites/psxtests/psxpasswd01/psxpasswd01.scn

    rc40d3c4b r1fe4042  
    1 *** PASSWORD/GROUP TEST ***
     1Initialized console on port COM1 9600-8-N-1
     2
     3*** PASSWORD/GROUP TEST - 01 ***
     4Init - getpwent() -- OK, result should be NULL
     5Init - getgrent() -- OK, result should be NULL
     6Init - setpwent() -- OK
     7Init - setgrent() -- OK
     8Init - getpwent() (1) -- OK
     9  username: root
     10  user password: *
     11  user ID: 0
     12  group ID: 0
     13  real name:
     14  home directory: /
     15  shell program: /bin/sh
     16Init - getpwent() (2) -- OK
     17  username: rtems
     18  user password: *
     19  user ID: 1
     20  group ID: 1
     21  real name:
     22  home directory: /
     23  shell program: /bin/sh
     24Init - getpwent() (3) -- OK
     25  username: tty
     26  user password: !
     27  user ID: 2
     28  group ID: 2
     29  real name:
     30  home directory: /
     31  shell program: /bin/false
     32Init - getpwent() (4) -- result should be NULL
     33Init - getgrent() (1) -- OK
     34  group name: root
     35  group  password: x
     36  group  ID: 0
     37Init - getgrent() (2) -- OK
     38  group name: rtems
     39  group  password: x
     40  group  ID: 1
     41Init - getgrent() (3) -- OK
     42  group name: tty
     43  group  password: x
     44  group  ID: 2
     45Init - getgrent() (4) -- result should be NULL
    246Init - getpwnam("root") -- OK
    347  username: root
     
    1660  home directory: /
    1761  shell program: /bin/sh
    18 
     62Init - getpwnam("suser") -- result should be NULL
     63Init - getpwuid(0) -- OK
     64  username: root
     65  user password: *
     66  user ID: 0
     67  group ID: 0
     68  real name:
     69  home directory: /
     70  shell program: /bin/sh
     71Init - getpwuid(1) -- OK
     72  username: rtems
     73  user password: *
     74  user ID: 1
     75  group ID: 1
     76  real name:
     77  home directory: /
     78  shell program: /bin/sh
     79Init - getpwuid(4) -- result should be NULL
    1980Init - getgrnam("root") -- OK
    2081  group name: root
     
    2586  group  password: x
    2687  group  ID: 1
    27 *** END OF PASSWORD/GROUP TEST ***
    28 
     88Init - getgrgid(0) -- OK
     89  group name: root
     90  group  password: x
     91  group  ID: 0
     92Init - getgrgid(1) -- OK
     93  group name: rtems
     94  group  password: x
     95  group  ID: 1
     96Init - getgrgid(4) -- result should be NULL
     97Init - endpwent() -- OK
     98Init - endgrent() -- OK
     99*** END OF PASSWORD/GROUP TEST - 01 ***
Note: See TracChangeset for help on using the changeset viewer.