openbmc / openbmc-test-automation

Apache License 2.0
100 stars 92 forks source link

Question about "Verify Boot AttemptsLeft When Power Off" in test soft boot sensor #2224

Closed Julia-Delta closed 9 months ago

Julia-Delta commented 9 months ago

According to the test robot

Verify Boot AttemptsLeft When Power Off
    [Documentation]  Verify the number of boots left while the system is poweref off.
    [Tags]  Verify_Boot_AttemptsLeft_When_Power_Off
    [Template]  Validate Boot AttemptsLeft

    # System at standby    AttemptsLeft
    Off                    2

This testing result is that AttemptsLeft should be 2.

But AttemptsLeft is a counting number about reboot times. In host_state_manager.cpp

Host::Transition Host::requestedHostTransition(Transition value)
{
    info("Host state transition request of {REQ}", "REQ", value);
    // If this is not a power off request then we need to
    // decrement the reboot counter.  This code should
    // never prevent a power on, it should just decrement
    // the count to 0.  The quiesce handling is where the
    // check of this count will occur
    if (value != server::Host::Transition::Off)
    {
        decrementRebootCount();
    }
   ...
}

If power off, AttemptsLeft would not reduced.

In my opinion, the test result should be 3

     # System at standby    AttemptsLeft
-    Off                    2
+    Off                    3
gkeishin commented 9 months ago

@SrideviRamesh can u take a look at this ?

SrideviRamesh commented 9 months ago

Thanks for identifying the bug. Fix provided in https://gerrit.openbmc.org/c/openbmc/openbmc-test-automation/+/67672