From d20c748cfe1e3f415ea7ed97b65beca7f9950847 Mon Sep 17 00:00:00 2001 From: Mariia Azbeleva Date: Mon, 9 Sep 2024 13:49:27 +0300 Subject: [PATCH] Check ssh on VMs before start apps Signed-off-by: Mariia Azbeleva --- Robot-Framework/resources/ssh_keywords.resource | 4 ---- Robot-Framework/test-suites/bat-tests/apps.robot | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Robot-Framework/resources/ssh_keywords.resource b/Robot-Framework/resources/ssh_keywords.resource index 0d1c067..b661718 100644 --- a/Robot-Framework/resources/ssh_keywords.resource +++ b/Robot-Framework/resources/ssh_keywords.resource @@ -293,13 +293,11 @@ Save log Check if ssh is ready on netvm [Arguments] ${timeout}=30 - ${is_ready} = Set Variable False FOR ${i} IN RANGE ${timeout} ${output} ${rc} Execute Command nc -zvw3 192.168.101.1 22 return_rc=True ${status} Run Keyword And Return Status ... Should Be Equal As Integers ${rc} 0 IF ${status} - ${is_ready} = Set Variable True BREAK END Sleep 1 @@ -308,13 +306,11 @@ Check if ssh is ready on netvm Check if ssh is ready on vm [Arguments] ${vm} ${timeout}=30 - ${is_ready} = Set Variable False FOR ${i} IN RANGE ${timeout} ${output} ${rc} Execute Command nc -zvw3 ${vm} 22 return_rc=True ${status} Run Keyword And Return Status ... Should Be Equal As Integers ${rc} 0 IF ${status} - ${is_ready} = Set Variable True BREAK END Sleep 1 diff --git a/Robot-Framework/test-suites/bat-tests/apps.robot b/Robot-Framework/test-suites/bat-tests/apps.robot index f8ec6c0..99f75a0 100644 --- a/Robot-Framework/test-suites/bat-tests/apps.robot +++ b/Robot-Framework/test-suites/bat-tests/apps.robot @@ -32,6 +32,7 @@ Start Chromium on LenovoX1 Verify service status range=15 service=microvm@chromium-vm.service expected_status=active expected_state=running Connect to netvm Connect to VM ${GUI_VM} + Check if ssh is ready on vm ${CHROMIUM_VM} Start XDG application Chromium Connect to VM ${CHROMIUM_VM} Check that the application was started chromium @@ -42,6 +43,7 @@ Start Zathura on LenovoX1 [Tags] bat SP-T112 lenovo-x1 [Setup] Connect to netvm Connect to VM ${GUI_VM} + Check if ssh is ready on vm ${ZATHURA_VM} Start XDG application 'PDF Viewer' Connect to VM ${ZATHURA_VM} Check that the application was started zathura @@ -52,6 +54,7 @@ Start Gala on LenovoX1 [Tags] bat SP-T111 lenovo-x1 [Setup] Connect to netvm Connect to VM ${GUI_VM} + Check if ssh is ready on vm ${GALA_VM} Start XDG application GALA Connect to VM ${GALA_VM} Check that the application was started gala @@ -62,6 +65,7 @@ Start Element on LenovoX1 [Tags] bat SP-T57 lenovo-x1 [Setup] Connect to netvm Connect to VM ${GUI_VM} + Check if ssh is ready on vm ${COMMS_VM} Start XDG application Element Connect to VM ${COMMS_VM} Check that the application was started element @@ -72,6 +76,7 @@ Start Slack on LenovoX1 [Tags] bat SP-T191 lenovo-x1 [Setup] Connect to netvm Connect to VM ${GUI_VM} + Check if ssh is ready on vm ${COMMS_VM} Start XDG application Slack Connect to VM ${COMMS_VM} Check that the application was started slack @@ -82,6 +87,7 @@ Start Appflowy on LenovoX1 [Tags] bat appflowy lenovo-x1 [Setup] Connect to netvm Connect to VM ${GUI_VM} + Check if ssh is ready on vm appflowy-vm Start XDG application AppFlowy Connect to VM ${APPFLOWY_VM} Check that the application was started appflowy