Commit b8e5ec87 authored by Daniel Silveira's avatar Daniel Silveira

Executed testgen.py in all unit tests, but it deletes info that needs to be generated.

Unit test TEST-DEF-00009, added sucessfuly.

Closes #46
parent c1f2c22f
......@@ -11,7 +11,7 @@ default:
- pwd
- ls
- export RTEMS410=/opt/rtems-4.10/bin
- export AIR=/home/gitlab-runner/builds/J/0/AIR/jPaxxwjh/air-dev/air
- export AIR=`pwd`
- export PATH=$PATH:$AIR
- export PATH=$PATH:$RTEMS410
- export GIT_SSL_NO_VERIFY=1
......@@ -28,30 +28,43 @@ default:
stages:
- sconfig-sparc
- sbuild-sparc
- test_0009_sparc
- sconfig-arm
- sbuild-arm
config_sparc:
stage: sconfig-sparc
script:
- cp /home/taste/work/gitlab/.sparc_config . #local file of VM at ~/work/gitlab/
- cp $AIR/../utils/gitlab-runner/.sparc_config .
- ./configure -f .sparc_config
build_sparc:
stage: sbuild-sparc
script:
- make clean
- make
config_arm:
stage: sconfig-arm
script:
- cp /home/taste/work/gitlab/.arm_config . #local file of VM at ~/work/gitlab/
- cp $AIR/../utils/gitlab-runner/.arm_config .
- ./configure -f .arm_config
build_arm:
stage: sbuild-arm
script:
- make
0009_sparc:
stage: test_0009_sparc
script:
- cd $AIR/examples/validation/TEST-DEF-00009
- configure
- make clean
- make
- cp $AIR/../utils/gitlab-runner/* .
- ls
- ./doit.sh
- ./testcheck.py
- cd $AIR
environment:
name: SPARC LEON4
......@@ -5,32 +5,30 @@
* found in the file LICENSE in this distribution or at
* https://spass-git-ext.gmv.com/AIR/AIR/raw/master/air/LICENSE
*/
#include <rtems.h>
#include <rtems.h>
#include <a653.h>
#include <imaspex.h>
#include <pprintf.h>
SAMPLING_PORT_ID_TYPE SEND_PORT;
void error_message(RETURN_CODE_TYPE rc){
switch(rc){
case INVALID_CONFIG:
pprintf("WRITE_SAMPLING_MESSAGE error Invalid Config\n");
break;
case INVALID_PARAM:
pprintf("WRITE_SAMPLING_MESSAGE error Invalid Param\n");
break;
case INVALID_MODE:
pprintf("WRITE_SAMPLING_MESSAGE error Invalid Mode\n");
break;
default:
pprintf("WRITE_SAMPLING_MESSAGE error %d\n", rc);
break;
}
void error_message(RETURN_CODE_TYPE rc) {
switch (rc) {
case INVALID_CONFIG:
pprintf("WRITE_SAMPLING_MESSAGE error Invalid Config\n");
break;
case INVALID_PARAM:
pprintf("WRITE_SAMPLING_MESSAGE error Invalid Param\n");
break;
case INVALID_MODE:
pprintf("WRITE_SAMPLING_MESSAGE error Invalid Mode\n");
break;
default:
pprintf("WRITE_SAMPLING_MESSAGE error %d\n", rc);
break;
}
}
/*---------------------------------------------------------
......@@ -39,92 +37,92 @@ void error_message(RETURN_CODE_TYPE rc){
------------------------------------------------------------*/
void test(PARTITION_ID_TYPE self_id) {
char sample[3] = "S0 ";
/* get the number of ticks per second */
uint32_t tps = 1000000 / air_syscall_get_us_per_tick();
pprintf("TPS %i\n", tps);
char sample[3] = "S0 ";
/* get the number of ticks per second */
uint32_t tps = 1000000 / air_syscall_get_us_per_tick();
pprintf("TPS %i\n", tps);
uint32_t interval = 0;
RETURN_CODE_TYPE rc = NO_ERROR;
rtems_interval time;
RETURN_CODE_TYPE rc = NO_ERROR;
rtems_interval time;
while(1) {
while (1) {
#ifdef RTEMS48I
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &time);
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &time);
#else
time = rtems_clock_get_ticks_since_boot();
time = rtems_clock_get_ticks_since_boot();
#endif
pprintf ("Partition %d at time %d sending: %s\n", self_id, time, sample);
pprintf("Partition %d at time %d sending: %s\n", self_id, time, sample);
WRITE_SAMPLING_MESSAGE (SEND_PORT, (MESSAGE_ADDR_TYPE )sample, 3, &rc );
if (NO_ERROR != rc)
error_message(rc);
WRITE_SAMPLING_MESSAGE(SEND_PORT, (MESSAGE_ADDR_TYPE) sample, 3, &rc);
if (NO_ERROR != rc)
error_message(rc);
/*identify the string with an integer index*/
sample[1] += 1;
/*identify the string with an integer index*/
sample[1] += 1;
if (sample[1] == ':')
sample[1] = '0';
if (sample[1] == ':')
sample[1] = '0';
#ifdef RTEMS48I
// 0.7 * tps does not work!
interval = tps * 7;
interval /= 10;
// 0.7 * tps does not work!
interval = tps * 7;
interval /= 10;
#else
interval = tps * 0.7;
interval = tps * 0.7;
#endif
pprintf("interval %i\n", interval);
pprintf("interval %i\n", interval);
rtems_task_wake_after(interval);
}
rtems_task_wake_after(interval);
}
}
int entry_func() {
RETURN_CODE_TYPE rc;
RETURN_CODE_TYPE rc;
rtems_name name = 10000;
rtems_mode mode = RTEMS_PREEMPT ;
rtems_name name = 10000;
rtems_mode mode = RTEMS_PREEMPT;
#ifdef RTEMS48I
rtems_mode mode_mask = RTEMS_PREEMPT_MASK;
rtems_mode mode_mask = RTEMS_PREEMPT_MASK;
#else
rtems_attribute attribute_set = RTEMS_LOCAL | RTEMS_FLOATING_POINT;
rtems_attribute attribute_set = RTEMS_LOCAL | RTEMS_FLOATING_POINT;
#endif
rtems_id id;
PARTITION_ID_TYPE self_id;
/*Getting my own partition id*/
GET_PARTITION_ID(&self_id, &rc);
if(NO_ERROR != rc) {
pprintf("GET_PARTITION_ID error %d\n", rc);
}
pprintf("Initializing partition %d...\n", self_id);
/*Creating Source sampling Port*/
SAMPLING_PORT_NAME_TYPE NAME = "ssampling";
MESSAGE_SIZE_TYPE SIZE = 1024;
SYSTEM_TIME_TYPE PERIOD= 1000000000ll;
CREATE_SAMPLING_PORT (NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc);
if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc);
}
rtems_id id;
PARTITION_ID_TYPE self_id;
/*Getting my own partition id*/
GET_PARTITION_ID(&self_id, &rc);
if (NO_ERROR != rc) {
pprintf("GET_PARTITION_ID error %d\n", rc);
}
pprintf("Initializing partition %d...\n", self_id);
/*Creating Source sampling Port*/
SAMPLING_PORT_NAME_TYPE NAME = "ssampling";
MESSAGE_SIZE_TYPE SIZE = 1024;
SYSTEM_TIME_TYPE PERIOD = 1000000000ll;
CREATE_SAMPLING_PORT(NAME, SIZE, SOURCE, PERIOD, &SEND_PORT, &rc);
if (NO_ERROR != rc) {
pprintf("CREATE_SAMPLING_PORT error %d\n", rc);
}
#ifdef RTEMS48I
if (RTEMS_SUCCESSFUL == rtems_task_create (name, 15, 4096, mode, mode_mask, &id)) {
rtems_task_start (id, test, self_id);
}
if (RTEMS_SUCCESSFUL == rtems_task_create(name, 15, 4096, mode, mode_mask, &id)) {
rtems_task_start(id, test, self_id);
}
#else
if (RTEMS_SUCCESSFUL == rtems_task_create (name, 15, 4096, mode, attribute_set, &id)) {
rtems_task_start (id, (rtems_task_entry)test, self_id);
}
if (RTEMS_SUCCESSFUL == rtems_task_create(name, 15, 4096, mode, attribute_set, &id)) {
rtems_task_start(id, (rtems_task_entry) test, self_id);
}
#endif
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
}
return RTEMS_SUCCESSFUL;
SET_PARTITION_MODE(NORMAL, &rc);
if (NO_ERROR != rc) {
pprintf("SET_PARTITION_MODE error %d\n", rc);
}
return RTEMS_SUCCESSFUL;
}
......@@ -9,9 +9,9 @@
/* *********************************************************************** */
/* Test Description ****************************************************** */
/* Call the pal_schedule_change function from an authorized partition and
/* Call the air_syscall_set_schedule function from an authorized partition and
check that the partitioning schedule is altered starting at the next major time
frame (MTF) start. Check that a call to pal_schedule_change with the current
frame (MTF) start. Check that a call to air_syscall_set_schedule with the current
schedule produces no change. Check that the call from a non-authorized partition
fails with an HM process/ partition event. */
......@@ -19,6 +19,8 @@
#include <air.h>
#include <air_test.h>
#include <P0testdef.h>
#include <a653.h>
#include <imaspex.h>
/* Test external definitions ********************************************** */
......@@ -91,8 +93,9 @@ int test_main (void) {
ret |= _rtems_clock_get(&t2);
/* EXPECTED:
The clock tick difference should be equal to 1 */
ret |= t2 == t1 + 1 ? RTEMS_SUCCESSFUL : 1;
//printf ("->r%d-t%d ", ret, t2-t1 );
ret |= t2 == t1 + 1 ? RTEMS_SUCCESSFUL : 1;
} /* end for */
if (RTEMS_SUCCESSFUL == ret) {
......@@ -137,7 +140,7 @@ int test_main (void) {
rtems_task_wake_after(wait);
/* Test Step 3
Call pal_schedule_change for schedule 1. */
Call air_syscall_set_schedule for schedule 1. */
test_step_announce(3,1);
/* Test step 3 code */
......
......@@ -9,9 +9,9 @@
/* *********************************************************************** */
/* Test Description ****************************************************** */
/* Call the pal_schedule_change function from an authorized partition and
/* Call the air_syscall_set_schedule function from an authorized partition and
check that the partitioning schedule is altered starting at the next major time
frame (MTF) start. Check that a call to pal_schedule_change with the current
frame (MTF) start. Check that a call to air_syscall_set_schedule with the current
schedule produces no change. Check that the call from a non-authorized partition
fails with an HM process/ partition event. */
......@@ -58,7 +58,7 @@ int test_main (void) {
/* Test Steps ******************************************************* */
/* Test Step 1
Call pal_schedule_change for scheedule 1, and check that a
Call air_syscall_set_schedule for scheedule 1, and check that a
PMK_VIOL_ERR fault occured, that was captured by the partition
callback. */
test_step_announce(1,1);
......
#!/bin/bash
sshpass -p 'cgd17832201' scp executable/AIRAPP.exe dtms@83.240.244.237:~
sshpass -p 'cgd17832201' scp runAIRAPP.sh dtms@83.240.244.237:~
sshpass -p 'cgd17832201' ssh -tt dtms@83.240.244.237 << 'ENDSSH'
unlock.sh
board-commands.sh runAIRAPP.sh
ENDSSH
......@@ -15,7 +15,7 @@
mtf="1.5"
ms_per_tick="2"
type="TEST_GMV_VAL"
personality="RTEMSIMPR">
personality="RTEMS5">
<description>
Call the pal_schedule_change function from an authorized partition
and check that the partitioning schedule is altered starting at the next
......
<
......@@ -16,10 +16,10 @@
non-authorized partition fails with an HM process/ partition event. */
#include <rtems.h>
#include <pmk_hm.h>
#include <pal.h>
#include <pal_pprintf.h>
#include <pal_test.h>
#include <air.h>
#include <air_test.h>
#include <P0testdef.h>
#include <imaspex.h>
......@@ -36,10 +36,10 @@ int mtf_ticks = 50;
/* Test auxiliary functions ******************************************** */
/* Test HM callbacks *********************************************** */
void hm_part_callback (pmk_hm_err_id_e i_error,void *i_state) {
void partition_HM_callback(air_state_e state_id,air_error_e i_error) {
/* i_state is not really a pointer, this signature is required due to the
pal_callbacks function signature -> convert it into a relevant value */
pmk_hm_state_id_e state = (pmk_hm_state_id_e) i_state;
/* signal error ocurrence */
unexp_error = 1;
return;
......@@ -94,11 +94,11 @@ int test_main (void) {
} /* end for */
if (RTEMS_SUCCESSFUL == ret) {
res &= test_step_report( TEST_SUCCESS,
res &= test_report(__FILE__, __LINE__, TEST_SUCCESS,
RESULT_EQUAL | RESULT_TYPE_VALUE,
ret);
} else {
res &= test_step_report( TEST_FAILURE,
res &= test_report(__FILE__, __LINE__, TEST_FAILURE,
RESULT_DIFF | RESULT_TYPE_VALUE,
t2-t1);
}
......@@ -123,11 +123,11 @@ int test_main (void) {
/* EXPECTED: */
if (RTEMS_SUCCESSFUL == ret) {
res &= test_step_report( TEST_SUCCESS,
res &= test_report(__FILE__, __LINE__, TEST_SUCCESS,
RESULT_EQUAL | RESULT_TYPE_VALUE,
ret);
} else {
res &= test_step_report( TEST_FAILURE,
res &= test_report(__FILE__, __LINE__, TEST_FAILURE,
RESULT_DIFF | RESULT_TYPE_VALUE
,t1-t2);
}
......@@ -149,11 +149,11 @@ int test_main (void) {
/* EXPECTED: */
if ((RTEMS_SUCCESSFUL == ret) && (0 == unexp_error)) {
res &= test_step_report( TEST_SUCCESS,
res &= test_report(__FILE__, __LINE__, TEST_SUCCESS,
RESULT_EQUAL | RESULT_TYPE_VALUE,
ret);
} else {
res &= test_step_report( TEST_FAILURE,
res &= test_report(__FILE__, __LINE__, TEST_FAILURE,
RESULT_DIFF | RESULT_TYPE_VALUE
,ret);
}
......@@ -187,11 +187,11 @@ int test_main (void) {
/* EXPECTED: */
if ((RTEMS_SUCCESSFUL == ret) && (0 == unexp_error)) {
res &= test_step_report( TEST_SUCCESS,
res &= test_report(__FILE__, __LINE__, TEST_SUCCESS,
RESULT_EQUAL | RESULT_TYPE_VALUE,
ret);
} else {
res &= test_step_report( TEST_FAILURE,
res &= test_report(__FILE__, __LINE__, TEST_FAILURE,
RESULT_DIFF | RESULT_TYPE_VALUE
,t1-t2);
}
......@@ -215,11 +215,11 @@ int test_main (void) {
/* EXPECTED: */
if (RTEMS_SUCCESSFUL == ret) {
res &= test_step_report( TEST_SUCCESS,
res &= test_report(__FILE__, __LINE__, TEST_SUCCESS,
RESULT_EQUAL | RESULT_TYPE_VALUE,
ret);
} else {
res &= test_step_report( TEST_FAILURE,
res &= test_report(__FILE__, __LINE__, TEST_FAILURE,
RESULT_DIFF | RESULT_TYPE_VALUE
,t1-t2);
}
......@@ -253,11 +253,11 @@ int test_main (void) {
} /* end for */