Skip to content

Commit 8b5b2a2

Browse files
Add integration test
1 parent 8d37b84 commit 8b5b2a2

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

test/integration/models/lke/test_lke.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,31 @@ def lke_cluster_with_labels_and_taints(test_linode_client):
110110
cluster.delete()
111111

112112

113+
@pytest.fixture(scope="session")
114+
def lke_cluster_with_apl(test_linode_client):
115+
version = test_linode_client.lke.versions()[0]
116+
117+
region = get_region(test_linode_client, {"Kubernetes", "Disk Encryption"})
118+
119+
node_pools = test_linode_client.lke.node_pool("g6-dedicated-2", 3)
120+
label = get_test_label() + "_cluster"
121+
122+
cluster = test_linode_client.lke.cluster_create(
123+
region,
124+
label,
125+
node_pools,
126+
version,
127+
control_plane=LKEClusterControlPlaneOptions(
128+
high_availability=True,
129+
),
130+
apl_enabled=True,
131+
)
132+
133+
yield cluster
134+
135+
cluster.delete()
136+
137+
113138
def get_cluster_status(cluster: LKECluster, status: str):
114139
return cluster._raw_json["status"] == status
115140

@@ -328,6 +353,19 @@ def test_lke_cluster_labels_and_taints(lke_cluster_with_labels_and_taints):
328353
assert LKENodePoolTaint.from_json(updated_taints[1]) in pool.taints
329354

330355

356+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
357+
def test_lke_cluster_with_apl(lke_cluster_with_apl):
358+
assert lke_cluster_with_apl.apl_enabled == True
359+
assert (
360+
lke_cluster_with_apl.apl_console_url
361+
== f"https://console.lke{lke_cluster_with_apl.id}.akamai-apl.net"
362+
)
363+
assert (
364+
lke_cluster_with_apl.apl_health_check_url
365+
== f"https://auth.lke{lke_cluster_with_apl.id}.akamai-apl.net/ready"
366+
)
367+
368+
331369
def test_lke_types(test_linode_client):
332370
types = test_linode_client.lke.types()
333371

test/unit/objects/lke_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ def test_cluster_create_with_apl(self):
381381
assert (
382382
cluster.apl_console_url == "https://console.lke18881.akamai-apl.net"
383383
)
384+
384385
assert (
385386
cluster.apl_health_check_url
386387
== "https://auth.lke18881.akamai-apl.net/ready"

0 commit comments

Comments
 (0)