Skip to content

Commit

Permalink
Reworked biceps:5-4-7 tests (#122)
Browse files Browse the repository at this point in the history
The revision of the test cases for biceps:5-4-7 includes several
changes:

- the setMetricStatus manipulation of the T2IAPI is persistent now
- added new configuration parameter `Biceps547TimeInterval=5`.
- manipulateMetricStatus in ManipulationPrecondition now waits for the
specified `Biceps547TimeInterval` between manipulations to avoid changes
to the activation state of the metric
- added sequenceId as parameter for setMetricStatus manipulation to be
able to assign stored messages to the manipulation
- the biceps:5-4-7 test cases create an mdib for the point just before
the end of each time interval between manipulations of the
manipulateMetricStatus precondition and check if the activation state of
the metric is as expected

# Checklist

The following aspects have been respected by the author of this pull
request, confirmed by both pull request assignee **and** reviewer:

* Adherence to coding conventions
  * [x] Pull Request Assignee
  * [x] Reviewer
* Adherence to javadoc conventions
  * [x] Pull Request Assignee
  * [x] Reviewer
* Changelog update (necessity checked and entry added or not added
respectively)
  * [x] Pull Request Assignee
  * [x] Reviewer
* README update (necessity checked and entry added or not added
respectively)
  * [x] Pull Request Assignee
  * [x] Reviewer
* config update (necessity checked and entry added or not added
respectively)
  * [x] Pull Request Assignee
  * [x] Reviewer
* SDCcc executable ran against a test device (if necessary)
  * [x] Pull Request Assignee
  * [x] Reviewer
  • Loading branch information
belagertem authored Sep 4, 2023
1 parent 722175c commit 0ec50f7
Show file tree
Hide file tree
Showing 17 changed files with 2,776 additions and 4,157 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- setComponentActivation stores incorrect manipulation data in the database resulting in no test data being available for 5-4-7_* tests
- that preconditions of the following requirements could not handle the T2IAPI manipulation result RESULT_NOT_SUPPORTED: biceps:R0029_0 biceps:R0116 biceps:5-4-7_0_0 biceps:5-4-7_1 biceps:5-4-7_2 biceps:5-4-7_3 biceps:5-4-7_4 biceps:5-4-7_5 biceps:5-4-7_6_0 biceps:5-4-7_7 biceps:5-4-7_8 biceps:5-4-7_9 biceps:5-4-7_10 biceps:5-4-7_11 biceps:5-4-7_12_0 biceps:5-4-7_13 biceps:5-4-7_14 biceps:5-4-7_15 biceps:5-4-7_16 biceps:5-4-7_17
- biceps:R0034_0 does not track changes when reinserting descriptors.
- report duplication issue in biceps:C11-C15, biceps:C5, biceps:R5046_0, biceps:B-284_0 as well as biceps:R5003.
- report duplication issue in biceps:C11-C15, biceps:C5, biceps:R5046_0, biceps:B-284_0 as well as biceps:R5003.
- biceps:5-4-7 tests confusing changes made by SetComponentActivation manipulations with changes made by SetMetricStatus.

## [7.0.1] - 2023-03-17

Expand Down
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ in high numbers. When this option is set to true, then the errors will not be di
at the end. When the option is set to false, then the individual errors are displayed, which is useful for fixing
these problems.

```
[SDCcc.TestParameter]
Biceps547TimeInterval=5
```
When running biceps:5-4-7 tests the Biceps547TimeInterval parameter is used to pause between the SetMetricStatus
manipulation calls with a default of 5 seconds. The report that follows a SetMetricStatus manipulation is expected
within the specified seconds.

## Running SDCcc
The following command line options are supported by the test tool, the first two need to be provided.

Expand Down Expand Up @@ -285,24 +293,24 @@ this case in order to minimize the risk of such an invalid application going unn
| R5051 | GetRemovableDescriptorsOfClass, RemoveDescriptor, InsertDescriptor |
| R5052 | TriggerAnyDescriptorUpdate |
| R5053 | GetRemovableDescriptorsOfClass, RemoveDescriptor, InsertDescriptor |
| 5-4-7_0_0 | SetComponentActivation, SetMetricStatus |
| 5-4-7_1 | SetComponentActivation, SetMetricStatus |
| 5-4-7_2 | SetComponentActivation, SetMetricStatus |
| 5-4-7_3 | SetComponentActivation, SetMetricStatus |
| 5-4-7_4 | SetComponentActivation, SetMetricStatus |
| 5-4-7_5 | SetComponentActivation, SetMetricStatus |
| 5-4-7_6_0 | SetComponentActivation, SetMetricStatus |
| 5-4-7_7 | SetComponentActivation, SetMetricStatus |
| 5-4-7_8 | SetComponentActivation, SetMetricStatus |
| 5-4-7_9 | SetComponentActivation, SetMetricStatus |
| 5-4-7_10 | SetComponentActivation, SetMetricStatus |
| 5-4-7_11 | SetComponentActivation, SetMetricStatus |
| 5-4-7_12_0 | SetComponentActivation, SetMetricStatus |
| 5-4-7_13 | SetComponentActivation, SetMetricStatus |
| 5-4-7_14 | SetComponentActivation, SetMetricStatus |
| 5-4-7_15 | SetComponentActivation, SetMetricStatus |
| 5-4-7_16 | SetComponentActivation, SetMetricStatus |
| 5-4-7_17 | SetComponentActivation, SetMetricStatus |
| 5-4-7_0_0 | SetMetricStatus |
| 5-4-7_1 | SetMetricStatus |
| 5-4-7_2 | SetMetricStatus |
| 5-4-7_3 | SetMetricStatus |
| 5-4-7_4 | SetMetricStatus |
| 5-4-7_5 | SetMetricStatus |
| 5-4-7_6_0 | SetMetricStatus |
| 5-4-7_7 | SetMetricStatus |
| 5-4-7_8 | SetMetricStatus |
| 5-4-7_9 | SetMetricStatus |
| 5-4-7_10 | SetMetricStatus |
| 5-4-7_11 | SetMetricStatus |
| 5-4-7_12_0 | SetMetricStatus |
| 5-4-7_13 | SetMetricStatus |
| 5-4-7_14 | SetMetricStatus |
| 5-4-7_15 | SetMetricStatus |
| 5-4-7_16 | SetMetricStatus |
| 5-4-7_17 | SetMetricStatus |

[MDPWS]

Expand Down
5 changes: 4 additions & 1 deletion configuration/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ DeviceEpr="urn:uuid:857bf583-8a51-475f-a77f-d0ca7de69b11"
Enable=false

[SDCcc.gRPC]
ServerAddress="localhost:50051"
ServerAddress="localhost:50051"

[SDCcc.TestParameter]
Biceps547TimeInterval=5
2 changes: 1 addition & 1 deletion sdccc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<dependency>
<groupId>com.draeger.medical</groupId>
<artifactId>t2iapi</artifactId>
<version>3.0.0.226</version>
<version>3.0.0.262</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected void defaultConfigure() {
configureNetwork();
configureProvider();
configureGRpc();
configureTestParameter();
configureInternalSettings();
configureCommlogSettings();
}
Expand Down Expand Up @@ -62,6 +63,10 @@ void configureGRpc() {
bind(TestSuiteConfig.GRPC_SERVER_ADDRESS, String.class, "localhost:50051");
}

void configureTestParameter() {
bind(TestSuiteConfig.TEST_BICEPS_547_TIME_INTERVAL, long.class, 5L);
}

void configureInternalSettings() {
bind(TestSuiteConfig.SDC_TEST_DIRECTORIES, String[].class, new String[] {
"com.draeger.medical.sdccc.tests.biceps",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public final class TestSuiteConfig {
private static final String GRPC = "gRPC.";
public static final String GRPC_SERVER_ADDRESS = SDCCC + GRPC + "ServerAddress";

/*
* Test parameter configuration
*/
private static final String TEST_PARAMETER = "TestParameter.";
public static final String TEST_BICEPS_547_TIME_INTERVAL = SDCCC + TEST_PARAMETER + "Biceps547TimeInterval";

/*
* Commlog configuration
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ public void close() {}

@Override
public ResponseTypes.Result setMetricStatus(
final String handle, final MetricCategory category, final ComponentActivation activation) {
final String sequenceId,
final String handle,
final MetricCategory category,
final ComponentActivation activation) {

final var metricStatusString = getMetricStatus(activation);
if (metricStatusString.isEmpty()) return ResponseTypes.Result.RESULT_FAIL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ public ResponseTypes.Result setComponentActivation(final String handle, final Co

@Override
public ResponseTypes.Result setMetricStatus(
final String handle, final MetricCategory category, final ComponentActivation activation) {
final String sequenceId,
final String handle,
final MetricCategory category,
final ComponentActivation activation) {
final var metricStatus = getMetricStatus(activation);
if (metricStatus.isEmpty()) return ResponseTypes.Result.RESULT_FAIL;
final var message = MetricRequests.SetMetricStatusRequest.newBuilder()
Expand All @@ -282,10 +285,11 @@ public ResponseTypes.Result setMetricStatus(

return performCallWrapper(
v -> metricStub.setMetricStatus(message),
v -> fallback.setMetricStatus(handle, category, activation),
v -> fallback.setMetricStatus(sequenceId, handle, category, activation),
BasicResponses.BasicResponse::getResult,
BasicResponses.BasicResponse::getResult,
ManipulationParameterUtil.buildMetricStatusManipulationParameterData(handle, category, activation));
ManipulationParameterUtil.buildMetricStatusManipulationParameterData(
sequenceId, handle, category, activation));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ ResponseTypes.Result setSystemSignalActivation(
/**
* Set the metric to a specific state to trigger the setting of the ActivationState.
*
* @param sequenceId during which the manipulation was performed
* @param handle state handle to set the status of the metric for
* @param category of the metric to set the status for
* @param activation the activation state the metric should have, after manipulation
* @return the result of the manipulation
*/
ResponseTypes.Result setMetricStatus(String handle, MetricCategory category, ComponentActivation activation);
ResponseTypes.Result setMetricStatus(
String sequenceId, String handle, MetricCategory category, ComponentActivation activation);

/**
* Trigger a descriptor update for the provided descriptor handle.
Expand Down
Loading

0 comments on commit 0ec50f7

Please sign in to comment.