-
Notifications
You must be signed in to change notification settings - Fork 1
Peer to peer topology tests #303
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1a71676
Added code for peer to peer mesh topology test
sanjivanipatrax f4ed4af
Added peer to peer loop topology test case
sanjivanipatrax e5370ef
Added the markdown files for the p2p topology tests
sanjivanipatrax 176d810
Fixed a typo
sanjivanipatrax c8097c7
Converted ReplicatorType from string to enum
sanjivanipatrax 6c0b21b
Increased timeout
sanjivanipatrax 316f235
Extract hostname from self.url in testserver.py
sanjivanipatrax b9bb737
Changes to include disable_tls in API
sanjivanipatrax e12bd18
Batched documents to avoid payload too large error
sanjivanipatrax b73d44a
Removed extra comments
sanjivanipatrax 29c0b95
Removed redundant comments
sanjivanipatrax 1d3f942
Changes after ruff formatting
sanjivanipatrax 1db3957
Changes for mypy fix
sanjivanipatrax afeac25
Added disableTLS support for java and android
sanjivanipatrax 7d2252f
Updated api spec for startListener endpoint
sanjivanipatrax d7cc1ba
Changes requested in PR
sanjivanipatrax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,123 @@ | ||
| # Peer-to-Peer Topology Tests | ||
|
|
||
| This document describes the peer-to-peer topology tests for Couchbase Lite, testing legacy peer-to-peer functionality in different topology setups (mesh and loop) without Sync Gateway. | ||
|
|
||
| ## test_peer_to_peer_topology_mesh | ||
|
|
||
| Test legacy peer-to-peer functionality with mesh topology setup where each peer replicates to all other peers in phases. | ||
|
|
||
| **Parameters:** | ||
| - `num_of_docs`: Number of documents to create (10 or 100) | ||
| - `continuous`: Whether replication is continuous (True or False) | ||
| - `replicator_type`: Type of replication (e.g., "push_pull") | ||
|
|
||
| <br> | ||
|
|
||
| **Steps:** | ||
| 1. Verify CBL version >= 2.8.0 on all test servers. | ||
| 2. Reset local database and load `empty` dataset on all devices. | ||
| 3. **PHASE 1**: Peer 1 -> Peers [2, 3] | ||
| - Add `num_of_docs` documents to the database on peer 1: | ||
| * Documents named: `phase1-peer1-doc1`, `phase1-peer1-doc2`, ..., `phase1-peer1-doc{num_of_docs}` | ||
| * Each document contains a random integer value | ||
| - Start listeners on peers 2 and 3: | ||
| * database: `db1` (on each target peer) | ||
| * collections: `["_default._default"]` | ||
| * port: 59840 | ||
| - Setup replicators from peer 1 to peers 2 and 3: | ||
| * endpoint: replication URL for each target peer's listener | ||
| * collections: `_default._default` | ||
| * type: `replicator_type` (e.g., "push_pull") | ||
| * continuous: `continuous` | ||
| - Start replication from peer 1 to peers 2 and 3. | ||
| - Wait for replication from peer 1 to complete: | ||
| * Target activity: IDLE if continuous, otherwise STOPPED | ||
| - Check that all device databases have the replicated documents after phase 1: | ||
| * All databases should have the same content | ||
| - Stop listeners after phase 1. | ||
| 4. **PHASE 2**: Peer 2 -> Peers [1, 3] | ||
| - Add `num_of_docs` documents to the database on peer 2: | ||
| * Documents named: `phase2-peer2-doc1`, `phase2-peer2-doc2`, ..., `phase2-peer2-doc{num_of_docs}` | ||
| - Start listeners on peers 1 and 3: | ||
| * database: `db1` (on each target peer) | ||
| * collections: `["_default._default"]` | ||
| * port: 59840 | ||
| - Setup replicators from peer 2 to peers 1 and 3. | ||
| - Start replication from peer 2 to peers 1 and 3. | ||
| - Wait for replication from peer 2 to complete. | ||
| - Check that all device databases have the replicated documents after phase 2. | ||
| - Stop listeners after phase 2. | ||
| 5. **PHASE 3**: Peer 3 -> Peers [1, 2] | ||
| - Add `num_of_docs` documents to the database on peer 3: | ||
| * Documents named: `phase3-peer3-doc1`, `phase3-peer3-doc2`, ..., `phase3-peer3-doc{num_of_docs}` | ||
| - Start listeners on peers 1 and 2: | ||
| * database: `db1` (on each target peer) | ||
| * collections: `["_default._default"]` | ||
| * port: 59840 | ||
| - Setup replicators from peer 3 to peers 1 and 2. | ||
| - Start replication from peer 3 to peers 1 and 2. | ||
| - Wait for replication from peer 3 to complete. | ||
| - Check that all device databases have the replicated documents after phase 3. | ||
| - Stop listeners after phase 3. | ||
|
|
||
| ## test_peer_to_peer_topology_loop | ||
|
|
||
| Test legacy peer-to-peer functionality with loop topology setup where each peer replicates to the next peer in a circular chain. | ||
|
|
||
| **Parameters:** | ||
| - `num_of_docs`: Number of documents to create (10 or 100) | ||
| - `continuous`: Whether replication is continuous (True or False) | ||
| - `replicator_type`: Type of replication (e.g., "push_pull" or "pull") | ||
|
|
||
| <br> | ||
|
|
||
| **Steps:** | ||
| 1. Verify CBL version >= 2.8.0 on all test servers. | ||
| 2. Reset local database and load `empty` dataset on all devices. | ||
| 3. **PHASE 1**: Peer 1 -> Peer 2 | ||
| - Add `num_of_docs` documents to the database on peer 1: | ||
| * Documents named: `phase1-peer1-doc1`, `phase1-peer1-doc2`, ..., `phase1-peer1-doc{num_of_docs}` | ||
| * Each document contains a random integer value | ||
| - Start listener on peer 2: | ||
| * database: `db1` (on peer 2) | ||
| * collections: `["_default._default"]` | ||
| * port: 59840 | ||
| - Setup replicator from peer 1 to peer 2: | ||
| * endpoint: replication URL for peer 2's listener | ||
| * collections: `_default._default` | ||
| * type: `replicator_type` (e.g., "push_pull" or "pull") | ||
| * continuous: `continuous` | ||
| - Start replication from peer 1 to peer 2. | ||
| - Wait for replication from peer 1 to peer 2 to complete: | ||
| * Target activity: IDLE if continuous, otherwise STOPPED | ||
| - Verify that peer 1 and peer 2 have the same content after phase 1: | ||
| * Source and target databases should match | ||
| - Stop listener after phase 1. | ||
| 4. **PHASE 2**: Peer 2 -> Peer 3 | ||
| - Add `num_of_docs` documents to the database on peer 2: | ||
| * Documents named: `phase2-peer2-doc1`, `phase2-peer2-doc2`, ..., `phase2-peer2-doc{num_of_docs}` | ||
| - Start listener on peer 3: | ||
| * database: `db1` (on peer 3) | ||
| * collections: `["_default._default"]` | ||
| * port: 59840 | ||
| - Setup replicator from peer 2 to peer 3. | ||
| - Start replication from peer 2 to peer 3. | ||
| - Wait for replication from peer 2 to peer 3 to complete. | ||
| - Verify that peer 2 and peer 3 have the same content after phase 2. | ||
| - Stop listener after phase 2. | ||
| 5. **PHASE 3**: Peer 3 -> Peer 1 | ||
| - Add `num_of_docs` documents to the database on peer 3: | ||
| * Documents named: `phase3-peer3-doc1`, `phase3-peer3-doc2`, ..., `phase3-peer3-doc{num_of_docs}` | ||
| - Start listener on peer 1: | ||
| * database: `db1` (on peer 1) | ||
| * collections: `["_default._default"]` | ||
| * port: 59840 | ||
| - Setup replicator from peer 3 to peer 1. | ||
| - Start replication from peer 3 to peer 1. | ||
| - Wait for replication from peer 3 to peer 1 to complete. | ||
| - Verify that peer 3 and peer 1 have the same content after phase 3. | ||
| - Stop listener after phase 3. | ||
| 6. Verify all device databases have converged to the same content after all phases: | ||
| * All three peers should have identical content | ||
| * All documents from all phases should be present on all peers | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be simply added without a change in the API spec in the specs folder for v1 (and implementation on ALL platforms: Java and Android are missing). What is the need for disabling TLS anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback!
I didn’t realise the API spec needed to be updated first - I'll go ahead and add these changes there then?
I’ll also check the Java and Android parts and include the missing changes there.
About disabling TLS: these tests are for the P2P feature, and TLS isn’t a must for them. We can still have a few tests with TLS if needed, but it’s not really necessary for all cases.