Changeset 712726d in rtems


Ignore:
Timestamp:
Aug 19, 2009, 2:55:24 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 5, master
Children:
4e7ca87
Parents:
3a121776
Message:

2009-08-19 Joel Sherrill <joel.sherrill@…>

  • psx07/init.c, psx07/psx07.scn, psx07/system.h, psx07/task.c: Update test to reflect not allowing poriority changes when mutex is locked.
Location:
testsuites/psxtests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r3a121776 r712726d  
     12009-08-19      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * psx07/init.c, psx07/psx07.scn, psx07/system.h, psx07/task.c: Update
     4        test to reflect not allowing poriority changes when mutex is locked.
     5
    162009-08-18      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • testsuites/psxtests/psx07/init.c

    r3a121776 r712726d  
    556556  fatal_directive_check_status_only( status, EINVAL, "invalid priority" );
    557557
     558  /*
     559   *  Create a sporadic thread that doesn't need it's priority
     560   *  boosted
     561   */
     562  empty_line();
     563
     564  puts( "Init - pthread_attr_init - SUCCESSFUL" );
     565  status = pthread_attr_init( &attr );
     566  posix_service_failed( status, "pthread_attr_init" );
     567
     568  puts( "Init - pthread_attr_setinheritsched - EXPLICIT - SUCCESSFUL" );
     569  status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
     570  assert( !status );
     571
     572  schedparam.ss_replenish_period.tv_sec = 3;
     573  schedparam.ss_replenish_period.tv_nsec = 3;
     574  schedparam.ss_initial_budget.tv_sec = 1;
     575  schedparam.ss_initial_budget.tv_nsec = 1;
     576  schedparam.sched_priority = sched_get_priority_max( SCHED_FIFO );
     577  schedparam.ss_low_priority = sched_get_priority_max( SCHED_FIFO ) - 6;
     578
     579  puts( "Init - pthread_attr_setschedpolicy - SUCCESSFUL" );
     580  status = pthread_attr_setschedpolicy( &attr, SCHED_SPORADIC );
     581  posix_service_failed( status, "pthread_attr_setschedparam");
     582  puts( "Init - pthread_attr_setschedparam - SUCCESSFUL" );
     583  status = pthread_attr_setschedparam( &attr, &schedparam );
     584  posix_service_failed( status, "pthread_attr_setschedparam");
     585
     586  status = pthread_create( &Task2_id, &attr, Task_2, NULL );
     587  assert( !status );
     588
     589  status = pthread_join( Task2_id, NULL );
     590  posix_service_failed( status, " pthread_join");
     591
    558592  puts( "*** END OF POSIX TEST 7 ***" );
    559593  rtems_test_exit( 0 );
  • testsuites/psxtests/psx07/psx07.scn

    r3a121776 r712726d  
    1010Init - pthread_create - EAGAIN (stacksize too large)
    1111Init - pthread_create - EINVAL (invalid inherit scheduler)
     12Init - pthread_attr_settime - EINVAL ( null attribute )
     13Init - pthread_attr_gettime - EINVAL ( null attribute )
     14Init - pthread_attr_settime - EINVAL ( is initialized )
     15Init - pthread_attr_gettime - EINVAL ( is initialized )
     16Init - pthread_attr_settime - EINVAL ( invalid clock allowed )
     17Init - pthread_attr_gettime - EINVAL ( NULL clock allowed )
     18Init - validate pthread_attr_setcputime - CLOCK_DISABLED
     19Init - validate pthread_attr_setcputime - CLOCK_ENABLED
    1220Init - pthread_create - ENOTSUP (unsupported system contention scope)
    1321Init - pthread_create - SUCCESSFUL (inherit scheduler)
    1422Task_1 - exitting
     23
    1524Init - pthread_attr_setscope - EINVAL (NULL attr)
    1625Init - pthread_attr_setscope - ENOTSUP
     
    2332Init - pthread_attr_getscope - SUCCESSFUL
    2433Init - current scope attribute = 0
     34
    2535Init - pthread_attr_setinheritsched - EINVAL (NULL attr)
    2636Init - pthread_attr_setinheritsched - EINVAL (not initialized attr)
     
    3242Init - pthread_attr_getinheritsched - SUCCESSFUL
    3343Init - current inherit scheduler attribute = 1
     44
    3445Init - pthread_attr_setschedpolicy - EINVAL (NULL attr)
    3546Init - pthread_attr_setschedpolicy - EINVAL (not initialized attr)
     
    4152Init - pthread_attr_getschedpolicy - SUCCESSFUL
    4253Init - current scheduler policy attribute = 2
     54
    4355Init - pthread_attr_setstacksize - EINVAL (NULL attr)
    4456Init - pthread_attr_setstacksize - EINVAL (not initialized attr)
     
    5062Init - pthread_attr_getstacksize - SUCCESSFUL
    5163Init - current stack size attribute is OK
     64
    5265Init - pthread_attr_setstackaddr - EINVAL (NULL attr)
    5366Init - pthread_attr_setstackaddr - EINVAL (not initialized attr)
     
    5871Init - pthread_attr_getstackaddr - SUCCESSFUL
    5972Init - current stack address attribute = 0x0
     73
    6074Init - pthread_attr_setdetachstate - EINVAL (NULL attr)
    6175Init - pthread_attr_setdetachstate - EINVAL (not initialized attr)
     
    6781Init - pthread_attr_getdetachstate - SUCCESSFUL
    6882Init - current detach state attribute = 1
     83
    6984Init - pthread_attr_getschedparam - SUCCESSFUL
    7085Init - sched priority      = 2
     
    7994Init - pthread_attr_getschedparam - EINVAL (not initialized attr)
    8095Init - pthread_attr_getschedparam - EINVAL (NULL schedparam)
     96
    8197Init - pthread_getschedparam - EINVAL (NULL policy)
    8298Init - pthread_getschedparam - EINVAL (NULL schedparam)
     
    88104Init - ss_replenish_period = (0, 0)
    89105Init - ss_initial_budget = (0, 0)
     106
    90107Init - pthread_setschedparam - EINVAL (NULL schedparam)
    91108Init - pthread_setschedparam - EINVAL (invalid priority)
     
    96113Init - pthread_setschedparam - EINVAL (replenish < budget)
    97114Init - pthread_setschedparam - EINVAL (invalid priority)
     115
     116Init - pthread_attr_init - SUCCESSFUL
     117Init - pthread_attr_setinheritsched - EXPLICIT - SUCCESSFUL
     118Init - pthread_attr_setschedpolicy - SUCCESSFUL
     119Init - pthread_attr_setschedparam - SUCCESSFUL
     120Time elapsed Task_2:  0 (seconds)
     121Time elapsed Task_2:  1 (seconds)
     122Time elapsed Task_2:  2 (seconds)
     123Time elapsed Task_2:  3 (seconds)
     124Time elapsed Task_2:  4 (seconds)
     125Time elapsed Task_2:  5 (seconds)
     126Time elapsed Task_2:  6 (seconds)
     127Time elapsed Task_2:  7 (seconds)
     128Time elapsed Task_2:  8 (seconds)
     129Time elapsed Task_2:  9 (seconds)
     130Time elapsed Task_2: 10 (seconds)
     131Task_2 - exitting
    98132*** END OF POSIX TEST 7 ***
  • testsuites/psxtests/psx07/system.h

    r3a121776 r712726d  
    2626);
    2727
     28void *Task_2(
     29  void *argument
     30);
     31
     32
    2833/* configuration information */
    2934
     
    4651
    4752TEST_EXTERN pthread_t        Init_id;
    48 TEST_EXTERN pthread_t        Task_id;
     53TEST_EXTERN pthread_t        Task_id, Task2_id;
    4954
    5055#undef TEST_EXTERN
  • testsuites/psxtests/psx07/task.c

    r3a121776 r712726d  
    3232  return NULL; /* just so the compiler thinks we returned something */
    3333}
     34
     35void *Task_2(
     36  void *argument
     37)
     38{
     39  int i = 0;
     40  time_t now, start;
     41
     42  /*
     43   *  Change our priority so we are running at a logically higher
     44   *  priority than our "ss_high_priority".  This should result in
     45   *  our replenishment period not touching our priority.
     46   */
     47
     48  /*
     49   *  Consume time so the cpu budget callout will run. 
     50   *
     51   *  DO NOT BLOCK!!!
     52   */
     53  start = time(&start);
     54  while( i <= 10 ) {
     55    do {
     56      now = time(&now);
     57    } while (start == now);
     58    start = time(&start);
     59   
     60    printf( "Time elapsed Task_2: %2d (seconds)\n", i++ );
     61  }
     62
     63  puts( "Task_2 - exitting" );
     64  pthread_exit( NULL );
     65  return NULL;
     66}
Note: See TracChangeset for help on using the changeset viewer.