enarx-archive / tlssock

A library exposing TLS/DTLS sockets using the POSIX networking APIs
Apache License 2.0
18 stars 7 forks source link

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

Closed puiterwijk closed 5 years ago

puiterwijk commented 5 years ago

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

AlternativeTo: #28 Signed-off-by: Patrick Uiterwijk patrick@puiterwijk.org

codecov-io commented 5 years ago

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%) :arrow_up:
bin/main.c 71.96% <100%> (+0.43%) :arrow_up:
lib/tlssock.c 50% <0%> (+6.17%) :arrow_up:

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 commented 5 years ago

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 commented 5 years ago

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

npmccallum commented 5 years ago

Replaced by #31 .