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
45 changes: 31 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,32 @@ 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):
result = subprocess.run(
ssh_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
output = result.stdout
if "0% packet loss" in output:
break
if attempt < NUM_OF_RETRIES - 1:
time.sleep(10)

assert (
"0% packet loss" in output
), f"Ping failed after {NUM_OF_RETRIES} retries: {output}"