diff options
Diffstat (limited to 'testsuites/mptests/mp02')
-rw-r--r-- | testsuites/mptests/mp02/init.c | 63 | ||||
-rw-r--r-- | testsuites/mptests/mp02/node1/mp02.doc | 47 | ||||
-rw-r--r-- | testsuites/mptests/mp02/node1/mp02.scn | 14 | ||||
-rw-r--r-- | testsuites/mptests/mp02/node2/mp02.doc | 13 | ||||
-rw-r--r-- | testsuites/mptests/mp02/node2/mp02.scn | 14 | ||||
-rw-r--r-- | testsuites/mptests/mp02/system.h | 30 | ||||
-rw-r--r-- | testsuites/mptests/mp02/task1.c | 118 |
7 files changed, 299 insertions, 0 deletions
diff --git a/testsuites/mptests/mp02/init.c b/testsuites/mptests/mp02/init.c new file mode 100644 index 0000000000..75d8565785 --- /dev/null +++ b/testsuites/mptests/mp02/init.c @@ -0,0 +1,63 @@ +/* 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; + + printf( + "\n\n*** TEST 2 -- NODE %d ***\n", + Multiprocessing_configuration.node + ); + + Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' ); + Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' ); + + puts( "Creating Test_task (Global)" ); + status = rtems_task_create( + Task_name[Multiprocessing_configuration.node], + 1, + 2048, + RTEMS_NO_PREEMPT, + RTEMS_GLOBAL, + &Task_id[ 1 ] + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Starting Test_task (Global)" ); + status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Deleting initialization task" ); + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); +} diff --git a/testsuites/mptests/mp02/node1/mp02.doc b/testsuites/mptests/mp02/node1/mp02.doc new file mode 100644 index 0000000000..e74807f7f1 --- /dev/null +++ b/testsuites/mptests/mp02/node1/mp02.doc @@ -0,0 +1,47 @@ +# +# $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: test51 + +directives: + ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, + tm_set, tm_get, tm_wkafter, t_delete, t_restart, t_getreg, t_setreg + +concepts: + + a. Verifies system can create and start both the executive's system + initialization and idle task. + + b. Verifies can print strings to the CRT on port 2 of the mvme136 board + using Print and Println in the board support package. + + c. Verifies interrupt handler can handler a task switch from an interrupt + as specified with the i_return directive. + + d. Verifies executive initialization performed correctly. + + e. Verifies that a task can get the task identification number of itself. + + f. Verifies that a task can get the task identification number + of another task. + + g. Verifies that a task can delete itself or another task. + + h. Verifies that errors are returned in the following situations: + 1) when attempting to delete a remote task. + 2) when attempting to start a remote task. + 3) when attempting to restart a remote task. + + i. Verifies that a remote task's registers can be set and read. diff --git a/testsuites/mptests/mp02/node1/mp02.scn b/testsuites/mptests/mp02/node1/mp02.scn new file mode 100644 index 0000000000..72fdefe69d --- /dev/null +++ b/testsuites/mptests/mp02/node1/mp02.scn @@ -0,0 +1,14 @@ +*** TEST 2 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Remote task's name is : 222 +Getting TID of remote task (all nodes) +Getting TID of remote task (1 node) +rtems_task_delete of remote task returned the correct error +rtems_task_start of remote task returned the correct error +rtems_task_restart of remote task returned the correct error +Setting notepad 1 of the remote task to 1 +Getting a notepad of the remote task +Remote notepad set and read correctly +*** END OF TEST 2 *** diff --git a/testsuites/mptests/mp02/node2/mp02.doc b/testsuites/mptests/mp02/node2/mp02.doc new file mode 100644 index 0000000000..0de40191c6 --- /dev/null +++ b/testsuites/mptests/mp02/node2/mp02.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/mp02/node2/mp02.scn b/testsuites/mptests/mp02/node2/mp02.scn new file mode 100644 index 0000000000..233a910999 --- /dev/null +++ b/testsuites/mptests/mp02/node2/mp02.scn @@ -0,0 +1,14 @@ +*** TEST 2 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Remote task's name is : 111 +Getting TID of remote task (all nodes) +Getting TID of remote task (1 node) +rtems_task_delete of remote task returned the correct error +rtems_task_start of remote task returned the correct error +rtems_task_restart of remote task returned the correct error +Setting notepad 2 of the remote task to 2 +Getting a notepad of the remote task +Remote notepad set and read correctly +*** END OF TEST 2 *** diff --git a/testsuites/mptests/mp02/system.h b/testsuites/mptests/mp02/system.h new file mode 100644 index 0000000000..aa2c6d17e4 --- /dev/null +++ b/testsuites/mptests/mp02/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/mp02/task1.c b/testsuites/mptests/mp02/task1.c new file mode 100644 index 0000000000..44764486b0 --- /dev/null +++ b/testsuites/mptests/mp02/task1.c @@ -0,0 +1,118 @@ +/* Test_task + * + * This task tests the rtems_task_set_note directive on a remote task and that + * errors are returned when attempting to delete, start, or restart + * a remote task. + * + * 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" + +extern rtems_multiprocessing_table Multiprocessing_configuration; + +rtems_task Test_task( + rtems_task_argument argument +) +{ + rtems_id tid; + rtems_status_code status; + rtems_unsigned32 remote_node; + rtems_id remote_tid; + rtems_id test_tid; + rtems_unsigned32 note; + + status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); + + remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1; + printf( "Remote task's name is : " ); + put_name( Task_name[ remote_node ], TRUE ); + + puts( "Getting TID of remote task (all nodes)" ); + do { + status = rtems_task_ident( + Task_name[ remote_node ], + RTEMS_SEARCH_ALL_NODES, + &remote_tid + ); + } while ( status != RTEMS_SUCCESSFUL ); + + directive_failed( status, "rtems_task_ident" ); + + puts( "Getting TID of remote task (1 node)" ); + status = rtems_task_ident( Task_name[ remote_node ], remote_node, &test_tid ); + directive_failed( status, "rtems_task_ident" ); + + if ( test_tid != remote_tid ) { + puts( "rtems_task_ident tid's do not match!!" ); + rtems_fatal_error_occurred( status ); + } + + status = rtems_task_delete( remote_tid ); + fatal_directive_status( + status, + RTEMS_ILLEGAL_ON_REMOTE_OBJECT, + "rtems_task_delete of remote task" + ); + puts( "rtems_task_delete of remote task returned the correct error" ); + + status = rtems_task_start( remote_tid, Test_task, 0 ); + fatal_directive_status( + status, + RTEMS_ILLEGAL_ON_REMOTE_OBJECT, + "rtems_task_start of remote task" + ); + puts( "rtems_task_start of remote task returned the correct error" ); + + status = rtems_task_restart( remote_tid, 0 ); + fatal_directive_status( + status, + RTEMS_ILLEGAL_ON_REMOTE_OBJECT, + "rtems_task_restart of remote task" + ); + puts( "rtems_task_restart of remote task returned the correct error" ); + + printf( + "Setting notepad %d of the remote task to %d\n", + rtems_get_node(tid), + rtems_get_node(tid) + ); + status = rtems_task_set_note( + remote_tid, + rtems_get_node(tid), + rtems_get_node(tid) + ); + directive_failed( status, "rtems_task_set_note" ); + + puts( "Getting a notepad of the remote task" ); + status = rtems_task_get_note( remote_tid, rtems_get_node(tid), ¬e ); + directive_failed( status, "rtems_task_get_note" ); + + if ( note == rtems_get_node(tid) ) + puts( "Remote notepad set and read correctly" ); + else + printf( + "FAILURE!! Remote notepad was not set and read correctly (%d, %d)\n", + note, + rtems_get_node( tid ) + ); + + status = rtems_task_wake_after( TICKS_PER_SECOND ); + directive_failed( status, "rtems_task_wake_after" ); + + puts( "*** END OF TEST 2 ***" ); + exit( 0 ); +} |