Reset/reload when host is booted in loop.
Changes:
- Added test to perform reset/reload in loop.
- Check for OCC active state post reset.
- Check for errors from journald log.
- Keyword to scrub journald log.
Resolves openbmc/openbmc-test-automation#1256
Change-Id: I2fc4c1dcdfef1d5087e0ef44854631afd331f950
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 081d4b9..0b08f7e 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -1472,3 +1472,13 @@
Should Contain Match ${ip_data} ${ip_address}/*
... msg=${ip_address} not found in the list provided.
+
+
+Remove Journald Logs
+ [Documentation] Remove all journald logs and restart service.
+
+ ${cmd}= Catenate systemctl stop systemd-journald.service &&
+ ... rm -rf /var/log/journal && systemctl start systemd-journald.service
+
+ BMC Execute Command ${cmd}
+
diff --git a/tests/test_reset_reload.robot b/tests/test_reset_reload.robot
index a19e8ce..75670cf 100644
--- a/tests/test_reset_reload.robot
+++ b/tests/test_reset_reload.robot
@@ -5,12 +5,17 @@
Resource ../lib/rest_client.robot
Resource ../lib/state_manager.robot
Resource ../lib/openbmc_ffdc.robot
+Resource ../lib/utils.robot
+Resource ../lib/boot_utils.robot
+Resource ../lib/open_power_utils.robot
+Library ../lib/bmc_ssh_utils.py
Test Setup Open Connection And Log In
Test Teardown Test Teardown Execution
*** Variables ***
+${LOOP_COUNT} ${1}
*** Test Cases ***
@@ -29,8 +34,29 @@
Wait Until Keyword Succeeds 5 min 10 sec Is OS Booted
+Test Reset Reload When Host Booted
+ [Documentation] Reset reload when host is booted.
+ [Tags] Test_Reset_Reload_When_Host_Booted
+ [Setup] Remove Journald Logs
+
+ Repeat Keyword ${LOOP_COUNT} times Reboot BMC And Check For Errors
+
+
*** Keywords ***
+Reboot BMC And Check For Errors
+ [Documentation] Boot to OS, reboot BMC and verify OCC and logs.
+
+ OBMC Reboot (run)
+
+ Verify OCC State ${1}
+
+ ${journal_log}= BMC Execute Command
+ ... journalctl --no-pager | egrep 'SEGV|core-dump' ignore_err=1
+
+ Should Be Empty ${journal_log}
+
+
Check Reset Reload Status
[Documentation] Returns reset reload status based on file presence.