From e7319d55e88fd370a5dc4944ca0be74d2c52a523 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Fri, 13 Feb 2026 18:13:52 +0530 Subject: [PATCH] int_test_fixs --- tests/integration/account/test_account.py | 6 ++++ tests/integration/lke/test_clusters.py | 2 +- tests/integration/ssh/test_ssh.py | 44 +++++++++++++++-------- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/tests/integration/account/test_account.py b/tests/integration/account/test_account.py index e3d99c3c5..55c53513f 100644 --- a/tests/integration/account/test_account.py +++ b/tests/integration/account/test_account.py @@ -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 diff --git a/tests/integration/lke/test_clusters.py b/tests/integration/lke/test_clusters.py index 4b11f5cb8..f9fae8e7f 100644 --- a/tests/integration/lke/test_clusters.py +++ b/tests/integration/lke/test_clusters.py @@ -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) diff --git a/tests/integration/ssh/test_ssh.py b/tests/integration/ssh/test_ssh.py index a1f1f8e91..28b36679b 100644 --- a/tests/integration/ssh/test_ssh.py +++ b/tests/integration/ssh/test_ssh.py @@ -1,5 +1,6 @@ import os import re +import subprocess import time from sys import platform @@ -96,7 +97,7 @@ def test_ssh_to_linode_and_get_kernel_version( "--text", "--no-headers", ] - ) + ).strip() time.sleep(SSH_SLEEP_PERIOD) @@ -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): + 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}"