Skip to content
This repository was archived by the owner on Jun 30, 2020. It is now read-only.

Use recv/send for non-stdio in the test tooling #30

Closed

Conversation

puiterwijk
Copy link
Contributor

This should increase the test coverage to also cover send/recv.

AlternativeTo: #28
Signed-off-by: Patrick Uiterwijk [email protected]

This should increase the test coverage to also cover send/recv.

AlternativeTo: enarx-archive#28
Signed-off-by: Patrick Uiterwijk <[email protected]>
@codecov-io
Copy link

codecov-io commented Mar 25, 2019

Codecov Report

Merging #30 into master will increase coverage by 0.97%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   64.87%   65.84%   +0.97%     
==========================================
  Files          13       13              
  Lines        1170     1174       +4     
==========================================
+ Hits          759      773      +14     
+ Misses        411      401      -10
Impacted Files Coverage Δ
bin/non.c 45.09% <100%> (+2.24%) ⬆️
bin/main.c 71.96% <100%> (+0.43%) ⬆️
lib/tlssock.c 50% <0%> (+6.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72f2c71...dfb8c2c. Read the comment docs.

@npmccallum
Copy link
Contributor

I'm glad this seems to work!

However, I think we can't filter by the file descriptor number. We should be able to use (I think) getsockopt() to determine if any file descriptor is actually a socket. I know that libsystemd has functions for this. We could check and see what they do.

@yingxiongraomingzk Take a look at this.

@DK-DARKmatter
Copy link

This is a great idea! I will follow up with getsockopt() and see if we could make further improvement.

DK-DARKmatter pushed a commit to DK-DARKmatter/tlssock that referenced this pull request Mar 26, 2019
recv/send function can only be applied to a socket.
We can use fstat() function to check if the fd is a socket or not.
If so, we would like to use recv/send function to replace read/write.
Related to:enarx-archive#30
Signed-off-by: Ke Zhao <[email protected]>
DK-DARKmatter pushed a commit to DK-DARKmatter/tlssock that referenced this pull request Mar 27, 2019
recv/send function can only be applied to a socket.
We can use fstat() function to check if the fd is a socket or not.
If so, we would like to use recv/send function to replace read/write.
Related to:enarx-archive#30
Signed-off-by: Ke Zhao <[email protected]>
@npmccallum
Copy link
Contributor

Replaced by #31 .

@npmccallum npmccallum closed this Apr 4, 2019
DK-DARKmatter pushed a commit to DK-DARKmatter/tlssock that referenced this pull request Apr 4, 2019
recv/send function can only be applied to a socket.
We can use fstat() function to check if the fd is a socket or not.
If so, we would like to use recv/send function to replace read/write.
Related to:enarx-archive#30
Signed-off-by: Ke Zhao <[email protected]>
DK-DARKmatter pushed a commit to DK-DARKmatter/tlssock that referenced this pull request Apr 5, 2019
recv/send function can only be applied to a socket.
We can use fstat() function to check if the fd is a socket or not.
If so, we would like to use recv/send function to replace read/write.
Related to:enarx-archive#30
Signed-off-by: Ke Zhao <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants