From 20138ffdea70182a25e6d9c1a7f32b0bc916e427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maarit=20H=C3=A4rk=C3=B6nen?= Date: Wed, 9 Oct 2024 14:06:59 +0300 Subject: [PATCH] Add logging for each vm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maarit Härkönen --- .../resources/ssh_keywords.resource | 4 +-- .../test-suites/bat-tests/apps.robot | 26 ++++++++++++------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Robot-Framework/resources/ssh_keywords.resource b/Robot-Framework/resources/ssh_keywords.resource index b661718..ddf3173 100644 --- a/Robot-Framework/resources/ssh_keywords.resource +++ b/Robot-Framework/resources/ssh_keywords.resource @@ -134,14 +134,14 @@ Start application Log To Console ${\n}Starting ${app_name} ${output} Execute Command cat /etc/xdg/weston/weston.ini ${path} Get App Path ${output} ${app_name} - Execute Command nohup sh -c '$(${path})' > output.log 2>&1 & + Execute Command nohup sh -c '${path}' > output.log 2>&1 & Start XDG application [Arguments] ${app_name} Log To Console ${\n}Starting ${app_name} ${output} Execute Command cat /run/current-system/sw/share/applications/${app_name}.desktop ${path} Get App Path From Desktop ${output} - Execute Command nohup sh -c '$(${path})' > output.log 2>&1 & + Execute Command nohup sh -c '${path}' > output.log 2>&1 & Start Firefox [Documentation] It's needed to set display variable manually because there is no real monitor connected to DUT diff --git a/Robot-Framework/test-suites/bat-tests/apps.robot b/Robot-Framework/test-suites/bat-tests/apps.robot index 99f75a0..d890987 100644 --- a/Robot-Framework/test-suites/bat-tests/apps.robot +++ b/Robot-Framework/test-suites/bat-tests/apps.robot @@ -24,7 +24,7 @@ Start Firefox Connect Start Firefox Check that the application was started firefox - [Teardown] Kill process @{app_pids} + [Teardown] Kill Process And Log journalctl Start Chromium on LenovoX1 [Documentation] Start Chromium in dedicated VM and verify process started @@ -36,7 +36,7 @@ Start Chromium on LenovoX1 Start XDG application Chromium Connect to VM ${CHROMIUM_VM} Check that the application was started chromium - [Teardown] Kill process @{app_pids} + [Teardown] Kill Process And Log journalctl Start Zathura on LenovoX1 [Documentation] Start Zathura in dedicated VM and verify process started @@ -46,8 +46,8 @@ Start Zathura on LenovoX1 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 - [Teardown] Kill process @{app_pids} + Run Keyword And Continue On Failure Check that the application was started zathura + [Teardown] Kill Process And Log journalctl Start Gala on LenovoX1 [Documentation] Start Gala in dedicated VM and verify process started @@ -58,7 +58,7 @@ Start Gala on LenovoX1 Start XDG application GALA Connect to VM ${GALA_VM} Check that the application was started gala - [Teardown] Kill process @{app_pids} + [Teardown] Kill Process And Log journalctl Start Element on LenovoX1 [Documentation] Start Element in dedicated VM and verify process started @@ -69,7 +69,7 @@ Start Element on LenovoX1 Start XDG application Element Connect to VM ${COMMS_VM} Check that the application was started element - [Teardown] Kill process @{app_pids} + [Teardown] Kill Process And Log journalctl Start Slack on LenovoX1 [Documentation] Start Slack in dedicated VM and verify process started @@ -80,15 +80,23 @@ Start Slack on LenovoX1 Start XDG application Slack Connect to VM ${COMMS_VM} Check that the application was started slack - [Teardown] Kill process @{app_pids} + [Teardown] Kill Process And Log journalctl Start Appflowy on LenovoX1 [Documentation] Start Appflowy in dedicated VM and verify process started - [Tags] bat appflowy lenovo-x1 + [Tags] 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 - [Teardown] Kill process @{app_pids} + [Teardown] Kill Process And Log journalctl + + +*** Keywords *** +Kill Process And Log journalctl + [Documentation] Kill all running process and log journalctl + ${output} Execute Command journalctl + Log ${output} + Kill process @{app_pids}