Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osal Integration candidate: 2021-04-13 #956

Merged
merged 8 commits into from
Apr 12, 2021
Merged

Conversation

astrogeco
Copy link
Contributor

@astrogeco astrogeco commented Apr 11, 2021

Description

PR #941

Fix #871, allow OSAL re-initialization
Fix #691, Combine initialized and shutdown flags into one

Replaces the separate "Initialized" and "Shutdown" flags with a single state flag. Creates a global single source of truth for the OSAL state. This enables users to run tests and OS_API_Init() multiple times without a reboot in the middle to reset the state.

  • Multiple invocations of OS_API_Init() are allowed - subsequent calls can be ignored
  • Deleting of any internal objects that did get created if OS_API_Init() fails (this leaves system in same state as when it started)
  • Allows Re-initialization of OSAL after OS_ApplicationShutdown() - may be relevant when running unit tests several times without rebooting.

PR #948

Fix #944, add OS_API_Teardown
Fix #197, Black Box Unit Tests Do Not Ensure Resources Are Cleaned Up Between Tests

Adds OS_API_Teardown to complement OS_API_Init. This cleans up all OSAL resources ideally leaving the system in a state where OS_API_Init()` may be invoked again.

PR #940

Fix #939, rework shell test

Reworks the shell unit test which was probably not working. Note this requires modifying the osal config to enable shell, otherwise test is skipped.

Context

Part of nasa/cFS#242

Testing

osal checks https://github.com/nasa/osal/pull/956/checks
bundle checks https://github.com/nasa/cFS/pull/242/checks

Authors

@jphickey

jphickey and others added 5 commits April 1, 2021 13:32
The shell may add extra output beyond the intended content, but the
shell-test was only looking for exact match.  Extra output may
include whitespace and/or an echo of the command itself.

This reworks the shell test to allow for this extra output, as long
as the intended string appears in the content of the file it will
pass.
Replaces the separate "Initialized" and "Shutdown" flags with a single
state flag.  This simplifies things and makes for a single source
of truth for the state of OSAL globally.

In particular this allows for:
- Multiple invocations of OS_API_Init() - subsequent calls can be ignored
- Deleting of any internal objects that did get created if OS_API_Init() fails
  (leaves system in same state as when it started)
- Allows Re-initialization of OSAL after OS_ApplicationShutdown() - may be
  relevant when running unit tests several times without rebooting.
This cleans up all OSAL resources as best as possible, ideally leaving
the system in a state where OS_API_Init() may be invoked again.
Invoke OS_API_Teardown to reset state for next test
@astrogeco astrogeco marked this pull request as ready for review April 12, 2021 03:31
@astrogeco astrogeco merged commit b37da18 into main Apr 12, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Apr 12, 2021
Combines

nasa/osal#956
nasa/cFE#1295

Including:

nasa/osal#941 - Allow OSAL re-initialization
nasa/osal#941 - Combine initialized and shutdown flags into one
nasa/osal#948 - Add OS_API_Teardown
nasa/osal#948 - Black Box Unit Tests Do Not Ensure Resources Are Cleaned Up Between Tests
nasa/osal#940 - Rework shell test

nasa/cFE#1276 - Use events for CFE test asserts
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment