Skip to content

Commit 1f1254b

Browse files
authored
Add unit test coverage for Nodebalancers related methods/functions (#682)
* node_test * node_tests
1 parent 33d2c6a commit 1f1254b

21 files changed

+775
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id": 456,
3+
"port": 80,
4+
"protocol": "http",
5+
"algorithm": "roundrobin",
6+
"stickiness": "table",
7+
"check": "connection",
8+
"check_interval": 5,
9+
"check_attempts": 3,
10+
"check_path": "/",
11+
"check_body": "",
12+
"check_passive": true,
13+
"check_timeout": 30,
14+
"cipher_suite": "recommended",
15+
"nodebalancer_id": 123,
16+
"ssl_commonname": "",
17+
"ssl_fingerprint": "",
18+
"ssl_cert": "",
19+
"ssl_key": "",
20+
"nodes_status": {
21+
"up": 2,
22+
"down": 1
23+
}
24+
}
25+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id": 456,
3+
"port": 80,
4+
"protocol": "http",
5+
"algorithm": "roundrobin",
6+
"stickiness": "table",
7+
"check": "connection",
8+
"check_interval": 5,
9+
"check_attempts": 3,
10+
"check_path": "/",
11+
"check_body": "",
12+
"check_passive": true,
13+
"check_timeout": 30,
14+
"cipher_suite": "recommended",
15+
"nodebalancer_id": 123,
16+
"ssl_commonname": "",
17+
"ssl_fingerprint": "",
18+
"ssl_cert": "",
19+
"ssl_key": "",
20+
"nodes_status": {
21+
"up": 2,
22+
"down": 1
23+
}
24+
}
25+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"data": [
3+
{
4+
"id": 456,
5+
"address": "192.168.1.1",
6+
"label": "Test Node",
7+
"status": "UP",
8+
"weight": 50,
9+
"mode": "accept",
10+
"config_id": 456,
11+
"nodebalancer_id": 123,
12+
"port": 80,
13+
"protocol": "http"
14+
},
15+
{
16+
"id": 457,
17+
"address": "192.168.1.2",
18+
"label": "Backup Node",
19+
"status": "UP",
20+
"weight": 40,
21+
"mode": "backup",
22+
"config_id": 456,
23+
"nodebalancer_id": 123,
24+
"port": 80,
25+
"protocol": "http"
26+
}
27+
],
28+
"page": 1,
29+
"pages": 1,
30+
"results": 2
31+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id": 456,
3+
"port": 443,
4+
"protocol": "https",
5+
"algorithm": "roundrobin",
6+
"stickiness": "none",
7+
"check": "connection",
8+
"check_interval": 5,
9+
"check_attempts": 3,
10+
"check_path": "/",
11+
"check_body": "",
12+
"check_passive": true,
13+
"check_timeout": 30,
14+
"cipher_suite": "recommended",
15+
"nodebalancer_id": 123,
16+
"ssl_commonname": "",
17+
"ssl_fingerprint": "",
18+
"ssl_cert": "",
19+
"ssl_key": "",
20+
"nodes_status": {
21+
"up": 2,
22+
"down": 1
23+
}
24+
}
25+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id": 456,
3+
"port": 443,
4+
"protocol": "https",
5+
"algorithm": "roundrobin",
6+
"stickiness": "none",
7+
"check": "connection",
8+
"check_interval": 5,
9+
"check_attempts": 3,
10+
"check_path": "/",
11+
"check_body": "",
12+
"check_passive": true,
13+
"check_timeout": 30,
14+
"cipher_suite": "recommended",
15+
"nodebalancer_id": 123,
16+
"ssl_commonname": "",
17+
"ssl_fingerprint": "",
18+
"ssl_cert": "",
19+
"ssl_key": "",
20+
"nodes_status": {
21+
"up": 2,
22+
"down": 1
23+
}
24+
}
25+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"id": 123,
3+
"label": "Test NodeBalancer",
4+
"region": "us-east",
5+
"hostname": "test.nodebalancer.linode.com",
6+
"ipv4": "192.0.2.1",
7+
"ipv6": "2600:3c03::f03c:91ff:fe24:9dcf",
8+
"client_conn_throttle": 10,
9+
"transfer": {
10+
"total": 1000.5,
11+
"in": 500.3,
12+
"out": 500.2
13+
},
14+
"tags": ["test", "example"],
15+
"created": "2025-02-01T10:00:00",
16+
"updated": "2025-02-06T10:00:00"
17+
}
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"data": [
3+
{
4+
"id": 789,
5+
"label": "firewall-1",
6+
"status": "enabled"
7+
},
8+
{
9+
"id": 790,
10+
"label": "firewall-2",
11+
"status": "disabled"
12+
}
13+
],
14+
"page": 1,
15+
"pages": 1,
16+
"results": 2
17+
}
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"id": 123,
3+
"label": "Existing NodeBalancer",
4+
"region": "us-west",
5+
"hostname": "existing.nodebalancer.linode.com",
6+
"ipv4": "192.0.2.2",
7+
"ipv6": "2600:3c03::f03c:91ff:fe24:abcd",
8+
"client_conn_throttle": 20,
9+
"transfer": {
10+
"total": 2000.0,
11+
"in": 1000.0,
12+
"out": 1000.0
13+
},
14+
"tags": ["production"],
15+
"created": "2025-01-15T08:00:00",
16+
"updated": "2025-02-05T12:00:00"
17+
}
18+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"id": 789,
3+
"address": "192.168.1.1",
4+
"label": "Test Node",
5+
"status": "UP",
6+
"weight": 50,
7+
"mode": "accept",
8+
"config_id": 456,
9+
"nodebalancer_id": 123
10+
}
11+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"data": [
3+
{
4+
"id": 789,
5+
"address": "192.168.1.1",
6+
"label": "Test Node",
7+
"status": "UP",
8+
"weight": 50,
9+
"mode": "accept",
10+
"config_id": 456,
11+
"nodebalancer_id": 123
12+
},
13+
{
14+
"id": 790,
15+
"address": "192.168.1.2",
16+
"label": "Backup Node",
17+
"status": "UP",
18+
"weight": 40,
19+
"mode": "backup",
20+
"config_id": 456,
21+
"nodebalancer_id": 123
22+
}
23+
],
24+
"page": 1,
25+
"pages": 1,
26+
"results": 2
27+
}

0 commit comments

Comments
 (0)