This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libconvert: send cookie TLV on client side
It is now possible to send a cookie TLV from the client using libconvert. New tests have been added to check that the expected Cookie message is sent and the Cookie TLV error is properly received and understood. Signed-off-by: Pol Nicolaï <[email protected]> Change-Id: I51fe5dce0bc1d24c10808b44d906224a91a82bab
- Loading branch information
1 parent
8209672
commit a4cf9ba
Showing
8 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from converter_mock import * | ||
from test_lib import * | ||
|
||
|
||
class TestCookieError(TestInstance): | ||
def run(self): | ||
converter = Convert(tlvs=[ConvertTLV_Error(error_code=3)]) | ||
print(converter.build()) | ||
cookie = self.get_cookie() | ||
|
||
class MockConverterCookieError(MockConverter): | ||
actions = [RecvSyn(), SendSynAckCheckCookie(converter.build(), cookie), Wait(1), SendPkt(flags='R')] | ||
MockConverterCookieError() | ||
|
||
def validate(self): | ||
self.assert_log_contains("received TLV error: 3") | ||
|
||
|
||
TestCookieError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from converter_mock import * | ||
from test_lib import * | ||
|
||
|
||
class TestCookieOK(TestInstance): | ||
def run(self): | ||
cookie = self.get_cookie() | ||
class MockConverterCookieOK(MockConverter): | ||
actions = [RecvSyn(), SendSynAckCheckCookie(Convert().build(), cookie), RecvHTTPGet( | ||
), SendHTTPResp("HELLO, WORLD!"), SendPkt(flags='RA')] | ||
MockConverterCookieOK() | ||
|
||
def validate(self): | ||
self.assert_result("HELLO, WORLD!") | ||
|
||
|
||
TestCookieOK() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters