[rtems-central commit] spec: Add INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED

Sebastian Huber sebh at rtems.org
Fri Oct 14 12:52:41 UTC 2022


Module:    rtems-central
Branch:    master
Commit:    b00ec1df11d35067104502d673e35890992e6970
Changeset: http://git.rtems.org/rtems-central/commit/?id=b00ec1df11d35067104502d673e35890992e6970

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 28 13:32:50 2022 +0200

spec: Add INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED

---

 spec/score/interr/if/idle-thread-create-failed.yml | 17 ++++++
 .../thread/req/fatal-idle-thread-create-failed.yml | 18 ++++++
 .../thread/val/fatal-idle-thread-create-failed.yml | 64 ++++++++++++++++++++++
 .../testsuites/fatal-idle-thread-create-failed.yml | 36 ++++++++++++
 4 files changed, 135 insertions(+)

diff --git a/spec/score/interr/if/idle-thread-create-failed.yml b/spec/score/interr/if/idle-thread-create-failed.yml
new file mode 100644
index 00000000..7f2877ca
--- /dev/null
+++ b/spec/score/interr/if/idle-thread-create-failed.yml
@@ -0,0 +1,17 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+index-entries: []
+interface-type: unspecified-enumerator
+links:
+- role: interface-placement
+  uid: header
+- role: interface-ingroup
+  uid: group
+name: INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED
+references:
+- identifier: internal_errors
+  name: c-user
+  type: document
+type: interface
diff --git a/spec/score/thread/req/fatal-idle-thread-create-failed.yml b/spec/score/thread/req/fatal-idle-thread-create-failed.yml
new file mode 100644
index 00000000..037fa1f1
--- /dev/null
+++ b/spec/score/thread/req/fatal-idle-thread-create-failed.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: requirement-refinement
+  uid: /req/fatal-error
+- role: requirement-refinement
+  uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  If the initialization of an idle thread fails, then the system shall
+  terminate with the ${/score/interr/if/internal-error-core:/name} fatal source
+  and the ${/score/interr/if/idle-thread-create-failed:/name} fatal code.
+type: requirement
diff --git a/spec/score/thread/val/fatal-idle-thread-create-failed.yml b/spec/score/thread/val/fatal-idle-thread-create-failed.yml
new file mode 100644
index 00000000..a2bc547f
--- /dev/null
+++ b/spec/score/thread/val/fatal-idle-thread-create-failed.yml
@@ -0,0 +1,64 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links: []
+test-actions:
+- action-brief: |
+    The test action is carried out by configuring a task create extension which
+    always fails.
+  action-code: |
+    /* Nothing to do */
+  checks:
+  - brief: |
+      Check that the expected fatal source is present.
+    code: |
+      T_step_eq_int( ${step}, ctx->source, INTERNAL_ERROR_CORE );
+    links:
+    - role: validation
+      uid: ../req/fatal-idle-thread-create-failed
+  - brief: |
+      Check that the expected fatal code is present.
+    code: |
+      T_step_eq_ulong(
+        ${step},
+        ctx->code,
+        INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED
+      );
+    links:
+    - role: validation
+      uid: ../req/fatal-idle-thread-create-failed
+  links: []
+test-brief: |
+  Tests a fatal error caused by a failing task create extension.
+test-context: []
+test-context-support: null
+test-description: null
+test-header:
+  code: null
+  freestanding: true
+  includes:
+  - rtems.h
+  local-includes: []
+  run-params:
+  - description: |
+      is the fatal source.
+    dir: null
+    name: source
+    specifier: ${/rtems/userext/if/fatal-source:/name} ${.:name}
+  - description: |
+      is the fatal code.
+    dir: null
+    name: code
+    specifier: ${/rtems/userext/if/fatal-code:/name} ${.:name}
+  target: testsuites/validation/tr-fatal-idle-thread-create-failed.h
+test-includes:
+- rtems.h
+test-local-includes:
+- tr-fatal-idle-thread-create-failed.h
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tr-fatal-idle-thread-create-failed.c
+test-teardown: null
+type: test-case
diff --git a/spec/testsuites/fatal-idle-thread-create-failed.yml b/spec/testsuites/fatal-idle-thread-create-failed.yml
new file mode 100644
index 00000000..a805e6e8
--- /dev/null
+++ b/spec/testsuites/fatal-idle-thread-create-failed.yml
@@ -0,0 +1,36 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+test-brief: |
+  This validation test suite contains a test case which is triggered by a fatal
+  error during system initialization.
+test-code: |
+  const char rtems_test_name[] = "${.:/test-suite-name}";
+
+  static bool CreateTask( rtems_tcb *executing, rtems_tcb *created )
+  {
+    (void) executing;
+    (void) created;
+    return false;
+  }
+
+  #define FATAL_SYSINIT_RUN ScoreThreadValFatalIdleThreadCreateFailed_Run
+
+  #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+  #define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
+
+  #define FATAL_SYSINIT_INITIAL_EXTENSION { .thread_create = CreateTask }
+
+  #include "ts-fatal-sysinit.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- tr-fatal-idle-thread-create-failed.h
+test-suite-name: FatalIdleThreadCreateFailed
+test-target: testsuites/validation/ts-fatal-idle-thread-create-failed.c
+type: test-suite



More information about the vc mailing list