Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/integration/account/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,9 @@ def test_clients_list():

headers = ["label", "status"]
assert_headers_in_lines(headers, lines)


def test_configure_command_smoke():
result = exec_test_command(["linode-cli", "configure", "--help"])

assert "Configured the Linode CLI" in result
2 changes: 1 addition & 1 deletion tests/integration/lke/test_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_view_node(lke_cluster):
)

lines = res.splitlines()
headers = ["id", "id,instance_id,status"]
headers = ["id", "instance_id", "pool_id", "status"]
assert_headers_in_lines(headers, lines)


Expand Down
44 changes: 30 additions & 14 deletions tests/integration/ssh/test_ssh.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import subprocess
import time
from sys import platform

Expand Down Expand Up @@ -96,7 +97,7 @@ def test_ssh_to_linode_and_get_kernel_version(
"--text",
"--no-headers",
]
)
).strip()

time.sleep(SSH_SLEEP_PERIOD)

Expand Down Expand Up @@ -129,16 +130,31 @@ def test_check_vm_for_ipv4_connectivity(
"--text",
"--no-headers",
]
)

time.sleep(SSH_SLEEP_PERIOD)

output = os.popen(
"linode-cli ssh root@"
+ linode_label
+ " -i "
+ privkey_file
+ ' -o StrictHostKeyChecking=no -o IdentitiesOnly=yes "ping -4 -W60 -c3 google.com"'
).read()

assert "0% packet loss" in output
).strip()

ssh_cmd = [
"linode-cli",
"ssh",
f"root@{linode_label}",
"-i",
privkey_file,
"-o",
"StrictHostKeyChecking=no",
"-o",
"IdentitiesOnly=yes",
"ping -4 -W60 -c3 google.com",
]

output = ""
for attempt in range(NUM_OF_RETRIES):
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop variable 'attempt' is unused. Consider using '_' to indicate that this variable is intentionally not used, or use 'attempt' in error messages or logging to provide better debugging information.

Suggested change
for attempt in range(NUM_OF_RETRIES):
for _ in range(NUM_OF_RETRIES):

Copilot uses AI. Check for mistakes.
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
if "0% packet loss" in output:
break
time.sleep(10)
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sleep occurs even after the last retry attempt. Following the pattern in helpers.py (lines 136-137), consider adding a check if attempt < NUM_OF_RETRIES - 1: before the sleep to avoid an unnecessary 10-second delay when all retries are exhausted.

Suggested change
time.sleep(10)
if attempt < NUM_OF_RETRIES - 1:
time.sleep(10)

Copilot uses AI. Check for mistakes.

assert (
"0% packet loss" in output
), f"Ping failed after {NUM_OF_RETRIES} retries: {output}"
Comment on lines +149 to +160
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion message includes the output, but doesn't include which attempt failed or any stderr output from the subprocess. Consider including result.stderr in the assertion message to help debug SSH connection failures. The stderr would show SSH errors like connection refused, authentication failures, etc.

Suggested change
for attempt in range(NUM_OF_RETRIES):
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
if "0% packet loss" in output:
break
time.sleep(10)
assert (
"0% packet loss" in output
), f"Ping failed after {NUM_OF_RETRIES} retries: {output}"
stderr_output = ""
last_attempt = 0
for attempt in range(NUM_OF_RETRIES):
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
stderr_output = result.stderr
last_attempt = attempt + 1
if "0% packet loss" in output:
break
time.sleep(10)
assert (
"0% packet loss" in output
), (
f"Ping failed after {NUM_OF_RETRIES} retries "
f"(last attempt {last_attempt}): stdout: {output}, stderr: {stderr_output}"
)

Copilot uses AI. Check for mistakes.
Loading