Skip to content

Commit

Permalink
Verify init.scope status after first boot
Browse files Browse the repository at this point in the history
Signed-off-by: Mariia Azbeleva <[email protected]>
  • Loading branch information
azbeleva committed Nov 8, 2023
1 parent 0deaf36 commit 9d6850a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
16 changes: 8 additions & 8 deletions Robot-Framework/resources/serial_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,28 @@ Log In To Ghaf OS
END
IF ${status}==False FAIL Console is not ready

Verify Systemctl status via serial
Verify init.scope status via serial
[Arguments] ${range}=60
[Documentation] Check is systemctl running with given loop ${range}
[Documentation] Check if init.scope service is running with given loop ${range}
Connect via serial
${start_time}= Get Time epoch
FOR ${i} IN RANGE ${range}
Write Data systemctl status${\n}
Write Data systemctl status init.scope${\n}
${output} = SerialLibrary.Read Until terminator=Units
Write Data \x03${\n} # write ctrl+c to stop reading status
${status}= Get Systemctl Status ${output}
${status}= Get Service Status ${output}
IF '${status}' not in ['running', 'starting']
Log To Console Systemctl status is ${status}
FAIL Systemctl is not running! Status is ${status}
Log To Console init.scope status is ${status}
FAIL init.scope is not running! Status is ${status}
ELSE IF '${status}' == 'running'
${diff}= Evaluate int(time.time()) - int(${start_time})
Log To Console Systemctl status is ${status}
Log To Console init.scope status is ${status}
RETURN
END
Sleep 1
END
${diff}= Evaluate int(time.time()) - int(${start_time})
FAIL Systemctl is not running after ${diff} sec! Status is ${status}
FAIL init.scope is not running after ${diff} sec! Status is ${status}
[Teardown] Delete All Ports

Connect via serial
Expand Down
2 changes: 1 addition & 1 deletion Robot-Framework/resources/ssh_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ Connect
Verify Systemctl status
[Arguments] ${range}=60
[Documentation] Check is systemctl running with given loop ${range}
Connect
${start_time}= Get Time epoch
FOR ${i} IN RANGE ${range}
${output}= Execute Command systemctl status
${status}= Get Systemctl Status ${output}
Log ${output}
IF '${status}' not in ['running', 'starting']
Log To Console Systemctl status is ${status}
FAIL Systemctl is not running! Status is ${status}
Expand Down
7 changes: 7 additions & 0 deletions Robot-Framework/test-suites/bat-tests/others.robot
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ Check QSPI version
[Setup] Connect
Check QSPI Version is up to date
[Teardown] Close All Connections

Check systemctl status
[Documentation] Verify systemctl status is running
[Tags] bat SP-T104 nuc orin-agx orin-nx
[Setup] Connect
Verify Systemctl status
[Teardown] Close All Connections
7 changes: 4 additions & 3 deletions Robot-Framework/test-suites/boot_test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ${IS_AVAILABLE} False
*** Test Cases ***

Verify booting after restart by power
[Documentation] Restart device by power and verify systemctl status is running
[Documentation] Restart device by power and verify init service is running
[Tags] boot plug
Reboot Device
Check If Device Is Up
Expand All @@ -34,9 +34,10 @@ Verify booting after restart by power
Log To Console The device started
END
IF "${CONNECTION_TYPE}" == "ssh"
Verify Systemctl status
Connect
Verify service status service=init.scope
ELSE IF "${CONNECTION_TYPE}" == "serial"
Verify Systemctl status via serial
Verify init.scope status via serial
END
[Teardown] Teardown

Expand Down

0 comments on commit 9d6850a

Please sign in to comment.