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

Fix #390, #392, osal select API unit tests and fixes #409

Merged
merged 4 commits into from
Apr 21, 2020

Conversation

CDKnightNASA
Copy link
Contributor

@CDKnightNASA CDKnightNASA commented Apr 7, 2020

Describe the contribution
fixes #390, fixes #392 -- adds unit tests for OSAL select API

Partially addresses #377, but full solution is a functional test that includes an operational scenario (actually select on a resource, confirm it pends until that resource is available).. bonus points if it illustrates the differences between OS's so it's clear from a user perspective what will work and what wont.

Testing performed
Built unit tests, tests passed.

Expected behavior changes
Externalizes enum for SelectSingle, ensures that pointers passed to SelectFd...() APIs are not null, ensures that pointer to SelectSingle is not null.

System(s) tested on
Debian 9

Contributor Info - All information REQUIRED for consideration of pull request
Christopher.D.Knight@nasa.gov

@CDKnightNASA CDKnightNASA self-assigned this Apr 7, 2020
@CDKnightNASA CDKnightNASA added CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) bug unit-test Tickets related to the OSAL unit testing (functional and/or coverage) labels Apr 7, 2020
@skliper
Copy link
Contributor

skliper commented Apr 7, 2020

Note this doesn't actually address #377, I probably didn't do a good job describing the issue. The "functional tests" that are missing are the ones similar to those in src/tests which don't use mocks/stubs. The functional tests needed for #377 are against the API, and should demonstrate the functions work as intended.

The tests here are the "coverage test" part of unit tests.

Copy link
Contributor

@skliper skliper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here are good, but shouldn't mark #377 as fixed (see my other comment).

Nitpick - preference would be to separate flight code changes and unit test changes into separate commits

@CDKnightNASA
Copy link
Contributor Author

The changes here are good, but shouldn't mark #377 as fixed (see my other comment).

Nitpick - preference would be to separate flight code changes and unit test changes into separate commits

Note this doesn't actually address #377, I probably didn't do a good job describing the issue. The "functional tests" that are missing are the ones similar to those in src/tests which don't use mocks/stubs. The functional tests needed for #377 are against the API, and should demonstrate the functions work as intended.

The tests here are the "coverage test" part of unit tests.

No these do not use stubs, they do confirm the functional behavior of the Select API.

@CDKnightNASA
Copy link
Contributor Author

The changes here are good, but shouldn't mark #377 as fixed (see my other comment).

Nitpick - preference would be to separate flight code changes and unit test changes into separate commits

Wait, I'm sure I've been told to commit tests when I commit flight code... :D

I can certainly re-split-out the null pointer check and enum move if the CCB would prefer as a separate pull. I did give a heads-up at last CCB that I would do a pull request incorporating all changes together, and heard no objections.

@skliper
Copy link
Contributor

skliper commented Apr 7, 2020

The changes here are good, but shouldn't mark #377 as fixed (see my other comment).
Nitpick - preference would be to separate flight code changes and unit test changes into separate commits

Wait, I'm sure I've been told to commit tests when I commit flight code... :D

I can certainly re-split-out the null pointer check and enum move if the CCB would prefer as a separate pull. I did give a heads-up at last CCB that I would do a pull request incorporating all changes together, and heard no objections.

Not a separate pull request, just separate commits. I have to work on explaining what's in my head. Another concept I describe poorly is "one topic per commit"... and grouping commits in a pull request.

@skliper
Copy link
Contributor

skliper commented Apr 7, 2020

Really just a nit in this case since the changes are very easy to review, straight forward, etc. More complex changes where there's documentation, unit tests, flight code, etc my preference is smaller commits group into a single pull request. Probably useful information for a contributor's guide...

@skliper
Copy link
Contributor

skliper commented Apr 7, 2020

The changes here are good, but shouldn't mark #377 as fixed (see my other comment).
Nitpick - preference would be to separate flight code changes and unit test changes into separate commits

Note this doesn't actually address #377, I probably didn't do a good job describing the issue. The "functional tests" that are missing are the ones similar to those in src/tests which don't use mocks/stubs. The functional tests needed for #377 are against the API, and should demonstrate the functions work as intended.
The tests here are the "coverage test" part of unit tests.

No these do not use stubs, they do confirm the functional behavior of the Select API.

Worth a discussion at the CCB... I didn't immediately see where it shows that the select blocks as it's supposed to until a file becomes readable or writable, or a demonstration of the timeout and verification of reasonable timing.

@jphickey
Copy link
Contributor

jphickey commented Apr 8, 2020

Should note that RTEMS doesn't really support select on bare files, the underlying system call only works on sockets. It isn't a limitation of OSAL, its a limitation of the OS. Therefore any functional test for select should focus on its use with sockets rather than files.

@astrogeco astrogeco changed the title fix #377, fix #390, fix #392 - osal select API unit tests and fixes Fix #377, #390, #392, osal select API unit tests and fixes Apr 14, 2020
@skliper
Copy link
Contributor

skliper commented Apr 15, 2020

CCB 20200415 - APPROVED

@skliper skliper changed the title Fix #377, #390, #392, osal select API unit tests and fixes Fix #390, #392, osal select API unit tests and fixes Apr 15, 2020
@astrogeco astrogeco added CCB:Approved Indicates code review and approval by community CCB CCB - 20200415 and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Apr 20, 2020
@astrogeco astrogeco changed the base branch from master to integration-candidate April 21, 2020 22:13
@astrogeco astrogeco merged commit 27dc32f into nasa:integration-candidate Apr 21, 2020
@skliper skliper added this to the 5.1.0 milestone Jun 1, 2020
@astrogeco astrogeco removed the bug label Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
4 participants