Skip to content

Commit

Permalink
Fix global variable
Browse files Browse the repository at this point in the history
Signed-off-by: Mariia Azbeleva <[email protected]>
  • Loading branch information
azbeleva committed Jan 2, 2025
1 parent e07bb80 commit 2467312
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Robot-Framework/resources/common_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

*** Settings ***
Resource ../config/variables.robot
Resource ../resources/gui_keywords.resource


*** Keywords ***
Expand Down Expand Up @@ -37,11 +38,10 @@ Check If Ping Fails
Should Not Be Equal ${result.rc} ${0}

Run journalctl recording
${output} Execute Command journalctl > jrnl.txt
${output} Execute Command nohup journalctl -f >> jrnl.txt 2>&1 &
${output} Execute Command nohup journalctl -f >> /tmp/jrnl.txt 2>&1 &

Log journctl
${output} Execute Command cat jrnl.txt
${output} Execute Command cat /tmp/jrnl.txt
Log ${output}
@{pid} Find pid by name journalctl
Kill process @{pid}
Expand Down
2 changes: 1 addition & 1 deletion Robot-Framework/resources/connection_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Initialize Variables And Connect
FAIL Failed because port 22 of device was not available, tests can not be run.
END
${CONNECTION} Connect
Set Suite Variable ${CONNECTION}
Set Global Variable ${CONNECTION}

Initialize Variables, Connect And Start Logging
Initialize Variables And Connect
Expand Down
4 changes: 4 additions & 0 deletions Robot-Framework/resources/ssh_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ Start XDG application
${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 &
Sleep 8
${output} Execute Command cat output.log
Log ${output}

Start Firefox
[Documentation] It's needed to set display variable manually because there is no real monitor connected to DUT
Expand Down Expand Up @@ -491,6 +494,7 @@ Connect to VM if not already connected

Detect first boot
[Documentation] Determine desktop state after boot by attempting login to gui-vm as testuser
Connect
Log To Console Detecting if this is first boot by trying test user credentials
Verify service status range=15 [email protected] expected_status=active expected_state=running
Connect to netvm
Expand Down
24 changes: 22 additions & 2 deletions Robot-Framework/test-suites/bat-tests/__init__.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,35 @@ Resource ../../resources/ssh_keywords.resource
Resource ../../resources/serial_keywords.resource
Resource ../../resources/common_keywords.resource
Resource ../../resources/connection_keywords.resource
Suite Setup Initialize Variables, Connect And Start Logging
Suite Setup BAT tests setup
Suite Teardown End Logging And Close Connections


*** Keywords ***

BAT tests setup
Initialize Variables, Connect And Start Logging

IF "Lenovo" in "${DEVICE}"
${first_boot} Detect first boot
Close All Connections
${connection} Connect
Connect to netvm
Connect to VM ${GUI_VM}
Save most common icons and paths to icons
IF ${first_boot}
Create test user
END
GUI Log in
GUI Log out
Close All Connections
${connection} Connect
END


End Logging And Close Connections
IF ${CONNECTION}
Connect
Log journctl
END
Close All Connections
Close All Connections
1 change: 0 additions & 1 deletion Robot-Framework/test-suites/bat-tests/business_vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Resource ../../resources/ssh_keywords.resource
Resource ../../resources/virtualization_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource

Suite Teardown Close All Connections


Expand Down
2 changes: 2 additions & 0 deletions Robot-Framework/test-suites/bat-tests/gui-vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ Gui-vm apps teardown
Connect to VM ${GUI_VM}
Kill process @{app_pids}
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
${app_log} Execute command cat output.log
Log ${app_log}

0 comments on commit 2467312

Please sign in to comment.