From bb42956855c6c3bab5bb8a0e34cf07b148545a6d Mon Sep 17 00:00:00 2001 From: Mariia Azbeleva Date: Thu, 14 Sep 2023 13:30:55 +0300 Subject: [PATCH] Verify wpa_supplicant status Signed-off-by: Mariia Azbeleva --- Robot-Framework/resources/ssh_keywords.resource | 7 ++++--- Robot-Framework/test-suites/bat-tests/netvm.robot | 12 +++++++++++- requirements | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Robot-Framework/resources/ssh_keywords.resource b/Robot-Framework/resources/ssh_keywords.resource index a4cf94c..8326a8a 100644 --- a/Robot-Framework/resources/ssh_keywords.resource +++ b/Robot-Framework/resources/ssh_keywords.resource @@ -116,10 +116,11 @@ Kill process Verify service status [Documentation] Check if service is running with given loop ${range} - [Arguments] ${range}=1 ${service}=${EMPTY} ${expected_status}=active ${expected_state}=running + [Arguments] ${range}=1 ${service}=${EMPTY} ${expected_status}=active ${expected_state}=running ${expected_rc}=0 FOR ${i} IN RANGE ${range} - ${output}= Execute Command systemctl status ${service} - Log ${output} + ${output} ${stderr} ${rc}= Execute Command systemctl status ${service} return_stderr=True return_rc=True + Log stdout: ${output}\nstderr: ${stderr} + Should Not Be Equal As Integers ${rc} 4 Stderr: "${stderr}", Return code ${result}= Get Service Status ${output} ${status} ${state} Get Service Status ${output} END diff --git a/Robot-Framework/test-suites/bat-tests/netvm.robot b/Robot-Framework/test-suites/bat-tests/netvm.robot index 833a9c5..4539eda 100644 --- a/Robot-Framework/test-suites/bat-tests/netvm.robot +++ b/Robot-Framework/test-suites/bat-tests/netvm.robot @@ -33,8 +33,10 @@ Verify NetVM is started Wifi passthrought into NetVM [Documentation] Verify that wifi works inside netvm [Tags] bat SP-T50 nuc orin-agx orin-nx + ... test:retry(1) [Setup] Run Keywords - ... Connect to ghaf host AND Connect to netvm via tunnel + ... Connect to ghaf host AND Connect to netvm via tunnel AND + ... Verify service status service=wpa_supplicant.service Configure wifi ${netvm} ${SSID} ${wifi_pswd} Check Network Availability ${netwotk_ip} expected_result=True Log To Console Switch connection to Ghaf Host @@ -64,6 +66,14 @@ NetVM is wiped after restarting Check file doesn't exist /etc/test.txt [Teardown] Run Keywords Close tunnel ${ghaf_host} AND Close All Connections +Verify wpa_supplicant.service is running + [Documentation] Verify that wpa_supplicant.service exists and is running + [Tags] bat SP-T82 nuc orin-agx orin-nx + [Setup] Run Keywords + ... Connect to ghaf host AND Connect to netvm via tunnel + Switch Connection ${netvm} + Verify service status service=wpa_supplicant.service + *** Keywords *** diff --git a/requirements b/requirements index e621ef7..f237bf3 100644 --- a/requirements +++ b/requirements @@ -5,3 +5,4 @@ robotframework-advancedlogging==2.0.0 robotframework==5.0.1 PyP100==0.1.2 python-kasa~=0.5.1 +robotframework-retryfailed==0.2.0