From 0bc032bcb015a6a5c65ab12fdbbfdb82ab1f701e Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Thu, 11 Jun 2026 10:12:32 -0400 Subject: [PATCH 1/2] Resolve failings tests blocking release --- test/integration/conftest.py | 19 +++++++++---------- test/integration/models/linode/test_linode.py | 5 +++-- test/integration/models/vpc/test_vpc.py | 5 +++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/test/integration/conftest.py b/test/integration/conftest.py index f1e20c3a0..dc851f87a 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -2,6 +2,7 @@ import logging import os import random +import subprocess import time from test.integration.helpers import ( get_test_label, @@ -262,21 +263,19 @@ def create_linode_for_pass_reset(test_linode_client, e2e_test_firewall): @pytest.fixture(scope="session") -def ssh_key_gen(): - output = os.popen("ssh-keygen -q -t rsa -f ./sdk-sshkey -q -N ''") +def ssh_key_gen(tmp_path_factory): + key_path = tmp_path_factory.mktemp("ssh-key-gen") / "sdk-sshkey" - time.sleep(1) - - pub_file = open("./sdk-sshkey.pub", "r") - pub_key = pub_file.read().rstrip() + subprocess.run( + ["ssh-keygen", "-q", "-t", "rsa", "-f", str(key_path), "-N", ""], + check=True, + ) - priv_file = open("./sdk-sshkey", "r") - priv_key = priv_file.read().rstrip() + pub_key = key_path.with_suffix(".pub").read_text().rstrip() + priv_key = key_path.read_text().rstrip() yield pub_key, priv_key - os.popen("rm ./sdk-sshkey*") - @pytest.fixture(scope="session") def test_linode_client(): diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index 1ce382cf1..50455f158 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -1247,18 +1247,19 @@ def test_create_linode_with_kernel_and_boot_size_then_add_disk_and_rebuild( def test_update_linode_with_reserved_ip_in_address( - test_linode_client, e2e_test_firewall, create_reserved_ip + test_linode_client, e2e_test_firewall, create_reserved_ip, ssh_key_gen ): label = get_test_label(length=8) client = test_linode_client reserved_ip = create_reserved_ip - linode, _ = client.linode.instance_create( + linode = client.linode.instance_create( "g6-nanode-1", reserved_ip.region, image="linode/debian12", label=label, firewall=e2e_test_firewall, + authorized_keys=ssh_key_gen[0], ) linode_ips = linode.ips.ipv4.public diff --git a/test/integration/models/vpc/test_vpc.py b/test/integration/models/vpc/test_vpc.py index 85d32d858..d5533ed82 100644 --- a/test/integration/models/vpc/test_vpc.py +++ b/test/integration/models/vpc/test_vpc.py @@ -67,9 +67,10 @@ def test_get_all_vpcs(test_linode_client, create_multiple_vpcs): vpc_1, vpc_2 = create_multiple_vpcs all_vpcs = test_linode_client.vpcs() + all_vpc_ids = {vpc.id for vpc in all_vpcs} - assert str(vpc_1) in str(all_vpcs.lists) - assert str(vpc_2) in str(all_vpcs.lists) + assert vpc_1.id in all_vpc_ids + assert vpc_2.id in all_vpc_ids def test_fails_update_vpc_invalid_data(create_vpc): From 2ddb1ad181e3fa70961dfc28a3296bea5c81e5c4 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Thu, 11 Jun 2026 10:23:40 -0400 Subject: [PATCH 2/2] Correct interfaces test --- .../linode/interfaces/test_interfaces.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/integration/models/linode/interfaces/test_interfaces.py b/test/integration/models/linode/interfaces/test_interfaces.py index f5e4f1963..797f24156 100644 --- a/test/integration/models/linode/interfaces/test_interfaces.py +++ b/test/integration/models/linode/interfaces/test_interfaces.py @@ -43,27 +43,33 @@ def build_interface_public_ipv4(firewall, ip_address): ) -def create_linode_with_legacy_config(client, ip_address, label, firewall): - linode, _ = client.linode.instance_create( +def create_linode_with_legacy_config( + client, ip_address, label, firewall, authorized_key +): + linode = client.linode.instance_create( "g6-nanode-1", ip_address.region, image="linode/debian12", label=label, firewall=firewall, interface_generation=InterfaceGeneration.LEGACY_CONFIG, + authorized_keys=authorized_key, ipv4=[ip_address.address], ) return linode -def create_linode_with_standard_interfaces(client, ip_address, label, firewall): +def create_linode_with_standard_interfaces( + client, ip_address, label, firewall, authorized_key +): interface = build_interface_public_ipv4(firewall.id, ip_address.address) - linode, _ = client.linode.instance_create( + linode = client.linode.instance_create( "g6-nanode-1", ip_address.region, image="linode/debian12", label=label, interface_generation=InterfaceGeneration.LINODE, + authorized_keys=authorized_key, interfaces=[interface], ) return linode @@ -415,13 +421,19 @@ def test_linode_interface_firewalls(e2e_test_firewall, linode_interface_public): ids=["legacy_config", "standard_interfaces"], ) def test_linode_interfaces_with_reserved_ips( - test_linode_client, e2e_test_firewall, create_reserved_ip, create_linode_fn + test_linode_client, + e2e_test_firewall, + create_reserved_ip, + create_linode_fn, + ssh_key_gen, ): client = test_linode_client reserved_ip = create_reserved_ip label = get_test_label(length=8) - linode = create_linode_fn(client, reserved_ip, label, e2e_test_firewall) + linode = create_linode_fn( + client, reserved_ip, label, e2e_test_firewall, ssh_key_gen[0] + ) try: linode_ips = linode.ips.ipv4.public