2009-07-19 Joel Sherrill <joel.sherrill@oarcorp.com>

* Makefile.am, configure.ac: Add sp60 to exercise case where a task is
	blocked on one period while another expires. Add sp61 which exercises
	the case where a call is made to rtems_shutdown_executive when the
	system is not up.
	* sp60/.cvsignore, sp60/Makefile.am, sp60/init.c, sp60/sp60.doc,
	sp60/sp60.scn, sp61/.cvsignore, sp61/Makefile.am, sp61/init.c,
	sp61/sp61.doc, sp61/sp61.scn: New files.
This commit is contained in:
Joel Sherrill
2009-07-20 01:05:33 +00:00
parent f3ea48abbc
commit f691e0a09f
13 changed files with 255 additions and 0 deletions

View File

@@ -1,3 +1,13 @@
2009-07-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add sp60 to exercise case where a task is
blocked on one period while another expires. Add sp61 which exercises
the case where a call is made to rtems_shutdown_executive when the
system is not up.
* sp60/.cvsignore, sp60/Makefile.am, sp60/init.c, sp60/sp60.doc,
sp60/sp60.scn, sp61/.cvsignore, sp61/Makefile.am, sp61/init.c,
sp61/sp61.doc, sp61/sp61.scn: New files.
2009-07-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp04/init.c: To be timesliced, tasks must also me preemptible.

View File

@@ -11,6 +11,7 @@ SUBDIRS = \
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 \
sp40 sp42 sp43 sp44 sp45 sp46 sp47 sp48 sp49 \
sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 sp58 sp59 \
sp60 sp61 \
spchain spobjgetnext spprintk spsize spstkalloc spthreadq01 \
spwatchdog spwkspace \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \

View File

@@ -83,6 +83,8 @@ sp56/Makefile
sp57/Makefile
sp58/Makefile
sp59/Makefile
sp60/Makefile
sp61/Makefile
spchain/Makefile
spfatal01/Makefile
spfatal02/Makefile

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,28 @@
##
## $Id$
##
MANAGERS = all
rtems_tests_PROGRAMS = sp60
sp60_SOURCES = init.c
dist_rtems_tests_DATA = sp60.scn
dist_rtems_tests_DATA += sp60.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
sp60_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(sp60_OBJECTS) $(sp60_LDADD)
LINK_LIBS = $(sp60_LDLIBS)
sp60$(EXEEXT): $(sp60_OBJECTS) $(sp60_DEPENDENCIES)
@rm -f sp60$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am

View File

@@ -0,0 +1,70 @@
/*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <tmacros.h>
rtems_task Init(
rtems_task_argument ignored
)
{
rtems_status_code sc;
rtems_id period1;
rtems_id period2;
puts( "\n\n*** TEST 60 ***" );
puts( "Init - rtems_rate_monotonic_create - first period" );
sc = rtems_rate_monotonic_create(
rtems_build_name( 'P', 'E', 'R', '1' ),
&period1
);
directive_failed( sc, "rtems_rate_monotonic_create 1" );
puts( "Init - rtems_rate_monotonic_create - second period" );
sc = rtems_rate_monotonic_create(
rtems_build_name( 'P', 'E', 'R', '2' ),
&period2
);
directive_failed( sc, "rtems_rate_monotonic_create 1" );
puts( "Init - rtems_rate_monotonic_period - short period" );
sc = rtems_rate_monotonic_period(period1, RTEMS_MILLISECONDS_TO_TICKS(200) );
directive_failed( sc, "rtems_rate_monotonic_period" );
puts( "Init - rtems_rate_monotonic_period - long period initiated" );
sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) );
directive_failed( sc, "rtems_rate_monotonic_period" );
puts( "Init - rtems_rate_monotonic_period - long period block" );
sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) );
directive_failed( sc, "rtems_rate_monotonic_period" );
puts( "Init - rtems_rate_monotonic_period - verify long period expired" );
sc = rtems_rate_monotonic_period(period1, RTEMS_PERIOD_STATUS );
fatal_directive_status(sc, RTEMS_TIMEOUT, "rtems_task_period status");
puts( "*** END OF TEST 60 ***" );
rtems_test_exit(0);
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_MAXIMUM_PERIODS 2
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
/* global variables */

View File

@@ -0,0 +1,25 @@
#
# $Id$
#
# COPYRIGHT (c) 1989-2009.
# On-Line Applications Research Corporation (OAR).
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: sp60
directives:
rtems_rate_monotonic_create
rtems_rate_monotonic_period
concepts:
+ Ensure that when a task is blocked on one period while another period
expires which is associated with the same task, that the task remains
blocked.

View File

@@ -0,0 +1,11 @@
sparc-rtems4.10-run is /opt/rtems-4.10/bin/sparc-rtems4.10-run
*** TEST 60 ***
Init - rtems_rate_monotonic_create - first period
Init - rtems_rate_monotonic_create - second period
Init - rtems_rate_monotonic_period - short period
Init - rtems_rate_monotonic_period - long period initiated
Init - rtems_rate_monotonic_period - long period block
Init - rtems_rate_monotonic_period - verify long period expired
*** END OF TEST 60 ***

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,28 @@
##
## $Id$
##
MANAGERS = all
rtems_tests_PROGRAMS = sp61
sp61_SOURCES = init.c
dist_rtems_tests_DATA = sp61.scn
dist_rtems_tests_DATA += sp61.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
sp61_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(sp61_OBJECTS) $(sp61_LDADD)
LINK_LIBS = $(sp61_LDLIBS)
sp61$(EXEEXT): $(sp61_OBJECTS) $(sp61_DEPENDENCIES)
@rm -f sp61$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am

View File

@@ -0,0 +1,47 @@
/*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <tmacros.h>
rtems_task Init(
rtems_task_argument ignored
)
{
puts( "\n\n*** TEST 61 ***" );
puts( "Init - Set current System State to Shutdown" );
_System_state_Set( SYSTEM_STATE_SHUTDOWN );
puts( "Init - rtems_shutdown_executive when already shutdown" );
rtems_shutdown_executive( 0 );
puts( "Init - restore System State and shutdown for real" );
_System_state_Set( SYSTEM_STATE_UP );
puts( "*** END OF TEST 61 ***" );
rtems_test_exit(0);
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_REGIONS 1
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
/* global variables */

View File

@@ -0,0 +1,24 @@
#
# $Id$
#
# COPYRIGHT (c) 1989-2009.
# On-Line Applications Research Corporation (OAR).
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: sp61
directives:
_System_state_Set
rtems_shutdown_executive
concepts:
+ Ensure that shutting RTEMS down when the system state indicates it is
already shutdown does not do anything.

View File

@@ -0,0 +1,5 @@
*** TEST 61 ***
Init - Set current System State to Shutdown
Init - rtems_shutdown_executive when already shutdown
Init - restore System State and shutdown for real
*** END OF TEST 61 ***