From a6b50749fa1040a9d4bff750b1fb4befec21a80a Mon Sep 17 00:00:00 2001 From: jitendra-kushavah Date: Tue, 27 May 2025 12:46:03 +0530 Subject: [PATCH] Fixed captive portal issue Signed-off-by: jitendra-kushavah --- lf_libs/lf_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lf_libs/lf_tests.py b/lf_libs/lf_tests.py index 2067dfe7..174260a9 100644 --- a/lf_libs/lf_tests.py +++ b/lf_libs/lf_tests.py @@ -4494,7 +4494,8 @@ class lf_tests(lf_libs): f"hostname: {hostname} port: {port} username: {username} password: {password} ping_host: {ping_host}") ping_command = f"/home/lanforge/vrf_exec.bash {sta} ping -c {ping_count} {ping_host}" validate_captive_string = '
uCentral - Captive Portal
' - validate_ping_string = "0% packet loss" + validate_captive_connection = '

Connected

' + validate_ping_string = " 0% packet loss" client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: @@ -4517,7 +4518,8 @@ class lf_tests(lf_libs): logging.info("Captive portal authentication logs: " + str(captive_output)) allure.attach(name="Response from captive portal: ", body=captive_output, attachment_type=allure.attachment_type.HTML) - if validate_captive_string in captive_output and "Invalid credentials" not in captive_output: + if (validate_captive_string in captive_output and "Invalid credentials" not in captive_output and + validate_captive_connection in captive_output): logging.info("Captive portal authentication successful") else: if "Invalid credentials" in captive_output: