Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate video and logging #207

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Robot-Framework/resources/gui_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Log in via GUI
Type string and press enter ${USER_PASSWORD}
END
Verify login
Log To Console Disabling automated lock and suspend
Execute Command systemctl --user stop swayidle

Log out
[Documentation] Log out and optionally verify that desktop is not available
Expand Down Expand Up @@ -69,7 +71,6 @@ Locate image on screen
IF $pass_status=='PASS' BREAK
Sleep 0.5
END
Connect to VM ${GUI_VM}
IF $pass_status=='FAIL' FAIL Image recognition failure: ${image_to_be_searched}
Log To Console Coordinates: ${coordinates}
${mouse_x} Get From Dictionary ${coordinates} x
Expand All @@ -79,6 +80,7 @@ Locate image on screen
Locate and click
[Arguments] ${image_to_be_searched} ${confidence}=0.99 ${iterations}=5
${mouse_x} ${mouse_y} Locate image on screen ${image_to_be_searched} ${confidence}
Connect to VM ${GUI_VM}
Execute Command ydotool mousemove --absolute -x ${mouse_x} -y ${mouse_y} sudo=True sudo_password=${PASSWORD}
Execute Command ydotool click 0xC0 sudo=True sudo_password=${PASSWORD}

Expand Down
11 changes: 7 additions & 4 deletions Robot-Framework/test-suites/bat-tests/__init__.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Resource ../../resources/ssh_keywords.resource
Resource ../../resources/serial_keywords.resource
Resource ../../resources/common_keywords.resource
Resource ../../resources/connection_keywords.resource
Resource ../../resources/gui_keywords.resource
Suite Setup BAT tests setup
Suite Teardown BAT tests teardown

Expand All @@ -21,14 +22,16 @@ BAT tests setup
Connect to VM ${GUI_VM}
Save most common icons and paths to icons
Create test user
GUI Log in
Log in via GUI
END
Switch Connection ${CONNECTION}

BAT tests teardown
Connect to ghaf host
${connection} Connect
Set Global Variable ${CONNECTION} ${connection}
Log journctl
IF "Lenovo" in "${DEVICE}"
Connect to netvm
GUI Log out
Log out
END
Close All Connections
Close All Connections
2 changes: 1 addition & 1 deletion Robot-Framework/test-suites/bat-tests/apps.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Force Tags apps
Resource ../../resources/ssh_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource
Test Setup Run Keywords Move cursor AND Switch Connection ${CONNECTION}
Suite Teardown Close All Connections


*** Variables ***
Expand Down
9 changes: 2 additions & 7 deletions Robot-Framework/test-suites/bat-tests/business_vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Resource ../../resources/ssh_keywords.resource
Resource ../../resources/virtualization_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource
Suite Setup Connect to netvm
Suite Teardown Close All Connections
Test Setup Move cursor
Test Teardown Kill process @{APP_PIDS}

