-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test coverage for Nodebalancers related methods/functions (#682
- Loading branch information
Showing
21 changed files
with
775 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"id": 456, | ||
"port": 80, | ||
"protocol": "http", | ||
"algorithm": "roundrobin", | ||
"stickiness": "table", | ||
"check": "connection", | ||
"check_interval": 5, | ||
"check_attempts": 3, | ||
"check_path": "/", | ||
"check_body": "", | ||
"check_passive": true, | ||
"check_timeout": 30, | ||
"cipher_suite": "recommended", | ||
"nodebalancer_id": 123, | ||
"ssl_commonname": "", | ||
"ssl_fingerprint": "", | ||
"ssl_cert": "", | ||
"ssl_key": "", | ||
"nodes_status": { | ||
"up": 2, | ||
"down": 1 | ||
} | ||
} | ||
|
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,25 @@ | ||
{ | ||
"id": 456, | ||
"port": 80, | ||
"protocol": "http", | ||
"algorithm": "roundrobin", | ||
"stickiness": "table", | ||
"check": "connection", | ||
"check_interval": 5, | ||
"check_attempts": 3, | ||
"check_path": "/", | ||
"check_body": "", | ||
"check_passive": true, | ||
"check_timeout": 30, | ||
"cipher_suite": "recommended", | ||
"nodebalancer_id": 123, | ||
"ssl_commonname": "", | ||
"ssl_fingerprint": "", | ||
"ssl_cert": "", | ||
"ssl_key": "", | ||
"nodes_status": { | ||
"up": 2, | ||
"down": 1 | ||
} | ||
} | ||
|
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,31 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"id": 456, | ||
"address": "192.168.1.1", | ||
"label": "Test Node", | ||
"status": "UP", | ||
"weight": 50, | ||
"mode": "accept", | ||
"config_id": 456, | ||
"nodebalancer_id": 123, | ||
"port": 80, | ||
"protocol": "http" | ||
}, | ||
{ | ||
"id": 457, | ||
"address": "192.168.1.2", | ||
"label": "Backup Node", | ||
"status": "UP", | ||
"weight": 40, | ||
"mode": "backup", | ||
"config_id": 456, | ||
"nodebalancer_id": 123, | ||
"port": 80, | ||
"protocol": "http" | ||
} | ||
], | ||
"page": 1, | ||
"pages": 1, | ||
"results": 2 | ||
} |
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,25 @@ | ||
{ | ||
"id": 456, | ||
"port": 443, | ||
"protocol": "https", | ||
"algorithm": "roundrobin", | ||
"stickiness": "none", | ||
"check": "connection", | ||
"check_interval": 5, | ||
"check_attempts": 3, | ||
"check_path": "/", | ||
"check_body": "", | ||
"check_passive": true, | ||
"check_timeout": 30, | ||
"cipher_suite": "recommended", | ||
"nodebalancer_id": 123, | ||
"ssl_commonname": "", | ||
"ssl_fingerprint": "", | ||
"ssl_cert": "", | ||
"ssl_key": "", | ||
"nodes_status": { | ||
"up": 2, | ||
"down": 1 | ||
} | ||
} | ||
|
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,25 @@ | ||
{ | ||
"id": 456, | ||
"port": 443, | ||
"protocol": "https", | ||
"algorithm": "roundrobin", | ||
"stickiness": "none", | ||
"check": "connection", | ||
"check_interval": 5, | ||
"check_attempts": 3, | ||
"check_path": "/", | ||
"check_body": "", | ||
"check_passive": true, | ||
"check_timeout": 30, | ||
"cipher_suite": "recommended", | ||
"nodebalancer_id": 123, | ||
"ssl_commonname": "", | ||
"ssl_fingerprint": "", | ||
"ssl_cert": "", | ||
"ssl_key": "", | ||
"nodes_status": { | ||
"up": 2, | ||
"down": 1 | ||
} | ||
} | ||
|
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,18 @@ | ||
{ | ||
"id": 123, | ||
"label": "Test NodeBalancer", | ||
"region": "us-east", | ||
"hostname": "test.nodebalancer.linode.com", | ||
"ipv4": "192.0.2.1", | ||
"ipv6": "2600:3c03::f03c:91ff:fe24:9dcf", | ||
"client_conn_throttle": 10, | ||
"transfer": { | ||
"total": 1000.5, | ||
"in": 500.3, | ||
"out": 500.2 | ||
}, | ||
"tags": ["test", "example"], | ||
"created": "2025-02-01T10:00:00", | ||
"updated": "2025-02-06T10:00:00" | ||
} | ||
|
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,18 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"id": 789, | ||
"label": "firewall-1", | ||
"status": "enabled" | ||
}, | ||
{ | ||
"id": 790, | ||
"label": "firewall-2", | ||
"status": "disabled" | ||
} | ||
], | ||
"page": 1, | ||
"pages": 1, | ||
"results": 2 | ||
} | ||
|
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,18 @@ | ||
{ | ||
"id": 123, | ||
"label": "Existing NodeBalancer", | ||
"region": "us-west", | ||
"hostname": "existing.nodebalancer.linode.com", | ||
"ipv4": "192.0.2.2", | ||
"ipv6": "2600:3c03::f03c:91ff:fe24:abcd", | ||
"client_conn_throttle": 20, | ||
"transfer": { | ||
"total": 2000.0, | ||
"in": 1000.0, | ||
"out": 1000.0 | ||
}, | ||
"tags": ["production"], | ||
"created": "2025-01-15T08:00:00", | ||
"updated": "2025-02-05T12:00:00" | ||
} | ||
|
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,11 @@ | ||
{ | ||
"id": 789, | ||
"address": "192.168.1.1", | ||
"label": "Test Node", | ||
"status": "UP", | ||
"weight": 50, | ||
"mode": "accept", | ||
"config_id": 456, | ||
"nodebalancer_id": 123 | ||
} | ||
|
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,27 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"id": 789, | ||
"address": "192.168.1.1", | ||
"label": "Test Node", | ||
"status": "UP", | ||
"weight": 50, | ||
"mode": "accept", | ||
"config_id": 456, | ||
"nodebalancer_id": 123 | ||
}, | ||
{ | ||
"id": 790, | ||
"address": "192.168.1.2", | ||
"label": "Backup Node", | ||
"status": "UP", | ||
"weight": 40, | ||
"mode": "backup", | ||
"config_id": 456, | ||
"nodebalancer_id": 123 | ||
} | ||
], | ||
"page": 1, | ||
"pages": 1, | ||
"results": 2 | ||
} |
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,11 @@ | ||
{ | ||
"id": 789, | ||
"address": "192.168.1.2", | ||
"label": "Updated Node", | ||
"status": "UP", | ||
"weight": 60, | ||
"mode": "drain", | ||
"config_id": 456, | ||
"nodebalancer_id": 123 | ||
} | ||
|
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,20 @@ | ||
{ | ||
"title": "NodeBalancer Stats", | ||
"data": { | ||
"connections": [ | ||
[1000.0, 2000.0], | ||
[3000.0, 4000.0] | ||
], | ||
"traffic": { | ||
"in": [ | ||
[1000.0, 2000.0], | ||
[3000.0, 4000.0] | ||
], | ||
"out": [ | ||
[500.0, 1000.0], | ||
[1500.0, 2000.0] | ||
] | ||
} | ||
} | ||
} | ||
|
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,18 @@ | ||
{ | ||
"id": 456, | ||
"label": "Updated NodeBalancer", | ||
"region": "us-west", | ||
"hostname": "updated.nodebalancer.linode.com", | ||
"ipv4": "192.0.2.5", | ||
"ipv6": "2600:3c03::f03c:91ff:fe24:3333", | ||
"client_conn_throttle": 5, | ||
"transfer": { | ||
"total": 1500.0, | ||
"in": 750.0, | ||
"out": 750.0 | ||
}, | ||
"tags": ["updated", "production"], | ||
"created": "2025-01-15T08:00:00", | ||
"updated": "2025-02-06T15:00:00" | ||
} | ||
|
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 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"id": 123, | ||
"label": "NodeBalancer A", | ||
"region": "us-east", | ||
"tags": ["tag1", "tag2"] | ||
}, | ||
{ | ||
"id": 456, | ||
"label": "NodeBalancer B", | ||
"region": "us-west", | ||
"tags": ["tag3"] | ||
} | ||
], | ||
"page": 1, | ||
"pages": 1, | ||
"results": 2 | ||
} |
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,27 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"id": "123", | ||
"label": "NodeBalancer A", | ||
"region": "us-east", | ||
"tags": ["tag1", "tag2"], | ||
"price": { | ||
"hourly": 0.10, | ||
"monthly": 10.00 | ||
} | ||
}, | ||
{ | ||
"id": "456", | ||
"label": "NodeBalancer B", | ||
"region": "us-west", | ||
"tags": ["tag3"], | ||
"price": { | ||
"hourly": 0.15, | ||
"monthly": 15.00 | ||
} | ||
} | ||
], | ||
"page": 1, | ||
"pages": 1, | ||
"results": 2 | ||
} |
Oops, something went wrong.