summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-22 10:48:26 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-24 13:13:51 +0200
commite3a2b9fbd2245271e0a0e02a2408665fe737ded9 (patch)
tree6cdc2b09882534b3c2f1516652d0ff6adf76c0e5
parentspec: Improve mutex try seize specification (diff)
downloadrtems-central-e3a2b9fbd2245271e0a0e02a2408665fe737ded9.tar.bz2
spec: Test thread queue API change
-rw-r--r--spec/rtems/sem/req/obtain.yml2
-rw-r--r--spec/score/tq/req/enqueue-ceiling.yml13
-rw-r--r--spec/score/tq/req/enqueue-deadlock.yml7
-rw-r--r--spec/score/tq/req/enqueue-mrsp.yml55
-rw-r--r--spec/score/tq/req/enqueue-priority.yml12
-rw-r--r--spec/score/tq/req/flush-priority-inherit.yml20
-rw-r--r--spec/score/tq/req/flush-priority.yml6
-rw-r--r--spec/score/tq/req/timeout-priority-inherit.yml6
-rw-r--r--spec/score/tq/req/timeout.yml7
9 files changed, 23 insertions, 105 deletions
diff --git a/spec/rtems/sem/req/obtain.yml b/spec/rtems/sem/req/obtain.yml
index b14eb669..b40cf1fa 100644
--- a/spec/rtems/sem/req/obtain.yml
+++ b/spec/rtems/sem/req/obtain.yml
@@ -216,7 +216,7 @@ test-action: |
sc = rtems_semaphore_set_priority(
ctx->tq_ctx.thread_queue_id,
- ctx->tq_ctx.other_scheduler_id,
+ SCHEDULER_B_ID,
PRIO_VERY_HIGH,
&prio
);
diff --git a/spec/score/tq/req/enqueue-ceiling.yml b/spec/score/tq/req/enqueue-ceiling.yml
index 9d683931..a9906653 100644
--- a/spec/score/tq/req/enqueue-ceiling.yml
+++ b/spec/score/tq/req/enqueue-ceiling.yml
@@ -192,10 +192,10 @@ test-action: |
if ( ctx->helping ) {
if ( ctx->other_before || ctx->other_after ) {
if ( rtems_scheduler_get_processor_maximum() > 2 ) {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->third_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_C_ID );
}
} else {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->other_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_B_ID );
}
}
@@ -283,17 +283,12 @@ test-setup:
code: |
rtems_id scheduler_id;
- scheduler_id = ctx->tq_ctx->runner_scheduler_id;
+ scheduler_id = SCHEDULER_A_ID;
TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, scheduler_id, PRIO_VERY_HIGH );
TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, scheduler_id, PRIO_VERY_HIGH );
TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_C, scheduler_id, PRIO_VERY_HIGH );
#if defined( RTEMS_SMP )
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_D,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_D, SCHEDULER_B_ID, PRIO_LOW );
#endif
description: null
test-stop: null
diff --git a/spec/score/tq/req/enqueue-deadlock.yml b/spec/score/tq/req/enqueue-deadlock.yml
index 1b89528a..057b9051 100644
--- a/spec/score/tq/req/enqueue-deadlock.yml
+++ b/spec/score/tq/req/enqueue-deadlock.yml
@@ -134,12 +134,7 @@ test-action: |
TQ_EVENT_SURRENDER | TQ_EVENT_RUNNER_SYNC
);
TQSynchronizeRunner();
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_A,
- ctx->tq_ctx->runner_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, SCHEDULER_A_ID, PRIO_HIGH );
} else {
TQSend( ctx->tq_ctx, TQ_BLOCKER_A, TQ_EVENT_SURRENDER );
}
diff --git a/spec/score/tq/req/enqueue-mrsp.yml b/spec/score/tq/req/enqueue-mrsp.yml
index 2708cab3..9adeb8ca 100644
--- a/spec/score/tq/req/enqueue-mrsp.yml
+++ b/spec/score/tq/req/enqueue-mrsp.yml
@@ -310,45 +310,17 @@ test-setup:
brief: null
code: |
if ( CanDoFullValidation() ) {
- rtems_status_code sc;
-
- sc = rtems_scheduler_remove_processor(
- ctx->tq_ctx->third_scheduler_id,
- 2
- );
- T_rsc_success( sc );
-
- sc = rtems_scheduler_add_processor(
- ctx->tq_ctx->other_scheduler_id,
- 2
- );
- T_rsc_success( sc );
-
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_C,
- ctx->tq_ctx->third_scheduler_id,
- PRIO_LOW
- );
+ RemoveProcessor( SCHEDULER_C_ID, 2 );
+ AddProcessor( SCHEDULER_B_ID, 2 );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_C, SCHEDULER_C_ID, PRIO_LOW );
}
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_A,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_B,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
-
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, SCHEDULER_B_ID, PRIO_LOW );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_B_ID, PRIO_LOW );
TQSetScheduler(
ctx->tq_ctx,
TQ_BLOCKER_D,
- ctx->tq_ctx->runner_scheduler_id,
+ SCHEDULER_A_ID,
PRIO_ULTRA_HIGH
);
description: null
@@ -369,19 +341,8 @@ test-teardown:
brief: null
code: |
if ( CanDoFullValidation() ) {
- rtems_status_code sc;
-
- sc = rtems_scheduler_remove_processor(
- ctx->tq_ctx->other_scheduler_id,
- 2
- );
- T_rsc_success( sc );
-
- sc = rtems_scheduler_add_processor(
- ctx->tq_ctx->third_scheduler_id,
- 2
- );
- T_rsc_success( sc );
+ RemoveProcessor( SCHEDULER_B_ID, 2 );
+ AddProcessor( SCHEDULER_C_ID, 2 );
}
TQReset( ctx->tq_ctx );
diff --git a/spec/score/tq/req/enqueue-priority.yml b/spec/score/tq/req/enqueue-priority.yml
index 306d996d..8449230f 100644
--- a/spec/score/tq/req/enqueue-priority.yml
+++ b/spec/score/tq/req/enqueue-priority.yml
@@ -228,10 +228,10 @@ test-action: |
if ( ctx->helping ) {
if ( ctx->other_before || ctx->other_after ) {
if ( rtems_scheduler_get_processor_maximum() > 2 ) {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->third_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_C_ID );
}
} else {
- AddHelper( ctx->tq_ctx, ctx->tq_ctx->other_scheduler_id );
+ AddHelper( ctx->tq_ctx, SCHEDULER_B_ID );
}
}
@@ -314,17 +314,13 @@ test-prepare:
test-setup:
brief: null
code: |
+ TQReset( ctx->tq_ctx );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_A, PRIO_ULTRA_HIGH );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_B, PRIO_LOW );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_C, PRIO_VERY_HIGH );
#if defined( RTEMS_SMP )
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_D,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_LOW
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_D, SCHEDULER_B_ID, PRIO_LOW );
#endif
description: null
test-stop: null
diff --git a/spec/score/tq/req/flush-priority-inherit.yml b/spec/score/tq/req/flush-priority-inherit.yml
index eef2856e..ad070b9f 100644
--- a/spec/score/tq/req/flush-priority-inherit.yml
+++ b/spec/score/tq/req/flush-priority-inherit.yml
@@ -134,18 +134,9 @@ test-action: |
if ( ctx->tq_ctx->how_many > 0 ) {
if ( ctx->minimum ) {
if ( rtems_configuration_get_maximum_processors() > 1 ) {
- TQSetScheduler(
- ctx->tq_ctx, TQ_BLOCKER_B,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_B_ID, PRIO_HIGH );
} else {
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_B,
- ctx->tq_ctx->runner_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_A_ID, PRIO_HIGH );
}
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_C, PRIO_VERY_HIGH );
@@ -153,12 +144,7 @@ test-action: |
TQSend( ctx->tq_ctx, TQ_BLOCKER_C, TQ_EVENT_ENQUEUE );
TQSend( ctx->tq_ctx, TQ_BLOCKER_D, TQ_EVENT_ENQUEUE );
} else {
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_B,
- ctx->tq_ctx->runner_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_A_ID, PRIO_HIGH );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_C, PRIO_HIGH );
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_D, PRIO_HIGH );
diff --git a/spec/score/tq/req/flush-priority.yml b/spec/score/tq/req/flush-priority.yml
index c4bb20c5..7e5ac0c4 100644
--- a/spec/score/tq/req/flush-priority.yml
+++ b/spec/score/tq/req/flush-priority.yml
@@ -130,11 +130,7 @@ test-setup:
ctx->supports_multiple_priority_queues &&
rtems_configuration_get_maximum_processors() > 1
) {
- TQSetScheduler(
- ctx->tq_ctx, TQ_BLOCKER_B,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_HIGH
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_B, SCHEDULER_B_ID, PRIO_HIGH );
} else {
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_B, PRIO_HIGH );
}
diff --git a/spec/score/tq/req/timeout-priority-inherit.yml b/spec/score/tq/req/timeout-priority-inherit.yml
index 9d963783..50486d2c 100644
--- a/spec/score/tq/req/timeout-priority-inherit.yml
+++ b/spec/score/tq/req/timeout-priority-inherit.yml
@@ -267,12 +267,6 @@ test-setup:
code: |
ctx->request.arg = ctx;
TQReset( ctx->tq_ctx );
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_HELPER_OTHER,
- SCHEDULER_A_ID,
- PRIO_NORMAL
- );
description: null
test-stop: null
test-support: |
diff --git a/spec/score/tq/req/timeout.yml b/spec/score/tq/req/timeout.yml
index a0aa387f..ca071b7b 100644
--- a/spec/score/tq/req/timeout.yml
+++ b/spec/score/tq/req/timeout.yml
@@ -128,12 +128,7 @@ test-setup:
TQReset( ctx->tq_ctx );
if ( ctx->tq_ctx->enqueue_variant == TQ_ENQUEUE_STICKY ) {
- TQSetScheduler(
- ctx->tq_ctx,
- TQ_BLOCKER_A,
- ctx->tq_ctx->other_scheduler_id,
- PRIO_NORMAL
- );
+ TQSetScheduler( ctx->tq_ctx, TQ_BLOCKER_A, SCHEDULER_B_ID, PRIO_NORMAL );
} else {
TQSetPriority( ctx->tq_ctx, TQ_BLOCKER_A, PRIO_HIGH );
}