Skip to content

Commit

Permalink
Integrate video, audio, logging tests to bat suite
Browse files Browse the repository at this point in the history
Update also VM cpu dict of Sysbench test in VMs on
LenovoX1.

Signed-off-by: Samuli Leivo <[email protected]>
  • Loading branch information
leivos-unikie committed Jan 28, 2025
1 parent c978375 commit 67f34cc
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 39 deletions.
5 changes: 3 additions & 2 deletions Robot-Framework/test-suites/bat-tests/__init__.robot
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ BAT tests setup
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
Log out
END
Close All Connections
Close All Connections
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,28 @@

*** Settings ***
Documentation Testing audio applicaton
Force Tags audio lenovo-x1
Force Tags audio
Resource ../../__framework__.resource
Resource ../../resources/serial_keywords.resource
Resource ../../resources/common_keywords.resource
Resource ../../resources/connection_keywords.resource
Resource ../../resources/ssh_keywords.resource
Resource ../../config/variables.robot
Suite Setup Initialize Variables And Connect
Suite Teardown Close All Connections
Test Timeout 2 minutes
Test Setup Connect to netvm
Test Teardown Close All Connections
Test Timeout 3 minutes


*** Test Cases ***
Record Audio And Verify
[Documentation] Record short audio with pulseaudio tool. Verify audio clip is bigger than default empty file (40Kb)
[Teardown] Execute Command rm /tmp/test*.wav sudo=True sudo_password=${PASSWORD}
[Tags] SSRCSP-T247
Connect to netvm
[Tags] SSRCSP-T247 lenovo-x1
FOR ${vm} IN ${CHROME_VM} ${BUSINESS_VM}
Connect to VM ${vm}
# Execute Command timeouts in business-vm, but it is executing the command
Log To Console Recording audio file
Run Keyword And Ignore Error Execute Command parecord -r /tmp/test_${vm}.wav timeout=10
Run Keyword And Ignore Error Execute Command parecord -r /tmp/test_${vm}.wav sudo=True sudo_password=${PASSWORD} timeout=10
Sleep 5
Execute Command pkill parecord timeout=10 sudo=True sudo_password=${PASSWORD}
Sleep 1
Expand All @@ -35,12 +34,11 @@ Record Audio And Verify

Check Audio devices
[Documentation] List audio sinks and sources in business-vm and chrome-vm and check status is running
[Tags] SSRCSP-T246
Connect to netvm
[Tags] SSRCSP-T246 lenovo-x1
FOR ${vm} IN ${CHROME_VM} ${BUSINESS_VM}
Connect to VM ${vm}
${sources} Execute Command pactl list sources
${sinks} Execute Command pactl list sinks
${sources} Execute Command pactl list sources sudo=True sudo_password=${PASSWORD}
${sinks} Execute Command pactl list sinks sudo=True sudo_password=${PASSWORD}
Should Not Be Empty ${sources}
Should Not Be Empty ${sinks}
END
Expand Down
19 changes: 5 additions & 14 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,7 @@ Resource ../../resources/ssh_keywords.resource
Resource ../../resources/virtualization_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource
Test Setup Business Apps Test Setup
Test Teardown Business Apps Test Teardown


Expand All @@ -16,69 +17,59 @@ Test Teardown Business Apps Test Teardown
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}
Check that the application was started outlook

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}
Check that the application was started microsoft365

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}
Check that the application was started teams

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}
Check that the application was started chrome

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}
Check that the application was started lossless

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}
Check that the application was started text-editor

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}
Check that the application was started xarchiver


*** Keywords ***

Business Apps Test Setup
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}

Business Apps Test Teardown
Kill process @{APP_PIDS}
Close All Connections
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
10 changes: 7 additions & 3 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,8 @@ 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 Teardown Gui-vm apps teardown
Test Setup Gui-vm Apps Test Setup
Test Teardown Gui-vm Apps Test Teardown


*** Variables ***
Expand Down Expand Up @@ -55,7 +55,11 @@ Start File Manager on LenovoX1

*** Keywords ***

Gui-vm apps teardown
Gui-vm Apps Test Setup
Connect to netvm
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}

Gui-vm Apps Test Teardown
Connect to VM ${GUI_VM}
Kill process @{APP_PIDS}
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@

*** 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
Resource ../../resources/connection_keywords.resource
Resource ../../resources/ssh_keywords.resource
Resource ../../config/variables.robot
Suite Setup Initialize Variables And Connect
Suite Teardown Close All Connections
Test Setup Connect to netvm
Test Teardown Close All Connections
Test Timeout 2 minutes


*** Test Cases ***
Check Camera Application
[Documentation] Check that camera application is available in business-vm and not in other vm
[Tags] SP-T235
Connect to netvm
FOR ${vm} IN @{VMS}
Connect to VM ${vm}
${out} Execute Command v4l2-ctl --list-devices sudo=True sudo_password=${PASSWORD}
Expand All @@ -30,7 +29,6 @@ Check Camera Application
Record Video With Camera
[Documentation] Start Camera application and record short video
[Tags] SP-T236
Connect to netvm
Connect to VM ${BUSINESS_VM}
Execute Command rm /tmp/video* sudo=True sudo_password=${PASSWORD}
@{recorded_video_ids} Create List
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ Sysbench test in VMs on LenovoX1
... chrome-vm=4
... comms-vm=4
... admin-vm=1
... audio-vm=1
... audio-vm=2
... business-vm=4
${vms} Get Dictionary Keys ${threads}
@{FAILED_VMS} Create List
Set Global Variable @{FAILED_VMS}
Expand Down

0 comments on commit 67f34cc

Please sign in to comment.