openbmc / openbmc-test-automation

Apache License 2.0
100 stars 92 forks source link

Question about "Test Watchdog Reset Via IPMI And Verify Using REST" in test general ipmi #2226

Open Julia-Delta opened 9 months ago

Julia-Delta commented 9 months ago

Hi developers, In this test item, I have two questions.

  1. 'ipmitool mc watchdog reset' failed. image As the above, I updated the image and test watch reset. But the system returned the result "Reset Watchdog Timer command failed: Attempt to reset uninitialized watchdog" The user had to set /xyz/openbmc_project/watchdog/host0/attr/Initialized be true then reset watchdog worked. In the robot framework:

    Test Watchdog Reset Via IPMI And Verify Using REST
    [Documentation]  Test watchdog reset via IPMI and verify using REST.
    [Tags]  Test_Watchdog_Reset_Via_IPMI_And_Verify_Using_REST
    
    Initiate Host Boot
    Set Watchdog Enabled Using REST  ${1}
    Watchdog Object Should Exist
    
    # Resetting the watchdog via IPMI.
    Run IPMI Standard Command  mc watchdog reset
    
    # Verify the watchdog is reset using REST after an interval of 1000ms.
    Sleep  1000ms
    ${watchdog_time_left}=
    ...  Read Attribute  ${HOST_WATCHDOG_URI}  TimeRemaining
    Should Be True
    ...  ${watchdog_time_left}<${1200000} and ${watchdog_time_left}>${2000}
    ...  msg=Watchdog timer didn't reset.

    These was no command to set Initialized be true. How do I add the command which set initialized true?

  2. The watchdog_time_left needs to less than 1200000 Watchdog default interval value is 3600000. I think that it's hard that watchdog_time_left to be less 1200 seconds after the interval reset and waited 1 second.

Should I modify the default interval as 1200000? Or I modify the comparison value be 3599000?

gkeishin commented 9 months ago

For 1) Check https://github.com/openbmc/openbmc-test-automation/blob/master/lib/utils.robot#L1097 you can do something like that to set the attribute

2) I believe you go ahead and modify it.. this hasn't changed since, so it's not updated and I believe your interval mentioned would be correct.

Julia-Delta commented 9 months ago

Thanks for your comment.

I have one more question. Why does the test plan always set power policy be AlwaysOff before testing, and not reset to default value when finished?

gkeishin commented 9 months ago

As far I remember when we started.. we always wanted it to be off by default. That power policy is ONLY driven by the AC cycle when applied to the system and doesn't come in any other use cases. Historically, we just wanted to set it to off which is by default anyway.

Julia-Delta commented 9 months ago

About power policy, Where can I find the spec or description about power policy setting? I know that host will be power off after reboot when power policy set AlwaysOff. But I confuse that testing run automatically, some test items wait rebooted successfully and check obmc state be good, How the test result will be passed when power policy is AlwaysOff?

I have another question about boot_progress in state management. What is different between OSStart and OSRunning? The co-worker thinks that boot_progress set OSStart and next step be OSRunning, Is it right description? If the host state entering OSRunning state, auto-test checking will be always failed.

gkeishin commented 8 months ago
  1. Power recovery policy https://github.com/openbmc/docs/blob/5ae481581052b996966ef4c3df18afb12b1fbda8/designs/power-recovery.md

  2. On the boot progress: https://github.com/openbmc/docs/blob/5ae481581052b996966ef4c3df18afb12b1fbda8/designs/boot-progress.md

and as for OSStart this are older REST legacy state.. we still need to go clean up upcoming .