Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[TESTS] Added unit tests for bonding #1559

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

Added tests:

TEST(Bonding, ConnectBlind)

Connect to a nonexistent endpoint and interrupt it by closing a group.

TEST(Bonding, ConnectNonBlocking)

Test connecting with non-blocking mode and correctly reported epoll events.

TEST(Bonding, BackupPriorityBegin)

Setup two links with different weight and expect the one with higher priority to be activated.

TEST(Bonding, BackupPriorityTakeover)

Setup a new link while in transmission and expect the new link with higher priority takes over, even if there's no need to backup.

TEST(Bonding, BackupPrioritySelection)

Setup two links with high priority and send a packet to activate one. Then connect a link with low priority, kill the active link and send the packet - expected is that the out of two remaining link, the one with higher priority is activated.

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [tests] Area: Unit tests Impact: Development labels Sep 18, 2020
@ethouris ethouris added this to the v1.5.0 - Sprint 23 milestone Sep 18, 2020
@maxsharabayko
Copy link
Collaborator

[ RUN      ] Bonding.ConnectNonBlocking
Created group socket: 1428448644
Connecting two sockets
[A] Waiting for accept
Connect callback. Socket: 354706819, error: 0, token: 3
Returned from connecting two sockets 
/Users/travis/build/Haivision/srt/test/test_bonding.cpp:162: Failure
Expected equality of these values:
  ev[0].events
    Which is: 17
  SRT_EPOLL_IN
    Which is: 1
Connect callback. Socket: 354706818, error: 0, token: 4
[  FAILED  ] Bonding.ConnectNonBlocking (1188 ms)

@ethouris
Copy link
Collaborator Author

LOL actually didn't expect that the uwait might report IN and UPDATE in one. That case is also to be tolerated, I'll make a fix.

@maxsharabayko maxsharabayko modified the milestones: v1.5.0 - Sprint 23, v1.5.0 - Sprint 25 Sep 21, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.0 - Sprint 25, v1.5.0 Oct 14, 2020
@codecov
Copy link

codecov bot commented Dec 7, 2020

Codecov Report

Merging #1559 (5834866) into master (c065d88) will increase coverage by 2.75%.
The diff coverage is 90.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1559      +/-   ##
==========================================
+ Coverage   60.74%   63.50%   +2.75%     
==========================================
  Files          78       78              
  Lines       17444    17762     +318     
==========================================
+ Hits        10596    11279     +683     
+ Misses       6848     6483     -365     
Impacted Files Coverage Δ
srtcore/group.h 74.48% <ø> (+17.24%) ⬆️
srtcore/group.cpp 57.09% <53.96%> (+20.67%) ⬆️
test/test_bonding.cpp 96.36% <96.23%> (-2.49%) ⬇️
srtcore/api.cpp 50.21% <100.00%> (+1.49%) ⬆️
srtcore/core.cpp 55.66% <100.00%> (+0.36%) ⬆️
srtcore/list.cpp 76.81% <0.00%> (-5.51%) ⬇️
srtcore/congctl.cpp 81.02% <0.00%> (-3.08%) ⬇️
srtcore/core.h 80.64% <0.00%> (-2.16%) ⬇️
srtcore/window.cpp 81.81% <0.00%> (-1.30%) ⬇️
... and 14 more

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 c065d88...4320e27. Read the comment docs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
[tests] Area: Unit tests Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants