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 Dec 27, 2024
1 parent e07bb80 commit 0427b22
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
27 changes: 24 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 Expand Up @@ -86,3 +86,24 @@ Log versions
Log to console Ghaf version: ${ghaf_version}
${nixos_version} Execute Command nixos-version
Log to console Nixos version: ${nixos_version}

Initiate first log in for Lenovo
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}
Close All Connections
${connection} Connect
Connect to netvm
Connect to VM ${GUI_VM}
Create test user
END
GUI Log in
GUI Log out
Close All Connections
${connection} Connect
END
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
2 changes: 1 addition & 1 deletion Robot-Framework/test-suites/bat-tests/__init__.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 Run Keywords Initialize Variables, Connect And Start Logging AND Initiate first log in for Lenovo
Suite Teardown End Logging And Close Connections


Expand Down
4 changes: 3 additions & 1 deletion Robot-Framework/test-suites/bat-tests/gui-vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Start File Manager on LenovoX1
*** Keywords ***

Gui-vm apps teardown
Connect to VM ${GUI_VM}
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}
Kill process @{app_pids}
${app_log} Execute command cat output.log
Log ${app_log}
Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD}

0 comments on commit 0427b22

Please sign in to comment.