Skip to content

Commit

Permalink
Updated Svc/Health sdd.md file Unit Tests section
Browse files Browse the repository at this point in the history
  • Loading branch information
AdvaitDhingra committed Jun 16, 2021
1 parent df6c93e commit de60877
Showing 1 changed file with 1 addition and 66 deletions.
67 changes: 1 addition & 66 deletions Svc/Health/docs/sdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,73 +86,8 @@ Code Checklist | [Link](Checklist_Code.xlsx)
Unit Test Checklist | [Link](Checklist_Unit_test.xls)

## 6. Unit Testing
The Health unit tests are designed to test interfaces and functionality with the available ports, command processing, telemetry output, EVR and data product generation.

<ol>
<li> Nominal scenarios for a given requirement</li>
<li> Off-nominal testing </li>
<li> Miscellaneous remaining testing </li>
</ol>

Off-nominal testing contains cases which deal with ping-related issues such as late responses and invalid entries. Every command is also tested with various inputs for thorough validation and code coverage.


## 6.1 Unit Test Descriptions
### 6.1.1 Nominal Telemetry Test
When the Health component's schedIn handler is called, each ping entry in the user provided table is check if it's enabled. If the entry is enabled and empty, a ping is sent out through its corresponding port. If the entry is awaiting a ping response, its counter is checked against a warning threshold and the counter is decremented. If the warning threshold is reached, an EVR and telemetry write are generated. If the fault threshold is reached, a fatal EVR is generated.

This test invokes the schedIn handler for multiple iterations with a provided tables of three ping entries. To test nominal conditions, when a ping is received through the test port, a valid ping return is sent back to the component.

For this nominal condition, no EVRs or telemetry are expected.

Requirement verified: `HTH-001`
### 6.1.2 Warning Telemetry Test

This test verifies the requirement that component shall track the timeout cycles for each ping entry. This is validated by having the component ping each entry in the table without responding. The counter for entry is checked after every iteration to see if its value is decremented accordingly. This test will also cause each entry to reach its warning threshold, so the corresponding EVRs and telemetry will be verified.

Requirement verified: `HTH-002`
### 6.1.3 Fault Telemetry Test

This test is similar to 6.1.2, with the difference being that the schedIn handler is ran until the fault threshold for each ping entry is reached. The counters for each entry and expected fault EVRs are both verified.

Requirement verified: `HTH-003`
### 6.1.4 Enable/Disable All Monitoring Test

In this test, we verify the requirement to enable/disable all monitoring of the ping entries. This is done by running the schedIn handler with monitoring enabled initially with pings sent to each entry with no response from the test. After several iterations and certifying that each entry is being checked, we disable monitoring and invoke the schedIn handler again. During multiple runs of the handler, it is verified that timeouts are not modified and no EVRs are received. Monitoring is then re-enabled and checked if it's working as expected.

Requirement verified: `HTH-004`
### 6.1.5 Enable/Disable Single Monitor Test

This test is similar to 6.1.4, but instead of enabling/disabling all monitors, each ping entry is enabled then disabled. These actions are verified through the previous methodology of 6.1.4.

Requirement verified: `HTH-005`
### 6.1.6 Updating Ping Timeout Test

This test verifies the requirement that the component shall have a command to update timeout values for a port entry. This is done by modifying the initial timeout values for each ping entry in the table. These changes are validated by running the schedIn handler and checking for EVRs and telemetry at the updated timeout values.

Requirement verified: `HTH-006`
### 6.1.7 Watchdog Test

This test verifies the requirement that the component shall stroke a watchdog port while all ping are within their limit. This is done by checking the output of the watchdog port and verifying its content.

Requirement verified: `HTH-007`

### 6.1.8 Nominal Command Test
This test verifies the functionally of all the provided health commands including the enable/disable monitoring of the ping entries as well ass updating timeouts. All commands are validated and verified with nominal inputs.

### 6.1.9 Nominal Command and Telemetry Test
This test is similar to `6.1.8`, but it includes a nominal running of the SchedIn handler while handling incoming commands.

### 6.1.10 Miscellaneous

This set of test cases verifies the remaining off-nominal error cases. Each test case is simulated and validated individually.

## 6.2 Unit Test Output
[Unit Test Output](../test/ut/ut_output.txt)

## 6.3 Unit Test Coverage
[Coverage Output](../test/ut/SvcHealth_gcov.txt)

To see unit test coverage run fprime-util check --coverage

## 7. Change Log

Expand Down

0 comments on commit de60877

Please sign in to comment.