Commit 54795ca2 authored by Daniel Silveira's avatar Daniel Silveira

Merge branch '50-hm-not-detecting-errors-from-pmk_syscall_set_schedule' into 'dev'

Resolve "HM not detecting errors from pmk_syscall_set_schedule"

Closes #50

See merge request AIR/air-dev!20
parents 3251fbf9 8420067e
......@@ -25,18 +25,23 @@ default:
- git submodule sync --recursive
- git submodule update --init --recursive
#Cronological order of jobs to be done
#To be divided in the future in multiple VMs
stages:
- sconfig-sparc
- sbuild-sparc
- sclean-build-sparc
- test_0009_sparc
- test_00009_sparc
- test_00010_sparc
- test_00012_sparc
- test_00021_sparc
- test_00022_sparc
- test_00023_sparc
- sconfig-arm
- sclean-build-arm
- sbuild-arm
- test_0001_arm
- test_00001_arm
#Build SPARC
config_sparc:
......@@ -46,16 +51,16 @@ config_sparc:
script:
- cp $AIR/../utils/gitlab-runner/.sparc_config .
- ./configure -f .sparc_config
build_sparc:
# tags:
build_sparc:
# tags:
# - sparc
stage: sbuild-sparc
script:
- make clean # to be removed and used only on failure
- make
#clean_build_sparc:
#clean_build_sparc:
# tags:
# - sparc
# stage: sclean-build-sparc
......@@ -63,8 +68,8 @@ build_sparc:
# - make clean
# - make
# when: on_failure
#Build for ARM
config_arm:
# tags:
......@@ -73,7 +78,7 @@ config_arm:
script:
- cp $AIR/../utils/gitlab-runner/.arm_config .
- ./configure -f .arm_config
build_arm:
# tags:
# - arm_qemu
......@@ -88,33 +93,95 @@ build_arm:
# stage: scleanbuild-arm
# script:
# - make clean
# - make
# - make
# when: on_failure
#Tests for SPARC
0009_sparc:
########################
#Tests for SPARC #
########################
00009_sparc:
# tags:
# - sparc
stage: test_0009_sparc
stage: test_00009_sparc
script:
- cd $AIR/examples/validation/TEST-DEF-00009
- configure
- make clean
- make
- cp $AIR/../utils/gitlab-runner/* .
- ls
- ./do_leon4_grmon.sh
- ./testcheck.py
- ./do_leon4_grmon.bash
- cd $AIR
environment:
name: SPARC LEON4
00010_sparc:
# tags:
# - sparc
stage: test_00010_sparc
script:
- cd $AIR/examples/validation/TEST-DEF-00010
- cp $AIR/../utils/gitlab-runner/* .
- ./do_leon4_grmon.bash
- cd $AIR
environment:
name: SPARC LEON4
00012_sparc:
# tags:
# - sparc
stage: test_00012_sparc
script:
- cd $AIR/examples/validation/TEST-DEF-00012
- cp $AIR/../utils/gitlab-runner/* .
- ./do_leon4_grmon.bash
- cd $AIR
environment:
name: SPARC LEON4
#Test for ARM
#00021_sparc: ## Failing in step 5
## tags:
## - sparc
# stage: test_00021_sparc
# script:
# - cd $AIR/examples/validation/TEST-DEF-00021
# - cp $AIR/../utils/gitlab-runner/* .
# - ./do_leon4_grmon.bash
# - cd $AIR
# environment:
# name: SPARC LEON4
#00022_sparc: ## Failing in step 5
## tags:
## - sparc
# stage: test_00022_sparc
# script:
# - cd $AIR/examples/validation/TEST-DEF-00022
# - cp $AIR/../utils/gitlab-runner/* .
# - ./do_leon4_grmon.bash
# - cd $AIR
# environment:
# name: SPARC LEON4
#00023_sparc: ## Failing in step 5
## tags:
## - sparc
# stage: test_00023_sparc
# script:
# - cd $AIR/examples/validation/TEST-DEF-00023
# - cp $AIR/../utils/gitlab-runner/* .
# - ./do_leon4_grmon.bash
# - cd $AIR
# environment:
# name: SPARC LEON4
########################
#Tests for ARM #
########################
# tags:
# - arm_qemu
0009_arm:
stage: test_0001_arm
00001_arm:
stage: test_00001_arm
script:
- cd $AIR/examples/arm_unit_tests/lionel
- configure
......@@ -122,7 +189,7 @@ build_arm:
- make
- cp $AIR/../utils/gitlab-runner/* .
- ls
- ./do_zynqz1_qemu.sh
- ./do_zynqz1_qemu.bash
- ./testcheck.py
- cd $AIR
environment:
......
# Ignore bash files of gitlab runner
*.bash
*.py
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* *********************************************************************** */
/* ** TEST-DEF-00009 / 9 ************************************************ */
/* *********************************************************************** */
/* ** REQUIREMENTS */
/* */
/* AIR_SEP_0120 */
/* */
/* *********************************************************************** */
/* Test Description ****************************************************** */
/* 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 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. */
#include <rtems.h>
#include <air.h>
#include <air_test.h>
#include <P0testdef.h>
#include <a653.h>
#include <imaspex.h>
/* Test external definitions ********************************************** */
/* Test type definitions ************************************************** */
/* Test global variables ************************************************** */
int unexp_error = 0;
int mtf_ticks = 50;
/* Test auxiliary functions ******************************************** */
/**
Call rtems clock get
*/
int _rtems_clock_get(rtems_interval *t1) {
#ifdef RTEMS48I
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, t1);
#else
*t1 = rtems_clock_get_ticks_since_boot();
#endif
return RTEMS_SUCCESSFUL;
}
/* Test HM callbacks *********************************************** */
void partition_HM_callback(air_state_e state_id, air_error_e i_error) {
/* signal error ocurrence */
unexp_error = 1;
return;
}
/* Test execution ******************************************************* */
int test_main(void) {
/* Test generic variables ****************************************** */
/* function to test return code */
rtems_status_code ret = RTEMS_SUCCESSFUL;
air_partition_status_t status;
/* total test result */
int res = TEST_SUCCESS;
/* wait ticks before test end to print results */
int wait = 200; // MTF is 0.4
/* Test specific variables ****************************************** */
int counter = 0;
rtems_interval t1 = 0;
rtems_interval t2 = 0;
/* Test step 0 code */
for (;;) {
/* EXPECTED:
The rtems_clock_get function call should be successfull */
ret |= _rtems_clock_get(&t1);
/* EXPECTED:
The rtems_task_wake_after function call should be successfull */
ret |= rtems_task_wake_after(2);
/* EXPECTED:
The rtems_clock_get function call should be successfull */
ret |= _rtems_clock_get(&t2);
air_syscall_get_partition_status(-1, &status);
printf ("Partition %d: Window %d\n", status.identifier, status.window_id);
} /* end for */
return 0;
}
/* Test Description ****************************************************** */
/* An non-authorized partition should not be able to register any interrupt
handler. The test should test all possible interruptions. */
#ifndef TEST_GMV_12
#define TEST_GMV_12
/* Unique Test Identifier */
#define TEST_ID (12)
/* Number of times the test procedure should be repeated */
#define TEST_REPEAT (1)
/* Unique test steps (not counting step repetitions ) */
#define TEST_STEPS (9)
/* Total number of tests steps executions */
#define TEST_ITERATIONS (9)
/* Test Steps IDs and Repeats ******************************************* */
const char* const test_step_id_list[TEST_STEPS] = { \
"000",
"001",
"002",
"003",
"004",
"005",
"006",
"007",
"008",
};
const int const test_step_rep_list[TEST_STEPS+1] = {
0, /* Test steps are not really 0-base indexed, so... */
1,
1,
1,
1,
1,
1,
1,
1,
1,
};
#endif /* TEST_GMV_12 */
/* *********************************************************************** */
/* ** TEST-DEF-00009 / 9 ************************************************ */
/* *********************************************************************** */
/* ** REQUIREMENTS */
/* */
/* AIR_SEP_0120 */
/* */
/* *********************************************************************** */
/* Test Description ****************************************************** */
/* 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 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. */
#include <rtems.h>
#include <air.h>
#include <air_test.h>
#include <P1testdef.h>
/* Test external definitions ********************************************** */
/* Test type definitions ************************************************** */
/* Test global variables ************************************************** */
int hm_was_called = 0;
int mtf_ticks = 50;
/* Test auxiliary functions *********************************************** */
/**
Call rtems clock get
*/
int _rtems_clock_get(rtems_interval *t1) {
#ifdef RTEMS48I
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, t1);
#else
*t1 = rtems_clock_get_ticks_since_boot();
#endif
return RTEMS_SUCCESSFUL;
}
/* Test HM callbacks *********************************************** */
void partition_HM_callback(air_state_e state_id,air_error_e i_error) {
hm_was_called = i_error;
return;
}
/* Test execution ******************************************************* */
int test_main (void) {
/* Test generic variables ****************************************** */
/* function to test return code */
air_partition_status_t status;
rtems_status_code ret = RTEMS_SUCCESSFUL;
/* total test result */
int res = TEST_SUCCESS;
/* wait ticks before test end to print results */
int wait = 200; // MTF is 0.4
/* Test specific variables ****************************************** */
int counter = 0;
rtems_interval t1 = 0;
rtems_interval t2 = 0;
/* Test step 0 code */
for (;;) {
ret |= rtems_task_wake_after(2);
air_syscall_get_partition_status(-1, &status);
printf ("Partition %d: Window %d\n", status.identifier, status.window_id);
}
return 0;
}
/* Test Description ****************************************************** */
/* An non-authorized partition should not be able to register any interrupt
handler. The test should test all possible interruptions. */
#ifndef TEST_GMV_12
#define TEST_GMV_12
/* Unique Test Identifier */
#define TEST_ID (12)
/* Number of times the test procedure should be repeated */
#define TEST_REPEAT (1)
/* Unique test steps (not counting step repetitions ) */
#define TEST_STEPS (9)
/* Total number of tests steps executions */
#define TEST_ITERATIONS (9)
/* Test Steps IDs and Repeats ******************************************* */
const char* const test_step_id_list[TEST_STEPS] = { \
"000",
"001",
"002",
"003",
"004",
"005",
"006",
"007",
"008",
};
const int const test_step_rep_list[TEST_STEPS+1] = {
0, /* Test steps are not really 0-base indexed, so... */
1,
1,
1,
1,
1,
1,
1,
1,
1,
};
#endif /* TEST_GMV_12 */
/* *********************************************************************** */
/* ** TEST-DEF-00012 / 12 *********************************************** */
/* *********************************************************************** */
#include <rtems.h>
#include <air.h>
#include <air_test.h>
/* *********************************************************************** */
/* ** TEST-DEF-00009 / 9 ************************************************ */
/* *********************************************************************** */
/* ** REQUIREMENTS */
/* */
/* AIR_SEP_0120 */
/* */
/* *********************************************************************** */
/* Test Description ****************************************************** */
/* 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 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. */
#include <rtems.h>
#include <air.h>
#include <air_test.h>
/* Test external definitions ********************************************** */
/* Test type definitions ************************************************** */
/* Test global variables ************************************************** */
int hm_was_called = 0;
int mtf_ticks = 50;
/* Test auxiliary functions *********************************************** */
/**
Call rtems clock get
*/
int _rtems_clock_get(rtems_interval *t1) {
#ifdef RTEMS48I
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, t1);
#else
*t1 = rtems_clock_get_ticks_since_boot();
#endif
return RTEMS_SUCCESSFUL;
}
/* Test HM callbacks *********************************************** */
void partition_HM_callback(air_state_e state_id,air_error_e i_error) {
hm_was_called = i_error;
return;
}
/* Test Printf ******************************************************* */
int test_printf (void) {
/* Test generic variables ****************************************** */
/* function to test return code */
rtems_status_code ret = RTEMS_SUCCESSFUL;
air_partition_status_t status;
/* total test result */
int res = TEST_SUCCESS;
/* wait ticks before test end to print results */
int wait = 200; // MTF is 0.4
/* Test specific variables ****************************************** */
int counter = 0;
rtems_interval t1 = 0;
rtems_interval t2 = 0;
/* Test Steps ******************************************************* */
/* Test step 0 code */
for (;;) {
ret |= rtems_task_wake_after(2);
air_syscall_get_partition_status(-1, &status);
printf ("Partition %d: Window %d\n", status.identifier, status.window_id);
}
return 0;
}
#!/bin/bash
unlock.sh
source doTest.sh
......@@ -49,7 +49,6 @@ int _rtems_clock_get(rtems_interval *t1) {
void partition_HM_callback(air_state_e state_id, air_error_e i_error) {
/* signal error ocurrence */
unexp_error = 1;
printf ("HM1 CALLED !!!\n");
return;
}
......@@ -61,7 +60,7 @@ int test_main(void) {
/* total test result */
int res = TEST_SUCCESS;
/* wait ticks before test end to print results */
int wait = 150;
int wait = 150; // MTF is 0.3
printf ("Starting TEST-DEF-0009\n");
......@@ -115,7 +114,8 @@ int test_main(void) {
/* Test Step 2
Check that the last step differs (MTF - P0) ticks execution window from
* Original passes -19 ticks consumed by P0, so 1tick from P0 + 10ticks P2 + 20 ticks from p3 == 31 in TOTAL
* test_step_announce is blocked waiting for steip 1,1
* New passes (50-19) from p0, 50ofP1 + 50ofP2 so 131 in TOTAL
the previously stored value. */
test_step_announce(2, 1);
......@@ -149,11 +149,11 @@ int test_main(void) {
test_step_announce(3, 1);
/* Test step 3 code */
air_syscall_set_schedule(1);
ret = RTEMS_SUCCESSFUL;
ret = air_syscall_set_schedule(1);
/* EXPECTED: */
if ((RTEMS_SUCCESSFUL == ret) && (0 == unexp_error)) {
if (RTEMS_SUCCESSFUL == ret) {
res &= test_report(__FILE__, __LINE__, TEST_SUCCESS,
RESULT_EQUAL | RESULT_TYPE_VALUE,
ret);
......@@ -229,7 +229,9 @@ int test_main(void) {
RESULT_DIFF | RESULT_TYPE_VALUE
, t1 - t2);
}
rtems_task_wake_after(750); //150
//Jump one MTF for initializations
rtems_task_wake_after(750);
/* Test Step 6
......
......@@ -35,7 +35,6 @@ int mtf_ticks = 50;
void partition_HM_callback(air_state_e state_id,air_error_e i_error) {
hm_was_called = i_error;
printf ("HM2 CALLED !!!\n");
return;
}
......@@ -43,7 +42,7 @@ void partition_HM_callback(air_state_e state_id,air_error_e i_error) {
int test_main (void) {
/* Test generic variables ****************************************** */
/* repeatition iteration counter */
int repeat = 0;
int repeat = 0;
/* function to test return code */
rtems_status_code ret = RTEMS_SUCCESSFUL;