osal Integration candidate: 2021-04-13#956
Merged
Conversation
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
Fix #871, allow OSAL re-initialization
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.OS_API_Init()are allowed - subsequent calls can be ignoredOS_API_Init()fails (this leaves system in same state as when it started)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_Teardownto complementOS_API_Init. This cleans up all OSAL resources ideally leaving the system in a state whereOS_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