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 network APIs missing functional tests #373

Closed
CDKnightNASA opened this issue Mar 19, 2020 · 5 comments · Fixed by #549 or #563
Closed

OSAL network APIs missing functional tests #373

CDKnightNASA opened this issue Mar 19, 2020 · 5 comments · Fixed by #549 or #563
Labels
enhancement unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone

Comments

@CDKnightNASA
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Seems there's not really any unit tests for the OSAL networking code.

Describe the solution you'd like
Should have unit tests.

Describe alternatives you've considered
Not having unit tests?

Additional context
Note that to do unit testing, it's likely we'll need to stub out OS-provided API's (open, select, socket, bind, accept, close().) Do we have a standard framework for stubbing out OS-provided functions?

Requester Info
Christopher.D.Knight@nasa.gov

@CDKnightNASA CDKnightNASA added question CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Mar 19, 2020
@CDKnightNASA
Copy link
Contributor Author

No code yet, but would like to discuss at the CCB as to whether to stub out OS functions or otherwise how to test.

@jphickey
Copy link
Contributor

As noted in the CCB, there are two flavors of testing to consider:

  1. Functional
  2. Coverage

In OSAL the "tests" and "unit-tests" are functional tests (type 1). These do NOT use stubs., they use the real OSAL, linked to the real C library We can (and should) write some new tests that exercise the network socket API. We can create two threads, which talk to eachother via IP sockets that are bound to the localhost address (127.0.0.1).

OSAL also has coverage tests (type 2) but these are mainly to validate the error checking and other items which cannot typically be reached in the functional test. This links each OSAL unit with stubs, including stubs for the C library calls. Yes we have a framework for doing this, and the "shared" layer (including the network) should be covered by it already. However the "impl" part probably needs better coverage, because only VxWorks is done 100% (that's a separate issue though).

@skliper
Copy link
Contributor

skliper commented Mar 20, 2020

Concur, definitely need to add functional tests as Joe suggests.

@skliper skliper added this to the 5.1.0 milestone Mar 20, 2020
@skliper
Copy link
Contributor

skliper commented Mar 23, 2020

Missing tests for all of the following:
OS_SocketAddrInit, OS_SocketAddrToString, OS_SocketAddrFromString, OS_SocketAddrGetPort, OS_SocketAddrSetPort
OS_SocketOpen, OS_SocketBind, OS_SocketConnect, OS_SocketAccept, OS_SocketRecvFrom, OS_SocketSendTo, OS_SocketGetIdByName, OS_SocketGetInfo

Certification issue.

@astrogeco
Copy link
Contributor

CCB 2020-03-25: Will go ahead with this. It is a priority.

@astrogeco astrogeco removed the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Mar 25, 2020
@skliper skliper changed the title unit tests for OSAL network code OSAL network APIs missing functional tests Mar 26, 2020
@CDKnightNASA CDKnightNASA added the unit-test Tickets related to the OSAL unit testing (functional and/or coverage) label Mar 27, 2020
@skliper skliper modified the milestones: 5.1.0, 5.2.0 Jun 5, 2020
yammajamma added a commit to yammajamma/osal that referenced this issue Jul 22, 2020
astrogeco pushed a commit that referenced this issue Aug 18, 2020
…OS_TimedRead and OS_TimedWrite missing functional tests (#549)
@skliper skliper modified the milestones: 5.2.0, 6.0.0 Sep 1, 2020
jphickey added a commit to jphickey/osal that referenced this issue Aug 10, 2022
The mutex for the log file write during the WriteLogFileCmd
excution was held longer than it should have been.

This lock must *NOT* be held during EVS_SendEvent, as this
will cause deadlock.

This moves the mutex to protect only the area that actually
accesses the log data, and it moves all send event calls
to be AFTER the mutex is released.
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Fixes nasa#361, nasa#373, nasa#374, nasa#381
Code reviewed and approved at 20191023 and 30 CCBs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
4 participants