Expand All @@ -17,7 +19,6 @@ Test Teardown Kill process @{APP_PIDS}
Start Microsoft Outlook on LenovoX1
[Documentation] Start Microsoft Outlook in Business-vm and verify process started
[Tags] outlook SP-T176
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application "Microsoft Outlook"
Connect to VM ${BUSINESS_VM}
Expand All @@ -26,7 +27,6 @@ Start Microsoft Outlook on LenovoX1
Start Microsoft 365 on LenovoX1
[Documentation] Start Microsoft 365 in Business-vm and verify process started
[Tags] microsoft365 SP-T178
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application "Microsoft 365"
Connect to VM ${BUSINESS_VM}
Expand All @@ -35,7 +35,6 @@ Start Microsoft 365 on LenovoX1
Start Microsoft Teams on LenovoX1
[Documentation] Start Microsoft Teams in Business-vm and verify process started
[Tags] teams SP-T177
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application Teams
Connect to VM ${BUSINESS_VM}
Expand All @@ -44,7 +43,6 @@ Start Microsoft Teams on LenovoX1
Start Trusted Browser on LenovoX1
[Documentation] Start Trusted Browser in Business-vm and verify process started
[Tags] trusted_browser SP-T179
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application "Trusted Browser"
Connect to VM ${BUSINESS_VM}
Expand All @@ -53,7 +51,6 @@ Start Trusted Browser on LenovoX1
Start Video Editor on LenovoX1
[Documentation] Start Video Editor in Business-vm and verify process started
[Tags] video_editor SP-T244
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application "Video Editor"
Connect to VM ${BUSINESS_VM}
Expand All @@ -62,7 +59,6 @@ Start Video Editor on LenovoX1
Start Text Editor on LenovoX1
[Documentation] Start Text Editor in Business-vm and verify process started
[Tags] text_editor SP-T243
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application "Text Editor"
Connect to VM ${BUSINESS_VM}
Expand All @@ -71,7 +67,6 @@ Start Text Editor on LenovoX1
Start Xarchiver on LenovoX1
[Documentation] Start Xarchiver in Business-vm and verify process started
[Tags] xarchiver SP-T242
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Start XDG application "Xarchiver"
Connect to VM ${BUSINESS_VM}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

*** Settings ***
Documentation Testing logging
Force Tags logging lenovo-x1
Force Tags bat logging lenovo-x1
Resource ../../config/variables.robot
Resource ../../resources/ssh_keywords.resource
Resource ../../resources/connection_keywords.resource
Library DateTime
Suite Setup Set Variables ${DEVICE}
Suite Setup Connect to netvm
Suite Teardown Close All Connections


Expand All @@ -21,7 +21,6 @@ ${GRAFANA_LOGS} https://loki.ghaflogs.vedenemo.dev
Check Grafana logs
[Documentation] Check that all virtual machines are sending logs to Grafana
[Tags] SP-T172
[Setup] Connect to netvm
[Teardown] Remove Wifi configuration ${TEST_WIFI_SSID}
Configure wifi ${NETVM_SSH} ${TEST_WIFI_SSID} ${TEST_WIFI_PSWD}
Check Internet Connection
Expand Down
11 changes: 6 additions & 5 deletions Robot-Framework/test-suites/bat-tests/gui-vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ Force Tags gui-vm-apps bat lenovo-x1
Resource ../../resources/ssh_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource
Test Setup Run Keywords Connect to netvm AND Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Test Setup Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Test Teardown Gui-vm apps teardown
Suite Setup Connect to netvm
Suite Teardown Close All Connections


*** Variables ***
Expand Down Expand Up @@ -56,9 +58,8 @@ Start File Manager on LenovoX1
*** Keywords ***

Gui-vm apps teardown
Connect to VM ${GUI_VM}
Move cursor
Kill process @{APP_PIDS}
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
${app_log} Execute command cat output.log
# Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
${app_log} Execute command cat /tmp/output.log
Log ${app_log}
Move cursor
3 changes: 2 additions & 1 deletion Robot-Framework/test-suites/bat-tests/timesync.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

*** Settings ***
Documentation Testing time synchronization
Force Tags bat timesync
Resource ../../resources/ssh_keywords.resource
Resource ../../config/variables.robot
Library ../../lib/TimeLibrary.py
Expand All @@ -19,7 +20,7 @@ ${change_time} ${EMPTY}
Time synchronization
[Documentation] Stop timesyncd, change time on ghaf host and check that time was changed
... Start timesyncd and check that time was synchronized
[Tags] bat SP-T97 nuc orin-agx orin-nx riscv
[Tags] SP-T97 nuc orin-agx orin-nx riscv lenovo-x1

${host} Connect
Check that time is correct timezone=UTC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

*** Settings ***
Documentation Testing camera application
Force Tags video lenovo-x1
Force Tags bat video lenovo-x1
Resource ../../__framework__.resource
Resource ../../resources/serial_keywords.resource
Resource ../../resources/common_keywords.resource
Expand Down
Loading