summaryrefslogtreecommitdiffstats
path: root/testsuites/mptests/mp01
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-05-11 17:39:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-05-11 17:39:37 +0000
commitac7d5ef06a6d6e8d84abbd1f0b82162725f98326 (patch)
tree9304cf759a73f2a1c6fd3191948f00e870af3787 /testsuites/mptests/mp01
downloadrtems-ac7d5ef06a6d6e8d84abbd1f0b82162725f98326.tar.bz2
Initial revision
Diffstat (limited to 'testsuites/mptests/mp01')
-rw-r--r--testsuites/mptests/mp01/init.c99
-rw-r--r--testsuites/mptests/mp01/node1/mp01.doc53
-rw-r--r--testsuites/mptests/mp01/node1/mp01.scn15
-rw-r--r--testsuites/mptests/mp01/node2/mp01.doc13
-rw-r--r--testsuites/mptests/mp01/node2/mp01.scn15
-rw-r--r--testsuites/mptests/mp01/system.h30
-rw-r--r--testsuites/mptests/mp01/task1.c84
7 files changed, 309 insertions, 0 deletions
diff --git a/testsuites/mptests/mp01/init.c b/testsuites/mptests/mp01/init.c
new file mode 100644
index 0000000000..2af49c8a6b
--- /dev/null
+++ b/testsuites/mptests/mp01/init.c
@@ -0,0 +1,99 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+ char c;
+
+ printf(
+ "\n\n*** TEST 1 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ if ( Multiprocessing_configuration.node != 1 ) c = 'S';
+ else c = 'M';
+
+ Task_name[ 1 ] = rtems_build_name( c, 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( c, 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( c, 'A', '3', ' ' );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ puts( "Creating task 1 (Global)" );
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of Task 1" );
+
+ puts( "Creating task 2 (Global)" );
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of Task 2" );
+
+ puts( "Creating task 3 (Local)" );
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of Task 3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start of Task 1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start of Task 2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start of Task 3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp01/node1/mp01.doc b/testsuites/mptests/mp01/node1/mp01.doc
new file mode 100644
index 0000000000..83e06e2357
--- /dev/null
+++ b/testsuites/mptests/mp01/node1/mp01.doc
@@ -0,0 +1,53 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test50
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_set, tm_get, tm_wkafter, t_delete
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of a global task on the local processor.
+
+ i. Verifies that a task can delete itself or a global task on
+ the local processor.
+
+ j. Verifies Shared Memory Locked Queue driver for initialization,
+ getting a packet, broadcasting a packet, and returning a packet.
+
+ k. Can be used to verify that global packet type P_SYSVERIFY,
+ P_OBJCREATE (task), and P_OBJDELETE (task) are sent and
+ correctly processed by a remote node.
diff --git a/testsuites/mptests/mp01/node1/mp01.scn b/testsuites/mptests/mp01/node1/mp01.scn
new file mode 100644
index 0000000000..d399f79b2a
--- /dev/null
+++ b/testsuites/mptests/mp01/node1/mp01.scn
@@ -0,0 +1,15 @@
+*** TEST 1 -- NODE 1 ***
+Creating task 1 (Global)
+Creating task 2 (Global)
+Creating task 3 (Local)
+MA1 - rtems_clock_get - 09:00:00 12/31/1988
+MA2 - rtems_clock_get - 09:00:00 12/31/1988
+MA3 - rtems_clock_get - 09:00:00 12/31/1988
+MA1 - rtems_clock_get - 09:00:05 12/31/1988
+MA1 - deleting self
+MA2 - rtems_clock_get - 09:00:10 12/31/1988
+MA2 - waiting to be deleted by MA3
+MA3 - rtems_clock_get - 09:00:15 12/31/1988
+MA3 - getting TID of MA2
+MA3 - deleting MA2
+*** END OF TEST 1 ***
diff --git a/testsuites/mptests/mp01/node2/mp01.doc b/testsuites/mptests/mp01/node2/mp01.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp01/node2/mp01.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp01/node2/mp01.scn b/testsuites/mptests/mp01/node2/mp01.scn
new file mode 100644
index 0000000000..c9831ff9db
--- /dev/null
+++ b/testsuites/mptests/mp01/node2/mp01.scn
@@ -0,0 +1,15 @@
+*** TEST 1 -- NODE 2 ***
+Creating task 1 (Global)
+Creating task 2 (Global)
+Creating task 3 (Local)
+SA1 - rtems_clock_get - 09:00:00 12/31/1988
+SA2 - rtems_clock_get - 09:00:00 12/31/1988
+SA3 - rtems_clock_get - 09:00:00 12/31/1988
+SA1 - rtems_clock_get - 09:00:05 12/31/1988
+SA1 - deleting self
+SA2 - rtems_clock_get - 09:00:10 12/31/1988
+SA2 - waiting to be deleted by SA3
+SA3 - rtems_clock_get - 09:00:15 12/31/1988
+SA3 - getting TID of SA2
+SA3 - deleting SA2
+*** END OF TEST 1 ***
diff --git a/testsuites/mptests/mp01/system.h b/testsuites/mptests/mp01/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp01/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp01/task1.c b/testsuites/mptests/mp01/task1.c
new file mode 100644
index 0000000000..a2c3ec3a1d
--- /dev/null
+++ b/testsuites/mptests/mp01/task1.c
@@ -0,0 +1,84 @@
+/* Test_task
+ *
+ * This task is used for three test tasks. It obtains its task id and
+ * based upon that id, performs certain actions.
+ *
+ * Task_1 delays 5 seconds and deletes itself.
+ * Task_2 delays 10 seconds and then loops until
+ * deleted by the third task.
+ * Task 3 delays 15 seconds, then deletes task 2 and itself.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_id tid;
+ rtems_time_of_day time;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ put_name( Task_name[ task_number( tid ) ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+
+ status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+ put_name( Task_name[ task_number( tid ) ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+
+ if ( task_number(tid) == 1 ) { /* TASK 1 */
+ put_name( Task_name[ 1 ], FALSE );
+ printf( " - deleting self\n" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+ }
+ else if ( task_number(tid) == 2 ) { /* TASK 2 */
+ put_name( Task_name[ 2 ], FALSE );
+ printf( " - waiting to be deleted by " );
+ put_name( Task_name[ 3 ], TRUE );
+ while ( FOREVER );
+ }
+ else { /* TASK 3 */
+ put_name( Task_name[ 3 ], FALSE );
+ printf( " - getting TID of " );
+ put_name( Task_name[ 2 ], TRUE );
+ do {
+ status = rtems_task_ident( Task_name[ 2 ], RTEMS_SEARCH_ALL_NODES, &tid );
+ } while ( status != RTEMS_SUCCESSFUL );
+ directive_failed( status, "rtems_task_ident" );
+
+ put_name( Task_name[ 3 ], FALSE );
+ printf( " - deleting " );
+ put_name( Task_name[ 2 ], TRUE );
+ status = rtems_task_delete( tid );
+ directive_failed( status, "rtems_task_delete of Task 2" );
+
+ puts( "*** END OF TEST 1 ***" );
+ exit(0);
+ }
+}